From 0a2ecca9ba1b7c2d9924c8ef546f129e1ce19fc2 Mon Sep 17 00:00:00 2001 From: Brendan Kenny Date: Mon, 11 Apr 2022 17:32:17 -0500 Subject: [PATCH 1/3] tests: fix smoke shard total in CI --- .github/workflows/devtools.yml | 2 +- .github/workflows/smoke.yml | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/devtools.yml b/.github/workflows/devtools.yml index c8b98110d983..f070b9c48c69 100644 --- a/.github/workflows/devtools.yml +++ b/.github/workflows/devtools.yml @@ -125,7 +125,7 @@ jobs: # e.g. if set 1 fails, continue with set 2 anyway fail-fast: false runs-on: macos-latest - name: DevTools smoke ${{ matrix.smoke-test-shard }} + name: DevTools smoke ${{ matrix.smoke-test-shard }}/${{ strategy.job-total }} steps: - name: git clone diff --git a/.github/workflows/smoke.yml b/.github/workflows/smoke.yml index 0611078aadfb..4ba52cacf924 100644 --- a/.github/workflows/smoke.yml +++ b/.github/workflows/smoke.yml @@ -17,8 +17,12 @@ jobs: # e.g. if set 1 fails, continue with set 2 anyway fail-fast: false runs-on: ubuntu-latest - # Job named e.g. "Chrome stable, batch 1". - name: Chrome ${{ matrix.chrome-channel }}, batch ${{ matrix.smoke-test-shard }} + env: + # The total number of shards. Set dynamically when length of *single* matrix variable is + # computable. See https://github.community/t/get-length-of-strategy-matrix-or-get-all-matrix-options/18342 + SHARD_TOTAL: 3 + # Job named e.g. "Chrome stable 1/3". + name: Chrome ${{ matrix.chrome-channel }} ${{ matrix.smoke-test-shard }}/$SHARD_TOTAL steps: - name: git clone @@ -49,7 +53,7 @@ jobs: - run: sudo apt-get install xvfb - name: Run smoke tests run: | - xvfb-run --auto-servernum yarn c8 yarn smoke --debug -j=1 --retries=2 --shard=${{ matrix.smoke-test-shard }}/${{ strategy.job-total }} + xvfb-run --auto-servernum yarn c8 yarn smoke --debug -j=1 --retries=2 --shard=${{ matrix.smoke-test-shard }}/$SHARD_TOTAL yarn c8 report --reporter text-lcov > smoke-coverage.lcov - name: Upload test coverage to Codecov From f843033764b3f225fce21e5ed7e513b64ef803ca Mon Sep 17 00:00:00 2001 From: Brendan Kenny Date: Mon, 11 Apr 2022 18:14:15 -0500 Subject: [PATCH 2/3] fix name --- .github/workflows/smoke.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/smoke.yml b/.github/workflows/smoke.yml index 4ba52cacf924..bab0939d290c 100644 --- a/.github/workflows/smoke.yml +++ b/.github/workflows/smoke.yml @@ -22,7 +22,7 @@ jobs: # computable. See https://github.community/t/get-length-of-strategy-matrix-or-get-all-matrix-options/18342 SHARD_TOTAL: 3 # Job named e.g. "Chrome stable 1/3". - name: Chrome ${{ matrix.chrome-channel }} ${{ matrix.smoke-test-shard }}/$SHARD_TOTAL + name: Chrome ${{ matrix.chrome-channel }} ${{ matrix.smoke-test-shard }}/${{env.SHARD_TOTAL}} steps: - name: git clone From 1f6a57385d0fe07b4cd6eeddfa645e8ba95c7560 Mon Sep 17 00:00:00 2001 From: Brendan Kenny Date: Mon, 11 Apr 2022 18:19:05 -0500 Subject: [PATCH 3/3] no env in jobs.name. oh well --- .github/workflows/smoke.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/smoke.yml b/.github/workflows/smoke.yml index bab0939d290c..b15625b77b85 100644 --- a/.github/workflows/smoke.yml +++ b/.github/workflows/smoke.yml @@ -22,7 +22,7 @@ jobs: # computable. See https://github.community/t/get-length-of-strategy-matrix-or-get-all-matrix-options/18342 SHARD_TOTAL: 3 # Job named e.g. "Chrome stable 1/3". - name: Chrome ${{ matrix.chrome-channel }} ${{ matrix.smoke-test-shard }}/${{env.SHARD_TOTAL}} + name: Chrome ${{ matrix.chrome-channel }} ${{ matrix.smoke-test-shard }}/3 steps: - name: git clone