Skip to main content

テスト結果の展開と表示

概要

View your test results in one place after a Bitrise CI build. All tests will be available on the build page, even if you have multiple testing Steps in your Workflows.

CI ビルド後、テスト結果を 1 か所で確認できます。ワークフローに複数のテストステップがあっても、すべてのテストはビルドページに表示されます。私たちの目標は、Bitrise上でアクセス可能で実用的なテスト結果が得られるようにすることです。これにより、テスト失敗からの回復までの時間を短縮し、全体的な開発者体験を向上させることができます

テスト結果のデプロイ

最小限の設定でテスト結果をビルドページにデプロイします。要件はセットアップによって異なります。

  • Bitriseの公式テストステップを使ってテストを実行する

  • 他のステップを使用してテストを実行する

Bitriseの公式テストステップの結果をデプロイする

サポートされているテスト手順は次のとおりです。

これらのステップのいずれかを使用する場合は、次のものが揃っていることを確認してください Bitrise.io にデプロイしてください ワークフローにステップイン。Bitrise はテスト結果を自動的にビルドページにデプロイします

アタッチメントとフレークテスト

テストで添付ファイルが生成されたり、Bitriseに不安定なテストを表示させたい場合、 Bitrise.io にデプロイしてください ステップはバージョン 2.19.1 以降である必要があります。

他のステップの結果のデプロイ

他のステップを使用してテストを実行する場合 (たとえば、 スクリプト 完全にカスタム化されたテストソリューションの手順) については、追加の設定が必要です。

  1. テストを実行するステップをワークフローに追加します。

  2. を追加 テスト結果をテストレポートアドオンにエクスポートする ワークフローへのステップ。

  3. ステップを設定します。 テスト結果をテストレポートアドオンにエクスポートするステップを使用する

  4. お持ちであることを確認してください Bitrise.io にデプロイしてください ワークフローにステップイン。

    アタッチメントとフレークテスト

    テストで添付ファイルが生成されたり、Bitriseに不安定なテストを表示させたい場合、 Bitrise.io にデプロイしてください ステップはバージョン 2.19.1 以降である必要があります。

テスト結果の表示

リッチ HTML レポート

使用する場合 リッチ HTML テストレポート、それらはまだにあります アーティファクト タブ。

結果を表示するには、ビルドページを開いて、 テスト タブ。テストはステータスに応じてさまざまなタブに分類されます。

  • 失敗

  • 合格しました

  • スキップされました

  • エラー

  • 薄片状

デフォルトでは、Bitriseは失敗したテストのリストを表示します。これらの各カテゴリでテスト実行の詳細を表示できます

任意のテストをクリックして、テスト期間、出力、およびテストで生成された添付ファイルの詳細を確認します。

ビデオファイル

現在、テストレポートの添付ファイルは以下のファイル形式でサポートされています。

.jpg, .jpeg, .png, .txt, .log

現在、テストレポートにはビデオファイルを表示できません。動画ファイルのサポートは 2026 年第 1 四半期に開始されます

で不安定なテストを見ることができます 薄片状 タブ。不安定なテストとは、コードを変更しなくても失敗することもあれば成功することもあるテストです。テストが失敗し、その後も成功した場合 自動再試行、Bitriseはテストを不安定とマークし、以下で確認できます フレーク状 タブ。また、テストを再試行するたびの詳細と添付ファイルも表示されます

2025-09-23-test-run-example.png

Collating test attachments with test results

Many tests generate image files (screenshot tests, XCUITests, etc). Bitrise test reports automatically collates image files with associated test cases for Xcode tests (using the xcresult file).

ビデオファイル

現在、テストレポートの添付ファイルは以下のファイル形式でサポートされています。

.jpg, .jpeg, .png, .txt, .log

現在、テストレポートにはビデオファイルを表示できません。動画ファイルのサポートは 2026 年第 1 四半期に開始されます

However, if your test doesn't generate an xcresult file, you can still achieve the same thing by generating a JUnit XML file and using Bitrise Steps:

Workflow Editor

