From 58885f26b4cea3dba046929b545eb1ed0812031f Mon Sep 17 00:00:00 2001 From: Dylan Frankland Date: Mon, 10 Aug 2026 19:13:06 +0000 Subject: [PATCH 1/2] Document quarantining without uploading via --dry-run Adds a "Quarantining without uploading" section to the quarantining page and a --dry-run row to the CLI reference options table. The flag was previously undocumented: it skips the upload (writing the bundle to ./bundle_upload locally) while the quarantine check still runs and still overrides the exit code. Co-Authored-By: Claude Fable 5 --- flaky-tests/quarantining/index.mdx | 20 +++++++++++++++++++- flaky-tests/reference/cli-reference.mdx | 1 + 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/flaky-tests/quarantining/index.mdx b/flaky-tests/quarantining/index.mdx index dfb87eb8..d9e9245c 100644 --- a/flaky-tests/quarantining/index.mdx +++ b/flaky-tests/quarantining/index.mdx @@ -220,7 +220,25 @@ You can also wrap the test command with the Trunk Analytics CLI. When wrapping t -## Overriding individual tests +## Quarantining without uploading + +If you want quarantining to gate your CI job but don't want that run's test results uploaded to Trunk, pass the `--dry-run` flag (or set the `TRUNK_DRY_RUN=true` environment variable) to the `upload` or `test` command: + +```bash +./trunk-analytics-cli upload \ + --org-url-slug $TRUNK_ORG_URL_SLUG \ + --token $TRUNK_API_TOKEN \ + --junit-paths $JUNIT_PATH \ + --dry-run +``` + +With `--dry-run`, the CLI still checks your failed tests against Trunk's quarantine service and overrides the exit code — returning `0` when all failures are quarantined — but writes the test results bundle to a local `./bundle_upload` directory instead of uploading it to Trunk. + +Keep in mind: + +* An organization token and network access are still required; the quarantine check queries Trunk's backend to determine which tests are quarantined. +* Because nothing is uploaded, the run won't appear in your dashboard or contribute to [flaky test detection](../detection/). Quarantining decisions are based on results from your other, uploading CI jobs. +* The local bundle written to `./bundle_upload` can also be useful for inspecting exactly what the CLI would have uploaded. If you have tests that should never be quarantined or should always be quarantined regardless of their current health status, you can do this by overriding individual tests. diff --git a/flaky-tests/reference/cli-reference.mdx b/flaky-tests/reference/cli-reference.mdx index 932b8f73..66903ede 100644 --- a/flaky-tests/reference/cli-reference.mdx +++ b/flaky-tests/reference/cli-reference.mdx @@ -258,6 +258,7 @@ The `upload` and `test` commands accept the following options: | `--allow-empty-test-results` | Don't fail commands if test results are empty or missing. Use it when you sometimes skip all tests for certain CI jobs. Defaults to `true`. | | `--variant ` | Upload tests to a specific variant group. **Optional**. | | `--test-process-exit-code` `` | Specify the exit code of the test previously run. This is used by the upload command to identify errors that happen outside of the context of the test execution (such as build errors). | +| `--dry-run` | Write the test results bundle to a local `./bundle_upload` directory instead of uploading it to Trunk. [Quarantining](../quarantining/#quarantining-without-uploading) still runs and still determines the exit code. Can also be set with the `TRUNK_DRY_RUN=true` environment variable. **Optional**. | **Memory Overhead** From b24da8fc7bd0123c6f1bd75514787e01819786ab Mon Sep 17 00:00:00 2001 From: Dylan Frankland Date: Mon, 10 Aug 2026 19:32:53 +0000 Subject: [PATCH 2/2] Restore "Overriding individual tests" heading dropped by mistake Co-Authored-By: Claude Fable 5 --- flaky-tests/quarantining/index.mdx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/flaky-tests/quarantining/index.mdx b/flaky-tests/quarantining/index.mdx index d9e9245c..aa2e3412 100644 --- a/flaky-tests/quarantining/index.mdx +++ b/flaky-tests/quarantining/index.mdx @@ -240,6 +240,8 @@ Keep in mind: * Because nothing is uploaded, the run won't appear in your dashboard or contribute to [flaky test detection](../detection/). Quarantining decisions are based on results from your other, uploading CI jobs. * The local bundle written to `./bundle_upload` can also be useful for inspecting exactly what the CLI would have uploaded. +## Overriding individual tests + If you have tests that should never be quarantined or should always be quarantined regardless of their current health status, you can do this by overriding individual tests.