Graphs can be tested only when they are valid. Graph validity can be tested by clicking Validate at the top of the graph. If the graph is valid the Valid Graph icon is displayed at the top right of the graph window. It is not necessary to validate the graph manually as the graph will be automatically validated before the testing console is opened, and any errors will prevent the testing console opening.
The testing console is available at the bottom of the graph window, and it provides insight into both the execution of each step in the graph and the state of the data store and public variables at the end of the execution. The testing console provides the following controls:
|Starts the graph engine and displays the Testing Settings dialog. The control is disabled when the graph is executing, and is available only for valid graphs.|
|Stops the execution of the current graph. Shown as green when the graph is executing.|
|Clears the testing console and removes information from all previous runs.|
|Maximize or minimize the testing console. The console can also be enlarged or shrunk by grabbing the bar between the graph window and the console and moving it up or down.|
After clicking Start, Acquia Journey displays the Testing Settings dialog box, which appears similar to the following for standard graphs without a listener, or most types of nodes.
You can use the Data (JSON) field to paste some JSON data to be used as the input to the graph (which could be the output of a previous graph test).
If the graph has a listener, the Testing Settings dialog box will include the three modes of testing the graph.
There are three modes of testing graphs interactively:
- Iterations - For non-listening graphs the graph will always execute once. For listener graphs the number of iterations will limit the maximum number of times the graph is executed.
- Duration - Specify the number of seconds that the graph should execute for — this is applicable only to listener graphs.
- Data - Execute the graph using the supplied JSON data.
During visual testing there are some limits on graph execution so that interactive graphs don't lock up engines unnecessarily:
- Maximum number of iterations - 1,000
- Duration - Maximum runtime of any graph is 30 minutes
Testing console output
The testing console will display Running if the graph is a listener, and will progress to Finished if the graph is not a listener.
The testing console displays the following information for every node executed in the graph:
- Name of the node and the type of the node if it is an adaptor
- Execution time (usually in milliseconds)
- Return value of the node
The information in the testing console must be expanded using the icon. Second and subsequent runs appear below the first run.
After each execution the Data Store values for the schema and any public variables are also displayed. The final state of the schema is available to be viewed and copied by pressing the Display JSON button.
Errors are shown highlighted in orange and show the detail of the error message from the engine:
If the graph is a listener and there are multiple iterations, pointing to a transaction will indicate its path on the graph by highlighting the path with an orange highlight.