Testing a graph

Acquia Journey allows you to test graphs and nodes interactively prior to deployment. By doing this, you can test individual components using user supplied test cases, by specifying one of an input data JavaScript object, a number of iterations of a graph or by specifying a fixed time duration. The Project Editor with the testing console expanded is shown below:

Journey testing console

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.

Testing console

Testing console

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:

Control Description
Start 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.
Stop Stops the execution of the current graph. Shown as green when the graph is executing.
Clear Logs Clears the testing console and removes information from all previous runs.
MaximizeMinimize 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.

Testing settings

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.

Standard graph test

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.

Graph with listener test

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.

Graph with listener test

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.

Testing console output

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:

Testing console error output

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.

Contact supportStill need assistance? Contact Acquia Support