|
| 1 | +--- |
| 2 | +title: Quarantine tests |
| 3 | +description: Keep tests running while temporarily preventing their failures from blocking your Endform suite |
| 4 | +sidebar: |
| 5 | + order: 7 |
| 6 | +--- |
| 7 | + |
| 8 | +import { Image } from "astro:assets"; |
| 9 | +import QuarantineTestBefore from "../../../assets/quarantine-test-before.png"; |
| 10 | +import QuarantineAddRule from "../../../assets/quarantine-add-rule.png"; |
| 11 | +import QuarantineTestAfter from "../../../assets/quarantine-test-after.png"; |
| 12 | +import QuarantineSuiteResults from "../../../assets/quarantine-suite-results.png"; |
| 13 | + |
| 14 | +Quarantine lets you keep selected tests running while you investigate a known |
| 15 | +failure or flaky test. When a quarantined test fails, the suite does not fail. |
| 16 | +Endform still records their actual results, retries, and metrics. |
| 17 | + |
| 18 | +Use a quarantine rule when you want to keep collecting evidence while allowing |
| 19 | +the rest of your suite to determine whether CI passes. Tests still execute and |
| 20 | +use runner time. |
| 21 | + |
| 22 | +## Create a quarantine rule |
| 23 | + |
| 24 | +Run your suite in Endform first so you can select it in the dashboard. |
| 25 | + |
| 26 | +1. Open your organization's **Settings → Quarantine rules**. |
| 27 | +2. Select **Add quarantine rule** and choose a **Suite**. |
| 28 | +3. Fill in at least one matching field: |
| 29 | + - **Test:** Search for and select a test, or paste its test ID. |
| 30 | + - **Playwright project:** Match a project such as `chromium`. |
| 31 | + - **Branch:** Match a branch such as `main`. |
| 32 | +4. Select **Preview matches** to check the scope. |
| 33 | +5. Under **Reason & expiry**, optionally add context for your team and an expiry |
| 34 | + date. The expiry input uses your local time. |
| 35 | +6. Select **Create rule**. The rule applies to matching tests in new suite runs. |
| 36 | + |
| 37 | +All filled-in fields must match exactly. Empty fields match any value within the |
| 38 | +selected suite. For example, selecting only a branch quarantines every test in |
| 39 | +that suite on that branch. Add a test or project condition when you need a |
| 40 | +narrower rule. |
| 41 | + |
| 42 | +The preview uses the latest completed run for the selected suite and branch. It |
| 43 | +counts each matching test once across projects and does not consider other |
| 44 | +quarantine rules. Future runs may contain different tests, so the preview is a |
| 45 | +guide to the rule's scope. |
| 46 | + |
| 47 | +## Example: quarantine a failing Firefox test |
| 48 | + |
| 49 | +This test, `launches firefox in lambda on arm64`, fails because its assertion |
| 50 | +expects `firefox` but receives `chrome`. Before quarantine, the dashboard shows |
| 51 | +the failed result and the assertion error. |
| 52 | + |
| 53 | +<figure> |
| 54 | + <Image |
| 55 | + src={QuarantineTestBefore} |
| 56 | + alt="Failed Firefox test with one failed attempt: expected firefox, received chrome. No quarantine badge is present." |
| 57 | + width={1200} |
| 58 | + /> |
| 59 | + <figcaption>Before quarantine: the test records a failure.</figcaption> |
| 60 | +</figure> |
| 61 | + |
| 62 | +To keep this test running while investigating, select the `endform · e2e` suite |
| 63 | +and the test in **Add quarantine rule**. In this example, **Playwright project** |
| 64 | +and **Branch** are empty, so the rule matches this test across all projects and |
| 65 | +branches in the selected suite. |
| 66 | + |
| 67 | +<figure> |
| 68 | + <Image |
| 69 | + src={QuarantineAddRule} |
| 70 | + alt="Add quarantine rule dialog with the endform e2e suite and Firefox test selected, with project and branch left empty." |
| 71 | + width={580} |
| 72 | + /> |
| 73 | + <figcaption> |
| 74 | + Select the test, preview the matches, and choose Create rule. Reason and |
| 75 | + expiry are optional. |
| 76 | + </figcaption> |
| 77 | +</figure> |
| 78 | + |
| 79 | +The selected test is matched by its ID. Renaming or moving it, or changing its |
| 80 | +describe blocks, creates a different test ID that this rule will not match. |
| 81 | + |
| 82 | +On a new run, the test still executes with its configured retries. If it fails |
| 83 | +after exhausting retries, the suite can still pass when the other tests pass |
| 84 | +and there are no blocking errors. |
| 85 | + |
| 86 | +<figure> |
| 87 | + <Image |
| 88 | + src={QuarantineTestAfter} |
| 89 | + alt="The Firefox test on a later run has both Failed and Quarantined badges, with the original assertion error and trace links still visible." |
| 90 | + width={1200} |
| 91 | + /> |
| 92 | + <figcaption> |
| 93 | + After quarantine: the test still shows Failed, alongside a Quarantined |
| 94 | + badge. Its error and trace links remain available. |
| 95 | + </figcaption> |
| 96 | +</figure> |
| 97 | + |
| 98 | +Select the **Quarantined** badge to see the rule that applied. The CLI also |
| 99 | +marks the test as quarantined and includes quarantine counts in the summary. |
| 100 | + |
| 101 | +The suite result shows the effect of the rule. The earlier run failed; the new |
| 102 | +run passes even though its one test still fails, because that test is now |
| 103 | +quarantined. |
| 104 | + |
| 105 | +<figure> |
| 106 | + <Image |
| 107 | + src={QuarantineSuiteResults} |
| 108 | + alt="Two runs of the endform e2e suite, each containing one test: the newer run at the top passed, while the earlier run below failed." |
| 109 | + width={1200} |
| 110 | + /> |
| 111 | + <figcaption> |
| 112 | + The newer suite run passes after quarantine. The earlier run keeps its |
| 113 | + failed outcome. |
| 114 | + </figcaption> |
| 115 | +</figure> |
| 116 | + |
| 117 | +## What quarantine changes |
| 118 | + |
| 119 | +Quarantine changes whether a test failure blocks the suite. It does not change |
| 120 | +how the test executes: |
| 121 | + |
| 122 | +- Configured retries still run, including immediate and isolated retries. |
| 123 | +- Quarantined test failures do not count toward `maxFailures`. |
| 124 | +- Actual test outcomes and metrics remain in Endform's history, so you can see |
| 125 | + whether the test is recovering. |
| 126 | + |
| 127 | +:::caution[Some failures still block the suite] |
| 128 | +Infrastructure errors still fail |
| 129 | +the suite. Quarantine also preserves Playwright project dependencies: if a |
| 130 | +quarantined test fails in a setup project, dependent projects cannot run, and |
| 131 | +the suite fails. |
| 132 | +::: |
| 133 | + |
| 134 | +A passing suite can therefore contain failed quarantined tests. See |
| 135 | +[Dashboard analytics](/docs/explanation/dashboard-analytics#quarantined-test-results) |
| 136 | +for how to interpret those results. |
| 137 | + |
| 138 | +Merged Playwright reports present quarantined attempts differently from |
| 139 | +Endform's stored outcomes. If you use HTML, JUnit, or custom reporters, read |
| 140 | +[Quarantined results in custom reporters](/docs/explanation/custom-reporters#quarantined-results). |
| 141 | + |
| 142 | +## Rule timing and overlapping rules |
| 143 | + |
| 144 | +Endform determines which rule applies when a suite run starts. Creating, |
| 145 | +expiring, or deactivating a rule does not change an ongoing run or rewrite |
| 146 | +historical results. |
| 147 | + |
| 148 | +When several active rules match a test, the oldest matching rule applies. After |
| 149 | +it expires or is deactivated, the next matching active rule can apply to future |
| 150 | +runs. |
| 151 | + |
| 152 | +A rule without an expiry stays active until you deactivate it. Expired and |
| 153 | +deactivated rules remain visible for reference. |
| 154 | + |
| 155 | +## Remove or change quarantine |
| 156 | + |
| 157 | +Once you have fixed the test, inspect its recent outcomes and retries in the |
| 158 | +dashboard. To restore normal failure behavior, open **Settings → Quarantine |
| 159 | +rules** and choose **Deactivate rule** from the rule's actions menu. |
| 160 | + |
| 161 | +Check for other matching active rules: deactivating one rule does not remove |
| 162 | +quarantine if another still matches. Start a new suite run to verify the test is |
| 163 | +no longer quarantined. |
| 164 | + |
| 165 | +To change a rule's conditions, reason, or expiry, deactivate it and create a |
| 166 | +replacement. Historical runs keep their association with the rule that |
| 167 | +originally applied. |
0 commit comments