From 7bccc71e4bc6fb7023dbf884733bbf75b8dd5b27 Mon Sep 17 00:00:00 2001 From: Ian Mindich Date: Mon, 6 Jan 2025 18:34:56 -0800 Subject: [PATCH 1/8] Split up test running and test reporting into separate jobs. --- .github/config/linux.json | 11 +--------- .github/workflows/main.yaml | 41 +++++++++++++++++++++++++++---------- 2 files changed, 31 insertions(+), 21 deletions(-) diff --git a/.github/config/linux.json b/.github/config/linux.json index dfacac9eadd2..ecc0504d09a5 100644 --- a/.github/config/linux.json +++ b/.github/config/linux.json @@ -5,16 +5,7 @@ "linux-x64x11" ], "targets": [ - "base_unittests", - "cobalt:gn_all", - "content_shell", - "gin_unittests", - "gpu_unittests", - "ipc_tests", - "media_unittests", - "mojo_unittests", - "sql_unittests", - "url_unittests" + "gin_unittests" ], "includes": [ { diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index bfd96b5d001c..beaeb1e7cd9c 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -205,15 +205,34 @@ jobs: with: test_artifacts_key: ${{ env.TEST_ARTIFACTS_KEY }} test_results_key: ${{ env.TEST_RESULTS_KEY }} + + test-upload: + needs: [initialize, docker-build-image, build, test] + if: needs.initialize.outputs.test_on_host == 'true' || needs.initialize.outputs.test_on_device == 'true' + permissions: {} + runs-on: [self-hosted, chrobalt-linux-runner] + name: ${{ matrix.name }}_tests_upload + strategy: + fail-fast: false + matrix: + platform: ${{ fromJson(needs.initialize.outputs.platforms) }} + include: ${{ fromJson(needs.initialize.outputs.includes) }} + config: [devel] + container: ${{ needs.docker-build-image.outputs.docker_tag }} + env: + TMPDIR: /__w/_temp + TEST_ARTIFACTS_KEY: ${{ matrix.platform }}_${{ matrix.name }}_test_artifacts + TEST_RESULTS_KEY: ${{ matrix.platform }}_${{ matrix.name }}_test_results + steps: - name: Process Test Results - if: | - always() && - ( - steps.on-host-tests.outcome == 'success' || - steps.on-host-tests.outcome == 'failure' - ) - uses: ./src/.github/actions/process_test_results - with: - test_results_key: ${{ env.TEST_RESULTS_KEY }} - datadog_api_key: ${{ secrets.datadog_api_key }} - continue-on-error: true + if: | + always() && + ( + steps.on-host-tests.outcome == 'success' || + steps.on-host-tests.outcome == 'failure' + ) + uses: ./src/.github/actions/process_test_results + with: + test_results_key: ${{ env.TEST_RESULTS_KEY }} + datadog_api_key: ${{ secrets.datadog_api_key }} + continue-on-error: true From ae7ab47f33f86f39d9b4b7e1a42fcae532f7b01a Mon Sep 17 00:00:00 2001 From: Ian Mindich Date: Mon, 6 Jan 2025 18:44:56 -0800 Subject: [PATCH 2/8] indenting --- .github/workflows/main.yaml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index beaeb1e7cd9c..552bbdefeb53 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -225,14 +225,14 @@ jobs: TEST_RESULTS_KEY: ${{ matrix.platform }}_${{ matrix.name }}_test_results steps: - name: Process Test Results - if: | - always() && - ( - steps.on-host-tests.outcome == 'success' || - steps.on-host-tests.outcome == 'failure' - ) - uses: ./src/.github/actions/process_test_results - with: - test_results_key: ${{ env.TEST_RESULTS_KEY }} - datadog_api_key: ${{ secrets.datadog_api_key }} - continue-on-error: true + if: | + always() && + ( + steps.on-host-tests.outcome == 'success' || + steps.on-host-tests.outcome == 'failure' + ) + uses: ./src/.github/actions/process_test_results + with: + test_results_key: ${{ env.TEST_RESULTS_KEY }} + datadog_api_key: ${{ secrets.datadog_api_key }} + continue-on-error: true From 39a355a7b4e94f636e56f8f8d3cfbf867a7b461a Mon Sep 17 00:00:00 2001 From: Ian Mindich Date: Mon, 6 Jan 2025 19:05:06 -0800 Subject: [PATCH 3/8] Split up test binaries across 5 shards --- .github/actions/on_host_tests/action.yaml | 2 +- .github/workflows/main.yaml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/actions/on_host_tests/action.yaml b/.github/actions/on_host_tests/action.yaml index a8c33f90a6ce..607647ebbb4c 100644 --- a/.github/actions/on_host_tests/action.yaml +++ b/.github/actions/on_host_tests/action.yaml @@ -57,7 +57,7 @@ runs: echo "Test filter evaluated to: ${test_filter}" xml_path="${results_dir}/${test_binary}_testoutput.xml" - /usr/bin/xvfb-run -a --server-args="${XVFB_SERVER_ARGS}" "./${test_binary}" --gtest_filter="${test_filter}" --gtest_output="xml:${xml_path}" || { + /usr/bin/xvfb-run -a --server-args="${XVFB_SERVER_ARGS}" "./${test_binary}" --test-launcher-shard-index=${{ matrix.shard }} --test-launcher-total-shards=5 --gtest_filter="${test_filter}" --gtest_output="xml:${xml_path}" || { # Set exit code on failure. failed_suites="${failed_suites} ${test_binary}" } diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 552bbdefeb53..745aa4f094fe 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -188,6 +188,7 @@ jobs: platform: ${{ fromJson(needs.initialize.outputs.platforms) }} include: ${{ fromJson(needs.initialize.outputs.includes) }} config: [devel] + shard: [0,1,2,3,4] container: ${{ needs.docker-build-image.outputs.docker_tag }} env: TMPDIR: /__w/_temp From 65351e83ea035c61bfde46a686f5198b4fc97e7f Mon Sep 17 00:00:00 2001 From: Ian Mindich Date: Mon, 6 Jan 2025 19:10:48 -0800 Subject: [PATCH 4/8] Add base_unittests --- .github/config/linux.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/config/linux.json b/.github/config/linux.json index ecc0504d09a5..734b5a362796 100644 --- a/.github/config/linux.json +++ b/.github/config/linux.json @@ -5,7 +5,8 @@ "linux-x64x11" ], "targets": [ - "gin_unittests" + "gin_unittests", + "base_unittests" ], "includes": [ { From 32cc2fe0ec9de25d15dbce153c3e0dbe1fe9d82a Mon Sep 17 00:00:00 2001 From: Ian Mindich Date: Mon, 6 Jan 2025 20:57:25 -0800 Subject: [PATCH 5/8] Make artifact names unique based on shard --- .github/actions/on_host_tests/action.yaml | 2 +- .github/actions/process_test_results/action.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/on_host_tests/action.yaml b/.github/actions/on_host_tests/action.yaml index 607647ebbb4c..c052fee96829 100644 --- a/.github/actions/on_host_tests/action.yaml +++ b/.github/actions/on_host_tests/action.yaml @@ -71,5 +71,5 @@ runs: if: success() || failure() uses: actions/upload-artifact@v4 with: - name: ${{ inputs.test_results_key }} + name: ${{ inputs.test_results_key }}-${{ matrix.shard }} path: ${{ env.results_dir }}/*.xml diff --git a/.github/actions/process_test_results/action.yaml b/.github/actions/process_test_results/action.yaml index bce228e5ad79..64b743c63527 100644 --- a/.github/actions/process_test_results/action.yaml +++ b/.github/actions/process_test_results/action.yaml @@ -13,7 +13,7 @@ runs: - name: Download Test Results uses: actions/download-artifact@v4 with: - name: ${{ inputs.test_results_key }} + name: ${{ inputs.test_results_key }}-* path: results/ - name: Test Summary action From a6d5ee302b6ccc0f2442623b2af2d124403b5c84 Mon Sep 17 00:00:00 2001 From: Ian Mindich Date: Mon, 6 Jan 2025 21:30:42 -0800 Subject: [PATCH 6/8] Try 6 shards, 5 shards taking ~57 seconds to run tests --- .github/actions/on_host_tests/action.yaml | 2 +- .github/workflows/main.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/on_host_tests/action.yaml b/.github/actions/on_host_tests/action.yaml index c052fee96829..437c96fe841e 100644 --- a/.github/actions/on_host_tests/action.yaml +++ b/.github/actions/on_host_tests/action.yaml @@ -57,7 +57,7 @@ runs: echo "Test filter evaluated to: ${test_filter}" xml_path="${results_dir}/${test_binary}_testoutput.xml" - /usr/bin/xvfb-run -a --server-args="${XVFB_SERVER_ARGS}" "./${test_binary}" --test-launcher-shard-index=${{ matrix.shard }} --test-launcher-total-shards=5 --gtest_filter="${test_filter}" --gtest_output="xml:${xml_path}" || { + /usr/bin/xvfb-run -a --server-args="${XVFB_SERVER_ARGS}" "./${test_binary}" --test-launcher-shard-index=${{ matrix.shard }} --test-launcher-total-shards=6 --gtest_filter="${test_filter}" --gtest_output="xml:${xml_path}" || { # Set exit code on failure. failed_suites="${failed_suites} ${test_binary}" } diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 745aa4f094fe..4980e5a20ff8 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -188,7 +188,7 @@ jobs: platform: ${{ fromJson(needs.initialize.outputs.platforms) }} include: ${{ fromJson(needs.initialize.outputs.includes) }} config: [devel] - shard: [0,1,2,3,4] + shard: [0,1,2,3,4,5] container: ${{ needs.docker-build-image.outputs.docker_tag }} env: TMPDIR: /__w/_temp From 76766f456bd55e49e7e829b634ec82dbc239d6bb Mon Sep 17 00:00:00 2001 From: Ian Mindich Date: Tue, 7 Jan 2025 11:56:06 -0800 Subject: [PATCH 7/8] Increase shard count to 10. --- .github/actions/on_host_tests/action.yaml | 5 ++++- .github/workflows/main.yaml | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/actions/on_host_tests/action.yaml b/.github/actions/on_host_tests/action.yaml index 437c96fe841e..67cff0c03207 100644 --- a/.github/actions/on_host_tests/action.yaml +++ b/.github/actions/on_host_tests/action.yaml @@ -7,6 +7,9 @@ inputs: test_results_key: description: "Artifact key used to store test results." required: true + num_shards: + description: "Total number of shards used to run these steps." + required: true runs: using: "composite" steps: @@ -57,7 +60,7 @@ runs: echo "Test filter evaluated to: ${test_filter}" xml_path="${results_dir}/${test_binary}_testoutput.xml" - /usr/bin/xvfb-run -a --server-args="${XVFB_SERVER_ARGS}" "./${test_binary}" --test-launcher-shard-index=${{ matrix.shard }} --test-launcher-total-shards=6 --gtest_filter="${test_filter}" --gtest_output="xml:${xml_path}" || { + /usr/bin/xvfb-run -a --server-args="${XVFB_SERVER_ARGS}" "./${test_binary}" --test-launcher-shard-index=${{ matrix.shard }} --test-launcher-total-shards=${{ inputs.num_shards }} --gtest_filter="${test_filter}" --gtest_output="xml:${xml_path}" || { # Set exit code on failure. failed_suites="${failed_suites} ${test_binary}" } diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 4980e5a20ff8..6316194b17d4 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -188,7 +188,7 @@ jobs: platform: ${{ fromJson(needs.initialize.outputs.platforms) }} include: ${{ fromJson(needs.initialize.outputs.includes) }} config: [devel] - shard: [0,1,2,3,4,5] + shard: [0,1,2,3,4,5,6,7,8,9] container: ${{ needs.docker-build-image.outputs.docker_tag }} env: TMPDIR: /__w/_temp @@ -206,6 +206,7 @@ jobs: with: test_artifacts_key: ${{ env.TEST_ARTIFACTS_KEY }} test_results_key: ${{ env.TEST_RESULTS_KEY }} + num_shards: 10 test-upload: needs: [initialize, docker-build-image, build, test] From 26c7de850a5784da660e965fa89a616b5f97df5c Mon Sep 17 00:00:00 2001 From: Ian Mindich Date: Tue, 7 Jan 2025 13:06:07 -0800 Subject: [PATCH 8/8] Add back all test targets --- .github/config/linux.json | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/config/linux.json b/.github/config/linux.json index 734b5a362796..9ce9403c1af8 100644 --- a/.github/config/linux.json +++ b/.github/config/linux.json @@ -5,8 +5,16 @@ "linux-x64x11" ], "targets": [ + "base_unittests", + "cobalt:gn_all", + "content_shell", "gin_unittests", - "base_unittests" + "gpu_unittests", + "ipc_tests", + "media_unittests", + "mojo_unittests", + "sql_unittests", + "url_unittests" ], "includes": [ {