失敗したテストによってビルド全体が失敗しないようにしたい場合があります。

これが有効な場合のシナリオには以下が含まれます:

  • 失敗したテストがあるにも関わらず成果物を作成したい場合。これはプラン ビルドの失敗時には実施できません。
  • 関連するテスト以外を隔離したい場合(テスト駆動開発(TDD)では、テストは機能が実装されるまで失敗します)。
  • おそらく、インフラストラクチャの問題または依存関係によって、テストが予測できない結果をもたらす可能性がある場合。
  • ビルドからテストを削除したいが、別の Bamboo プランに影響を与える可能性があるため、テスト ソース コードを変更または削除したくない場合。

Bamboo では、テストを隔離することで、プラン ビルド結果から任意のテストの結果を一時的に切り離すことができます。テストはプランがビルドされるたびに実行されますが、テストの結果はプランのビルド結果に影響を与えません。

テストが成功している場合など、必要に応じて、いつでもテストの結果をビルド結果に復元することができます。

プランの隔離されたテストはすべて、プラン サマリの隔離されたテストに表示されます。各テストのステータス バーはテストの最近のビルド履歴を示します。

失敗したテストを隔離する方法

テストを隔離するには、プラン管理者権限が必要です。

  1. ダッシュボード > すべてのプラン > #buildresult を選択し、テストが失敗しているビルド結果に移動します。
  2. 失敗したテストについて、ビルド結果サマリ画面で隔離をクリックします。

隔離したテストをビルドに復元する方法

テストを復元するには、プラン管理者権限が必要です。

  1. ダッシュボードを選択し、プランをクリックしてプランのサマリに移動します。
  2. 隔離されたテスト タブをクリックします。
  3. リストアするテストについて、開放をクリックします。

スクリーンショット: プランの隔離されたテストとステータス バー


  • ラベルなし

7 Comments

  1. Anonymous

    If you have one or more quarantined tests, the outcome of the task will be changed to success if there are no unquarantined tests failing.  This can be a problem because if there is a compilation failure, the task will still be reported as a success!  This is currently a bug in Bamboo.  

    Fortunately, there is a work around to this issue.  Instead of using a single task to perform your build and parse the test results, use the JUnit parser task to parse the test results.  This will ensure that compilation failures will still fail your build.

  2. Simon Brunning

    I'm not seeing the "Unleash" button on the Quarantined Tests page. Anyone have any idea why that might be?

    1. Sultan Maiyaki

      If you just have the plan admin privileges, the button will be missing as a result of this bug BAM-12319 - Getting issue details... STATUS . It is now available only to users with gloabl admin permissions. Watch the bug report for its fix

       

  3. Eric White

    Bamboo might not fail the build, but maven still does.  Can this feature integrate with maven?  If not, then it has limited usefulness.

  4. Donal Ward

    Can quarantine be configured in such a way that if a test case is put in quarantine, it will not be executed by any other bamboo plan? Is a way to send a test case to the quarantine even if did cause a build failure

  5. JIRA Autobot

    I think that permissions should be changed so it does not require an admin to quarantine tests. 

    1. Anonymous

      I strongly agree:  developers should be able to quarantine a test.  On my project we never use this feature, even though it's intended to solve a problem we have all the time.  That's because developers are responsible for analyzing and fixing broken tests, and we have access to comment out a failed test but not to quarantine it.

      I wonder if Atlassian has really thought this through:  "In test-driven development (TDD), a test will fail until the functionality is implemented - you want to quarantine all but the relevant tests" and yet "You need plan administrator permission to quarantine a test."  Is it assumed that someone doing test-driven development generally has administrator permission?