Configuration YAML

  1. Generate a JUnit.xml file from your tests.

    The general file structure should look something like this:

    <?xml version="1.0" encoding="UTF-8"?>
    <testsuites time="15.682687">
        <testsuite name="Tests.Registration" time="6.605871">
            <testcase name="testCase1" classname="Tests.Registration" time="2.113871" />
        </testsuite>
    </testsuites>
  2. Add a <properties> element to associate an attachment with a testcase.

    The name attribute of the element must be set with a value attachment_# where # is the ordered index of the attachment file, and the value is the filename. Bitrise will show attachments for any test with the attachment properties, but it's most common to only attach screenshots to failed tests. Mark a test as failed with a <failure> element.

    <testcase name="testCase1" classname="Tests.Registration" time="2.113871" />
      <failure message="Assertion error message" type="AssertionError">
        Call stack printed here
      </failure>
      <properties>
        <property name="attachment_1" value="pp1.jpg" />
        <property name="attachment_2" value="pp2.jpg" />
      </properties>            
    </testcase>
  3. を追加 テスト結果をテストレポートにエクスポート Bitriseのワークフローにステップアップしてください。バージョン 1.1.0 以上でなければなりません

  4. Set a test name in the The name of the test input.

  5. Set the path to your JUnit XML file in the Test result search pattern input.

  6. Add the Deploy to Bitrise.io Step to the end of your Workflow.

    You don't have to change the default input values.

  1. Generate a JUnit.xml file from your tests.

    The general file structure should look something like this:

    <?xml version="1.0" encoding="UTF-8"?>
    <testsuites time="15.682687">
        <testsuite name="Tests.Registration" time="6.605871">
            <testcase name="testCase1" classname="Tests.Registration" time="2.113871" />
        </testsuite>
    </testsuites>
  2. Add a <properties> element to associate an attachment with a testcase.

    The name attribute of the element must be set with a value attachment_# where # is the ordered index of the attachment file, and the value is the filename. Bitrise will show attachments for any test with the attachment properties, but it's most common to only attach screenshots to failed tests. Mark a test as failed with a <failure> element.

    <testcase name="testCase1" classname="Tests.Registration" time="2.113871" />
      <failure message="Assertion error message" type="AssertionError">
        Call stack printed here
      </failure>
      <properties>
        <property name="attachment_1" value="pp1.jpg" />
        <property name="attachment_2" value="pp2.jpg" />
      </properties>            
    </testcase>
  3. を追加 custom-test-results-export Bitrise ワークフローにステップアップしてください。バージョン 1.1.0 以降である必要があります

    workflows:
      inline_attachment:
        steps:
        - generate-text-file:
            inputs:
            - file_name: junit.xml
            - file_content: "xml content with references to image files here"
        - custom-test-results-export:
  4. にテスト名を設定します test_name 入力。

    - custom-test-results-export@1:
        inputs:
        - test_name: example_tests
  5. JUnit XML ファイルへのパスを以下に設定します。 search_pattern 入力。

    - custom-test-results-export@1:
        inputs:
        - test_name: example_tests
        - search_pattern: junit.xml
  6. を追加 deploy-to-bitrise-io ワークフローの最後まで進んでください。

    デフォルトの入力値を変更する必要はありません。設定 YAML ファイル内のワークフロー全体は次のようになります

    workflows:
      inline_attachment:
        steps:
        - generate-text-file@0:
            inputs:
            - file_name: junit.xml
            - file_content: "xml content with references to image files here"
        - custom-test-results-export@1:
            inputs:
            - test_name: example_tests
            - base_path: "."
            - search_pattern: junit.xml
        - script@1:
            inputs:
            - content: |
                #!/usr/bin/env bash
                set -ex
                set -o pipefail
    
                TEST_RESULTS_DIR=$(find "$BITRISE_TEST_DEPLOY_DIR" -type d -name "example_tests" -print -quit)
                cp ~/*.jpg $TEST_RESULTS_DIR
            title: Copy image files to test directory
        - deploy-to-bitrise-io@2: {}

テスト結果をテストレポートアドオンにエクスポートするステップを使用する

結果を自動的にエクスポートしないステップを使用している場合でも、テスト結果をテストレポートアドオンステップにエクスポートして、テスト結果がテストレポートアドオンに表示されるようにすることができます。

正しい構成で、ステップはアプリのリポジトリでテスト結果を見つけ、それらをエクスポートディレクトリに配置します。

スクリーンショットとその他の画像

ステップは、どちらかでテスト結果のみをエクスポートできます .xcresult また JUnit XML フォーマット。テスト結果が .xcresult ファイル、テストの一部として生成されたスクリーンショットが含まれ、テストレポートアドオンにエクスポートされます。

JUnit XML形式を使用する場合は、スクリーンショットとその他の画像を別々にエクスポートする必要があります。 スクリーンショットやその他の画像をテストレポートにエクスポートするスクリーンショットやその他の画像をテストレポートにエクスポートする

  1. でアプリを開きます ビットライズ

  2. クリック ワークフロー メインページのボタン。

  3. 追加します テスト結果をテストレポートアドオンにエクスポートする テストステップの後のステップ。

  4. の中に テストの名前 入力、テストの名前を設定します。テスト結果は、テストレポートアドオンでこの名前になります。

  5. の中に カスタムテスト結果が存在するパス 入力、テスト結果を見つけることができるパスを設定します。

    Managing an app's bitrise.yml configuration

    ここでフォルダを設定することをお勧めしますが、特定のファイルパスを設定することもできます。デフォルト値は、アプリのソースディレクトリです。パターンの例:

    • アプリのルートディレクトリがappの場合: app/build/test-results/testDemoDebugUnitTest/

    • テスト結果がアプリフォルダー内にあるが、アプリがルートディレクトリではない場合:./ app / build / test-results / testDemoDebugUnitTest /

  6. の中に テスト結果の検索パターン 入力し、テスト結果ファイルに一致するパターンを設定します。

    この検索パターンは、で設定されたパスのすべてのファイルとフォルダを検索するために使用されます カスタムテスト結果が存在するパス 入力。

    一致するものが複数ある場合、ステップは最初の一致をエクスポートし、警告をログに記録します。前の入力で特定のファイルパスを設定した場合は、ここで*を設定するだけです。

    パターンの例:

    • ベースパス内のすべてのファイルの照合: *

    • ベースパスの特定のディレクトリ内のすべてのファイルを照合します。 */build/test-results/testDemoDebugUnitTest/*

  7. の中に ステップのテスト結果ディレクトリ 入力し、パスが正しいことを確認してください。

    この入力の値は変更しないでください。これは、 Bitrise.ioにデプロイします ステップは、それらをエクスポートするためのテスト結果を探します。に設定する必要があります $BITRISE_TEST_RESULT_DIR 環境変数

  8. あなたが持っていることを確認してください Bitrise.ioにデプロイします ワークフローにステップインします。

    If your tests generate attachments, make sure the Step is of version 2.19.x or newer.