Skip to main content

Execution Flow

Every 2501 runner start call goes through these phases: Pre-flight: validates the environment: configuration load, DB connectivity, org/tenant/user IDs, gateway connectivity, and Ansible availability. Scenario Discovery: scans the scenarios directory, loads all scenario.json files, resolves the -s argument against available keys and tags. Per-Scenario Loop: for each matched scenario (and each iteration when -i > 1):
  • Provision: resolve host and agent from the DB (or boot a VM clone in incus/lima mode)
  • Prepare: run restore.yml silently to clear stale state, then run prepare.yml (abort if it fails)
  • Flush: flush memory for the scenario’s agents
  • Execute: create a ticket through the selected gateway, then poll until the job is found and completes
  • Validate: evaluate the validation rules declared in scenario.json, and run validate.yml if the scenario declares it
  • Restore / Teardown: in host mode run restore.yml to reset the host (non-fatal if it fails); in VM modes destroy the clone
Report: prints a summary table and persists a Benchmark plus per-scenario ScenarioReport rows to the DB. The process exits 0 unless a pre-flight or infrastructure error occurs, or --fail-on-error is set and at least one scenario failed.

Options


Gateways

The -g, --gateway flag controls how each scenario’s ticket is submitted. Every scenario is dispatched by creating a ticket; the runner then waits for the resulting job to complete. --gateway runner (default): POSTs directly to the engine’s runner gateway endpoint. Requires ENGINE_API_URL and ENGINE_API_KEY.
--gateway servicenow: creates an incident in ServiceNow, exercising the full integration (gateway to job to agent to ticket resolution). Requires the SERVICENOW_* env vars.

Scenario Source

The --source flag controls where scenario files come from. --source git (default): clones the repository given by GIT_RUNNER_REPOSITORY (branch GIT_REF, default main) using GIT_RUNNER_PAT, then reads scenarios from the clone. With --scenarios-path, the path is resolved relative to the repo root. --source fs: reads scenarios from the local filesystem at --scenarios-path (or an auto-detected default).

Environment Variables


Common Patterns