Quarantining failing tests
There may be times when you want to prevent a failing test from causing the whole build to fail.
Possible scenarios where this may be useful include:
- You want to build an artifact despite there being a failing test, but can't do this while the plan build is failing.
- In test-driven development (TDD), a test will fail until the functionality is implemented - you want to quarantine all but the relevant tests.
- A test may give unpredictable results, perhaps because of infrastructure issues or dependencies.
- You want to remove a test from a build, but don't want to alter or delete the test source code because doing so could affect another Bamboo plan.
In Bamboo, you can temporarily disconnect any test's results from the plan build results by quarantining the test. The test is still run whenever the plan is built, but the test's results do not affect the plan's build results.
You can always restore a test's results to the build results when required, for example if the test is now passing.
All the quarantined tests for a plan are displayed on the Quarantined tests tab of the plan summary. The status bar for each test shows the recent build history of the test.
Enable test quarantining
To enable test quarantining:
- In the upper-right corner of the screen, selectAdministration> Overview.
- Under Plans, select Quarantine settings.
- On the Quarantine settings page, select Enable quarantine.
- Select Save.
Quarantine a failing test
- You need plan administrator or build permission to quarantine a test.
- Test quarantining must be enabled
To quarantine a test:
- Select Builds > All build plans > #buildresult to go to the build result where the test is failing.
- Select Quarantine for the failing test (in the Summary section of the build).
Restore a quarantined test to a build
- You need plan administrator permission to restore a test.
- Test quarantining must be enabled.
To restore a quarantined test to a build:
- Go to your plan's summary.
- Select the Quarantined tests tab.
- Select Unleash for the test to be restored.