Skip to main content

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

  1. Select an existing entry file in the logic source, and click Build for Test Test on the top right.
Build-for-test
  1. 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 InputDescription
InboundHTTP request querystring or body
Logic Body"Existing" session storage keys and values (see: Session Storage Agent)
OutboundAgent 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.

  1. Wait for the logic to finish building and executing.
Build-for-test-result

The execution result and log should be available shortly:

Build-for-test-log