Skip to main content

Parallel Testing

Parallelism is a technique for speeding up test suites by running multiple tests concurrently and then combining the results at the end.

With @argos-ci/cli, you can set up parallel test suites by defining two environment variables:

  • ARGOS_PARALLEL_NONCE: a unique build ID for this parallel build. Argos groups uploaded screenshots using this ID.
  • ARGOS_PARALLEL_TOTAL: the total number of parallel nodes being run. Argos upload must be called exactly this number of times.

Note: Parallel mode can also be set using the --parallel-nonce and --parallel-total command line arguments.

Once configured, the @argos-ci/cli upload command can be run multiple times to aggregate screenshots in the same build

export ARGOS_PARALLEL_NONCE=<unique-build-id>
export ARGOS_PARALLEL_TOTAL=<total-batch-count>

Example: Setting up parallel tests with github actions

.github/workflows/ci.yml
- name: Upload screenshots to argos-ci.com
continue-on-error: true
env:
ARGOS_PARALLEL_NONCE: ${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}
ARGOS_PARALLEL_TOTAL: ${{ strategy['job-total'] }}
run: npm exec argos upload --parallel ./screenshots