diff --git a/.github/actions/on_host_tests/action.yaml b/.github/actions/on_host_tests/action.yaml index a8c33f90a6ce..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}" --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}" } @@ -71,5 +74,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 diff --git a/.github/config/linux.json b/.github/config/linux.json index dfacac9eadd2..9ce9403c1af8 100644 --- a/.github/config/linux.json +++ b/.github/config/linux.json @@ -5,7 +5,7 @@ "linux-x64x11" ], "targets": [ - "base_unittests", + "base_unittests", "cobalt:gn_all", "content_shell", "gin_unittests", diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index bfd96b5d001c..6316194b17d4 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,5,6,7,8,9] container: ${{ needs.docker-build-image.outputs.docker_tag }} env: TMPDIR: /__w/_temp @@ -205,6 +206,26 @@ 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] + 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() &&