Unit Test Logic Source
To test-run a logic entry file in LOC simple runtime using mocked input data.
What is the difference between LOC Simple Runtime and LOC Runtime?
LOC simple runtime is a special runtime built for unit test purpose, and does not own dedicated CPU cores like the LOC runtime. The logic source would be built into a temporary asset, which will not be used to create actual logic.
A logic running in the simple runtime have access to most of the agents, including the event store agent. Be noted that the unit test only shows execution status and logs (from the logging agent) while task result is not viewable.
Run Test of an Entry File
- LOC Studio
- Select an existing entry file in the logic source, and click Build for Test on the top right.
- The unit test will run the logic as if it is in a data process invoked by a mocked API route trigger. The following mocked input can be configured:
Mocked Input | Description |
---|---|
Inbound | HTTP request querystring or body |
Logic Body | "Existing" session storage keys and values (see: Session Storage Agent) |
Outbound | Agent configuration reference (for creating agent configurations, see Create an Agent Configuration.) |
info
The mocked API route will be a GET
request, the same as in manually executing a data process.
- Wait for the logic to finish building and executing.
The execution result and log should be available shortly: