Skip to content

Commit d21d2d3

Browse files
committed
Document how to quarantine e2e tests
Signed-off-by: Alice Frosi <afrosi@redhat.com> (cherry picked from commit 33ebd1f)
1 parent 234f818 commit d21d2d3

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

‎CONTRIBUTING.md‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,35 @@ make e2e RUN=Foo # Run tests matching "Foo"
148148
> every code change. Run `make buildimg` followed by `make deploy-bink` to
149149
> pick up your latest changes in the cluster.
150150
151+
### Quarantining Flaky Tests
152+
153+
A test that is intermittently failing for reasons outside the operator's
154+
control can be quarantined so it stops blocking CI while the underlying
155+
issue is investigated:
156+
157+
```go
158+
func TestFlaky(t *testing.T) {
159+
testutil.Quarantine(t, "flaky: <what fails>, <tracking issue URL>")
160+
161+
// ... rest of the test, unchanged
162+
}
163+
```
164+
165+
Call `Quarantine` first thing in the test, before any provisioning, so a
166+
skipped test costs nothing. The reason must reference an open tracking
167+
issue: that is what tells us when the quarantine can be lifted.
168+
169+
Quarantined tests are skipped via `t.Skip` unless `E2E_RUN_QUARANTINED` is
170+
set to a truthy value, so they still run on demand, for example to check
171+
whether the underlying issue has been fixed:
172+
173+
```shell
174+
E2E_RUN_QUARANTINED=1 make e2e RUN=TestMidRolloutImageChange
175+
```
176+
177+
CI leaves the variable unset. Quarantine is temporary by design: remove
178+
the call once the test is reliably green again.
179+
151180
### Internal Registry
152181

153182
The bink cluster includes an internal container registry. From the host, push

0 commit comments

Comments
 (0)