Test Quarantining
Once you've detected flaky tests, the next step is to fix them. However, you may have other priorities - here lies a dilemma. Flaky tests impact developer time, but there are other deliverables as well.
BuildPulse enables you to temporarily disable tests that flake beyond a configured threshold, to mitigate the impact of flaky tests. You can actually save the time consumed on our dashboard - this is done by:
- Configuring your Flakiness Threshold
- Querying the Quarantine API for flaky tests
- Disabling Tests
- Tracking & Re-enabling tests
Configuring your Flakiness Threshold
To configure your flaky test threshold:
- Navigate to the BuildPulse Flaky Test Dashboard.
- Click on top-right dropdown, and navigate to "Settings" > "Repository Settings" > Flaky Tests.
- Set the disruption percentage which will determine quarantine status for a flaky test.
Querying the Quarantine API
- Email support@buildpulse.io for your API key.
- Query the API for flaky tests:
URL: https://api.buildpulse.io/v1/flaky/tests
Authorization: Authorization: Bearer ${BUILDPULSE_API_KEY}
Query Parameters:
repository
(required): The name of your repository/projectquarantine
: Set totrue
to only return quarantined tests
- Sample Response:
{
"count": 1,
"tests": [
{
"id": 434140152,
"name": "System Posts Lifecycle Basic posts flow can edit a post",
"suite": "rspec",
"class": "spec.system.posts_lifecycle_spec",
"file": "./spec/system/posts_lifecycle_spec.rb"
}
],
"metadata": {
"after": null,
"limit": 25
}
}
Disabling Tests
Please consult the documentation of your test framework for disabling individual tests.
Tracking & Re-enabling tests
BuildPulse will preserve quarantined tests beyond the data retention period, and are tagged as 'quarantined' in the BuildPulse Flaky Test Dashboard.
When the tests is resolved, you can re-enable tests by removing the quarantine tag from the test name in the dashboard. This will remove the test from the quarantined list, and will no longer be ignored by your test framework.