Parallel testing (sharding)
Collect screenshots from sharded or parallelized test runs into a single Argos build across your CI nodes.
When a test suite is split across several CI jobs — Playwright shards, a test matrix, or independent suites in a monorepo — each job uploads its own screenshots. Parallel mode tells Argos to collect all these uploads into a single build, so you review one comparison and get one status check for the commit.
Uploads are correlated by a nonce, a unique identifier shared by all jobs of the same run. On most CI providers (GitHub Actions, GitLab CI, CircleCI…), Argos derives the nonce automatically from the pipeline run, so jobs of the same run join the same build without any configuration.
Playwright
Argos integrates with Playwright out of the box, including Playwright test sharding: the reporter detects the shard configuration and joins the parallel build automatically. For more details, refer to the Argos Playwright SDK.
If you use an advanced orchestration system like the excellent one from Currents, use finalize mode instead: the number of shards isn't known upfront.
Other SDKs
For environments beyond Playwright, parallel mode is configured through environment variables:
ARGOS_PARALLEL: Activate the parallel mode.ARGOS_PARALLEL_TOTAL: The number of expected uploads, or-1for finalize mode.ARGOS_PARALLEL_INDEX: The index of the current parallel node. Must start from1.ARGOS_PARALLEL_NONCE: A unique identifier for each build. In most CI environments, Argos generates it automatically from the pipeline run.
Choosing a mode
There are two parallel modes. Pick one based on whether you know, when the pipeline starts, exactly how many uploads will happen.
Count mode
Set ARGOS_PARALLEL_TOTAL to the number of parallel jobs. Argos finalizes the build automatically once it has received that many uploads.
Use count mode when the number of uploads is fixed and guaranteed, typically a static CI matrix where every job always uploads — it's the simplest setup, with no extra CI step.
If fewer uploads than ARGOS_PARALLEL_TOTAL arrive — a job failed before uploading, was skipped by a condition or a cache — the build never completes and the commit status stays pending. If uploads can be skipped, use finalize mode.
Finalize mode
Set ARGOS_PARALLEL_TOTAL to -1. Each upload joins the build as a shard, and the build stays open until you explicitly close it by running argos finalize in a step that runs after all uploads.
Use finalize mode whenever the number of uploads isn't known upfront or isn't guaranteed:
Dynamic shard counts — the matrix size varies per run, or an orchestrator (e.g. Currents) decides how tests are distributed.
Conditional uploads — some jobs only run when their part of the codebase changed, or are skipped by a task cache such as Turborepo or Nx. See Cached CI pipelines.
Aggregating independent suites — several packages or tools upload to the same build name at different points of the pipeline, and no single job knows how many uploads to expect.
When it's possible that no upload happens at all (every suite skipped or cached), pass --skip-if-empty to argos finalize: instead of doing nothing, it creates a skipped build so a required Argos status check still reports success on the commit.
Implementing in GitHub Actions
Count mode, with a static shard matrix
Finalize mode
A dedicated job closes the build once all test jobs have run:
If the upload steps are conditional and may all be skipped, use argos finalize --skip-if-empty so the commit still gets a successful (skipped) Argos build.
Troubleshooting / FAQ
Last updated
Was this helpful?