Penstock

JetBrains / Using it

Tests in the IDE

In a JetBrains IDE, test-case files run in the IDE's own test runner, and process tests run and debug from the diagram.

Pro Team in a pipeline

The Scenarios panel and the scenarios themselves are described once in Scenarios, and process tests and coverage in Process tests and coverage. This page is about how they use the IDE.

Run test-case files in the test runner

  1. Open a test case file, for example orders.json.
  2. Click the green triangle in the gutter next to a test case. Or right-click the file, or a folder called test-cases, and run it.
  3. The IDE's Run window shows a test tree, pass or fail, and the log. Double-click a test to open it in the file.

The run uses the profile in force, or the one the run configuration names. The trace of each run is kept under .penstock/runs/, and its path is in the log. The same safety rules apply as everywhere: the engine must be marked for tests, or you confirm a local one once.

The Scenarios tab of the sidebar in the IDE, listing the three scenarios of the order-to-cash diagram next to the diagram
The scenarios of a diagram, listed in the Scenarios tab beside the diagram they belong to.

The run configuration

Running a test-case file creates a run configuration of the type Penstock test cases, named after what it runs. It has three fields:

Test-case file or folderOne file, or a folder, in which every test-case file under it runs.
Only the test case namedEmpty to run all of them. The gutter triangle of one test case fills it in.
Engine profileThe profile in force, or a profile of penstock.yaml.

You can run it again from the run widget at the top right of the IDE, like any other run configuration. It is in Run | Edit Configurations too. The test tree is the IDE's own test runner. penstock scenarios run runs the same files in a terminal.

The run happens in Penstock's project core, which needs JCEF. In an IDE without it the Run window says so and points at penstock scenarios run. If the core does not answer within 20 seconds, or does not start within two minutes, the run is stopped and the Run window says which.

Run and debug process tests from the diagram

Coverage

After the process tests have run with Camunda Process Test, or on Camunda 7 with the process test coverage extension, Coverage appears on the editor's toolbar. It reads the reports under target or build and follows them as the tests run again.

What you see

Common problems

The Run window says the engine is not marked for tests.
Set deployment.forTests: true on the profile, or confirm a local engine when asked.
There is no Coverage button.
No test report was found yet. Run the process tests first.
There is no green triangle in the gutter.
The file is not a Camunda test-case file: a .json file in a folder called test-cases, or one that names the cpt-test-cases schema. The IDE's JSON support must also be on.
A run says it needs Pro.
Running a process against an engine is part of Penstock Pro. See Licence in the IDE.