Skip to content

Scenarios in CI

Scenarios live in your repository and run from your pipeline through the Platform’s CI client, a single Python file the Platform serves. Each scenario becomes a test case in a JUnit report, so your CI shows failures where it shows every other test.

curl -fsSL -o iso8583sim-run.py https://platform.example.com/iso8583sim-run.py
python iso8583sim-run.py --url https://platform.example.com --junit report.xml scenarios/*.yaml

It needs an API token in ISO8583SIM_PLATFORM_TOKEN (Settings, API tokens; give it the permissions runs.start and, for evidence packs, evidence.create, and nothing more) and Python 3.10 or later with nothing to install. The files run one after another as a suite; the exit code is 0 when every scenario passed. --suite NAME names the suite (scenarios whose state has scope: suite share it); --timeout and --poll set how long to wait for a run and how often to ask.

The files run as they are in the repository in whichever environment the pipeline names: --environment UAT applies the environment’s targets and variables on the Platform (the environments walkthrough), so one job runs the same files in DEV and in UAT with one flag changed.

Copy the one for your system from examples/ci in the Platform’s repository, or from the links below, and set two things: the token as a secret, and the Platform’s address.

System File Secret Address
GitHub Actions examples/ci/github-actions.yml repository secret ISO8583SIM_PLATFORM_TOKEN repository variable ISO8583SIM_PLATFORM_URL
GitLab CI examples/ci/gitlab-ci.yml masked CI/CD variable ISO8583SIM_PLATFORM_TOKEN CI/CD variable ISO8583SIM_PLATFORM_URL
Jenkins examples/ci/Jenkinsfile secret text credential ISO8583SIM_PLATFORM_TOKEN PLATFORM in the environment block
Azure Pipelines examples/ci/azure-pipelines.yml secret variable ISO8583SIM_PLATFORM_TOKEN variable ISO8583SIM_PLATFORM_URL

Each template runs on pushes and merge requests and on a weekday night at 02:00, publishes report.xml as a JUnit result, and keeps the file as an artifact.

With --comment, the client posts a summary on the pull request (GitHub Actions) or the merge request (GitLab CI): a table of the scenarios with their result, counts and a link to each run, then the failing steps with their messages. It updates its earlier comment on the same pull request instead of adding another, and on GitHub Actions it also writes the summary to the job summary.

  • GitHub Actions: the job needs permissions: pull-requests: write and GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} in the step’s environment, as the template has. A push that isn’t a pull request gets the job summary only.
  • GitLab CI: set GITLAB_TOKEN, a project access token with the api scope, as a masked CI/CD variable; the job token can’t write notes.

A comment that can’t be posted is reported and the build’s result stays the scenarios’.

With --xray-project KEY, the client sends the JUnit results to Xray as a test execution in that project, and --xray-plan KEY puts it under a test plan. Each scenario becomes a test in the execution, named by the scenario; Xray creates the test issues on the first upload and matches them by name after.

  • Xray Cloud: create an API key in Xray’s settings and set XRAY_CLIENT_ID and XRAY_CLIENT_SECRET as secrets.
  • Xray Server or Data Center: set XRAY_TOKEN, a Jira personal access token, and --xray-url https://jira.example.com.

The client prints the execution’s key; an upload that fails is reported and the build’s result stays the scenarios’.

The client prints each scenario’s steps with their failures as the run goes, the same text the console shows, and the JUnit report carries the failure messages, so a failing step reads in the pipeline’s test tab: which field, what it was, what was expected. The run itself stays on the Platform with the messages sent and received; the console’s Runs page lists runs started from CI with the API token’s name.

  • A pull request that changes a scenario runs it before merge.
  • The nightly run is the regression pack; the Platform’s own schedules (the schedules walkthrough) do the same without a pipeline.
  • --comment puts the results on the pull request; a GitHub App with checks is a later step.