Skip to content

Commit

Permalink
tests: fix smoke shard total in CI (#13844)
Browse files Browse the repository at this point in the history
  • Loading branch information
brendankenny committed Apr 14, 2022
1 parent 79168d2 commit 1c2311c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/devtools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}/3

steps:
- name: git clone
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 1c2311c

Please sign in to comment.