Skip to content

Test commands

The CLI provides commands for validating and managing E2Engine Tests.

e2engine validate test
e2engine create test
e2engine get test
e2engine get tests
e2engine run test
e2engine delete test

For the Test resource model and specification format, see Tests.

Validate a Test specification before creating it:

Terminal window
e2engine validate test <spec-path>

For example:

Terminal window
e2engine validate test test.yaml

If the specification is valid, the command prints:

Test spec is valid

Validation checks the specification against the Test model and its validation rules without creating a persistent Test resource.

Use --verbose or -v to display the validated Test:

Terminal window
e2engine validate test test.yaml --verbose

Table output provides a compact representation of the resource. Use JSON or YAML to inspect the complete validated model:

Terminal window
e2engine validate test test.yaml -o yaml -v
Terminal window
e2engine validate test test.yaml -o json -v

Use --quiet or -q when only the command result is needed:

Terminal window
e2engine validate test test.yaml --quiet

A successful validation produces no output. An invalid specification returns an error.

This form is useful in scripts and CI/CD pipelines.

Create a Test from a specification:

Terminal window
e2engine create test <spec-path>

For example:

Terminal window
e2engine create test test.yaml

On success, the default output identifies the created resource:

created test, name: successful-payment id: <test-id> version: 1.0.0

Use --verbose to display the created Test instead of the compact confirmation:

Terminal window
e2engine create test test.yaml --verbose

The default table format shows the resource metadata. JSON and YAML expose the complete created Test:

Terminal window
e2engine create test test.yaml -o yaml -v

With --quiet, the command prints only the ID of the created Test:

Terminal window
e2engine create test test.yaml --quiet

This is useful when another command or script needs to capture the new resource ID.

Retrieve a Test using its name or an ID prefix:

Terminal window
e2engine get test <ref>

For example:

Terminal window
e2engine get test successful-payment

or:

Terminal window
e2engine get test f80d87062437

The default table output provides a compact view of the resource.

Use YAML or JSON to retrieve its complete structured representation:

Terminal window
e2engine get test successful-payment -o yaml
Terminal window
e2engine get test successful-payment -o json

This includes the Test specification with its request and expectations.

List stored Tests using the plural tests command:

Terminal window
e2engine get tests

The default output is a table:

ID NAME VERSION CREATED UPDATED
------------ ------------------------- ------- --------------------------- ---------------------------
f80d87062437 successful-payment 1.0.0 2026-09-27T11:51:36.828605Z 2026-09-27T11:51:36.828605Z
4746ba6a4b8f fraud-rejection 1.0.0 2026-09-27T11:51:44.089121Z 2026-09-27T11:51:44.089121Z
37f48bf91fd8 account-rejection 1.0.0 2026-09-27T11:51:51.906569Z 2026-09-27T11:51:51.906569Z
98fb763b97dd fixture-miss-grpc-message 1.0.0 2026-09-28T05:19:35.601536Z 2026-09-28T05:19:35.601536Z

The table contains:

Column Description
ID Compact Test ID
NAME Test name
VERSION Resource version
CREATED Creation timestamp
UPDATED Last update timestamp

Use --limit to restrict the maximum number of Tests returned:

Terminal window
e2engine get tests --limit 20

Values above the configured maximum are capped automatically.

Results can be ordered by:

id
name
version
createdAt
updatedAt

Select the field with --order-by:

Terminal window
e2engine get tests --order-by name

Select ascending or descending order with --order-direction:

Terminal window
e2engine get tests \
--order-by updatedAt \
--order-direction desc

Use JSON or YAML when the list is consumed programmatically:

Terminal window
e2engine get tests -o json
Terminal window
e2engine get tests -o yaml

For table output, use --no-headers to omit column headings:

Terminal window
e2engine get tests --no-headers

Run a Test against an Environment:

Terminal window
e2engine run test <test-ref> <env-ref>

The Test reference comes first, followed by the Environment reference.

For example:

Terminal window
e2engine run test successful-payment payment-demo

The command creates a TestExecution and prints its ID:

created test execution with id: <test-execution-id>

Use the TestExecution ID to inspect the execution and its current status.

How the execution proceeds depends on the configured transport.

With transport.kind: direct, execution is synchronous. The run command waits for the Test to finish before returning.

With transport.kind: socket, execution is asynchronous. The command creates the TestExecution and returns its ID while execution continues through the configured runner. The TestExecution status is updated as execution progresses.

In socket mode, retrieve the TestExecution to inspect its current state:

Terminal window
e2engine get testexecution <test-execution-id>

An execution progresses through the execution lifecycle described in Executions.

Use --quiet or -q to print only the TestExecution ID:

Terminal window
e2engine run test successful-payment payment-demo --quiet

This is useful when a script needs to capture the execution ID for subsequent commands.

--verbose produces the same output as the default mode for run commands.

Delete a Test using its name or an ID prefix:

Terminal window
e2engine delete test <ref>

For example:

Terminal window
e2engine delete test successful-payment

On success, the command confirms the deleted resource:

deleted test, name: successful-payment id: <test-id> version: 1.0.0

Use --quiet to suppress the confirmation:

Terminal window
e2engine delete test successful-payment --quiet

Singular Test commands accept t as a shorter alias:

Terminal window
e2engine validate t test.yaml
e2engine create t test.yaml
e2engine get t successful-payment
e2engine run t successful-payment payment-demo
e2engine delete t successful-payment

The plural get tests command does not define a shorter alias:

Terminal window
e2engine get tests

The full test and tests forms are used throughout this documentation for clarity.

Test commands use the global CLI output options:

-o, --output string Output format (available: table, json, yaml)
--no-headers Omit headers in table output
-q, --quiet Suppress non-error output
-v, --verbose Enable verbose output

Table output is intended for interactive use, while JSON and YAML expose structured E2Engine data for inspection and automation.

See CLI for an overview of CLI conventions, Tests for the Test specification, and Inspecting results for interpreting TestExecution results.