Skip to content

Commit 853bdce

Browse files
authored
perf: disable shards processing in CI (#494)
There is too much overhead from npm install, it cancels all benefits from sharding
1 parent dfa3080 commit 853bdce

File tree

2 files changed

+17
-47
lines changed

2 files changed

+17
-47
lines changed

.github/workflows/end-to-end-tests.yml

Lines changed: 14 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -74,76 +74,46 @@ jobs:
7474
name: Studio Web test-suites
7575
timeout-minutes: 60
7676
runs-on: ubuntu-latest
77-
strategy:
78-
fail-fast: false
79-
matrix:
80-
shardIndex: [1, 2, 3]
81-
shardTotal: [3]
8277
steps:
8378
- uses: actions/checkout@v6
8479
with:
8580
persist-credentials: false
81+
8682
- uses: actions/setup-node@v6
8783
with:
8884
node-version: lts/*
89-
- name: Install and run the back-end API, needed for end-to-end testing
85+
86+
- name: Install and run the back-end API
9087
run: |
9188
git clone https://github.com/ReadAlongs/Studio
9289
cd Studio
9390
pip install -e .[api]
9491
./run-web-api.sh &
95-
# wait for the API to be up
96-
curl --retry 20 --retry-delay 1 --retry-all-errors http://localhost:8000/api/v1/langs
92+
9793
- name: Install everything
9894
run: npm ci
95+
9996
- name: Run studio-web in the background
10097
run: |
10198
npx nx build web-component
10299
npx nx run-many --targets=serve,serve-fr,serve-es --projects=web-component,studio-web --parallel 6 &
103100
101+
- name: Wait for the servers to be up
102+
run: |
104103
# wait for the studio web to be up
105104
sleep 50
106105
curl --retry 20 --retry-delay 10 --retry-all-errors http://localhost:4200 > /dev/null
106+
# Make sure the back-end API is up too
107+
curl --retry 20 --retry-delay 1 --retry-all-errors http://localhost:8000/api/v1/langs
108+
107109
- name: Run Playwright tests for studio-web
108110
run: |
109111
npx playwright install --with-deps chromium
110-
npx nx e2e studio-web --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
111-
- name: Upload blob report to GitHub Actions Artifacts
112-
if: ${{ !cancelled() }}
113-
uses: actions/upload-artifact@v6
114-
with:
115-
name: blob-report-${{ matrix.shardIndex }}
116-
path: packages/studio-web/blob-report
117-
retention-days: 1
118-
119-
merge-reports:
120-
# Merge reports after playwright-tests, even if some shards have failed
121-
if: ${{ !cancelled() }}
122-
needs: [studio-e2e-tests]
123-
name: "Merge playwright reports from studio-web end-to-end tests"
124-
runs-on: ubuntu-latest
125-
steps:
126-
- uses: actions/checkout@v6
127-
with:
128-
persist-credentials: false
129-
- uses: actions/setup-node@v6
130-
with:
131-
node-version: lts/*
132-
- name: Install everything
133-
run: npm ci
134-
- name: Download blob reports from GitHub Actions Artifacts
135-
uses: actions/download-artifact@v7
136-
with:
137-
path: all-blob-reports
138-
pattern: blob-report-*
139-
merge-multiple: true
140-
141-
- name: Merge into a single HTML Report
142-
run: npx playwright merge-reports --reporter=html,github ./all-blob-reports
112+
npx nx e2e studio-web
143113
144-
- name: Upload single HTML report
114+
- name: Upload HTML report
145115
uses: actions/upload-artifact@v6
146116
with:
147-
name: html-report--attempt-${{ github.run_attempt }}
148-
path: playwright-report
117+
name: playwright-report--attempt-${{ github.run_attempt }}
118+
path: packages/studio-web/playwright-report
149119
retention-days: 5

packages/studio-web/playwright.config.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ export default defineConfig({
1818
fullyParallel: true,
1919
/* Fail the build on CI if you accidentally left test.only in the source code. */
2020
forbidOnly: !!process.env.CI,
21-
/* Retry on CI only */
21+
/* Retry only twice in CI */
2222
retries: process.env.CI ? 2 : 3,
23-
/* Opt out of parallel tests on CI. */
23+
/* Use 4 parallel workers in CI, the default otherwise (#CPUs I think). */
2424
workers: process.env.CI ? 4 : undefined,
2525
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
26-
reporter: process.env.CI ? [["blob", { open: "never" }]] : "html",
26+
reporter: process.env.CI ? [["html", { open: "never" }]] : "html",
2727
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
2828
use: {
2929
/* Base URL to use in actions like `await page.goto('/')`. */

0 commit comments

Comments
 (0)