Information for: DEVELOPERS   PARTNERS

Testing a graph

Acquia Journey allows you to test graphs and nodes interactively prior to deployment. This allows you to test a graph with defined test cases. The testing console is available from the Project Editor.

Only a valid graph can be tested. You can validate a graph by clicking the Validate link at the top right of the graph canvas. If the graph is valid, the Valid Graph icon is displayed. If the graph is not valid, you must fix the validation error before the testing console can be used. For more information on troubleshooting errors, read the Acquia Journey troubleshooting guide.

Testing console

The testing console is available at the bottom of the graph window.

The testing console 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 graph’s execution. To access the testing console for your graph, complete the following steps:

  1. Sign in to Acquia Journey.
  2. From the projects list, identify the project you want to modify, and click its title. Acquia Journey will display the Overview tab for your project.
  3. In the upper-right corner, click the Graphs tab.
  4. Select the graph you want to test. Acquia Journey will display the graph in the editor.
  5. Click the Up Arrow icon on the Testing Console pane to expand the testing console.

The testing console provides the following controls:

Control Description
Environment list Sets the environment for visual testing. The default environment can be changed from the Project Admin page. For more information, read Creating and managing environments.
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. When the graph is executing, this control is green; when not executing, it is gray.
Clear logs Clears the testing console and removes information from all previous runs.
Maximize Maximizes the testing console. The console can also be enlarged by grabbing the bar between the graph window and the console and moving it up or down.
Minimize Minimizes the testing console. The console can also be shrunk by grabbing the bar between the graph window and the console and moving it up or down.

Testing settings

To configure your test settings, click Start. The test configuration varies based on whether your graph has a listener attached or not:

  • If your graph does not have a listener attached, in the Test Settings dialog you can enter a valid JSON payload, such as from the execution of another graph.
  • If your graph has a listener attached, in the Test Settings dialog you can select one of the following options:
    • Iterations – Graph executes until the specified number of iterations has occurred.
    • Duration – Graph executes until the number of seconds has elapsed.
    • Data – Graph executes a single time with the specified JSON payload.

During visual testing, graph execution is limited to prevent interactive graphs from locking 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 then display Finished if the graph is not a listener.

To view the console output, click the expand icon in the Test Console. For each transaction, click the expand icon to display the execution details for that transaction. Each transaction displays a row for every graph node. The final two rows display Total Elapsed Time and Data Store Values, respectively. The most recent execution of the graph will always be appended to the end of the Testing Console log.

The testing console displays the following information for every node executed in a transaction:

  • Name of the node and, if it is an adaptor, its type
  • Execution time (usually in milliseconds)
  • Return value of the node

In addition, after a transaction completes, the Total Elapsed Time is reported.

You can examine the Data Store Values after a transaction completes by clicking the expand icon next to each value you want to display. You can examine the entire data schema by clicking Expand All. If you want to copy some or all of the data schema, click Display JSON to open a dialog with the schema in JSON format.

If an error occurs with one of your nodes during execution of a transaction, the row of the offending node is displayed highlighted in orange in the Testing Console. An example with detail of the error message from the engine is displayed below:

For a listener graph that runs for multiple iterations, you can point to a transaction and Acquia Journey will highlight the execution path taken.