From bfc2462103e64a86cc450a52a1eabf29bcc35858 Mon Sep 17 00:00:00 2001 From: NathanPanchout Date: Wed, 16 Oct 2024 10:04:28 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7(ci)=20add=20sharding=20e2e=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit e2e tests take too long to run. We can easily reduce this time by 2 by adding shards --- .github/workflows/people.yml | 31 ++++++++++++++++++++++++------- CHANGELOG.md | 1 + 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/.github/workflows/people.yml b/.github/workflows/people.yml index 9ed1b01..c66344d 100644 --- a/.github/workflows/people.yml +++ b/.github/workflows/people.yml @@ -16,7 +16,7 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 with: - fetch-depth: 0 + fetch-depth: 0 - name: show run: git log - name: Enforce absence of print statements in code @@ -39,7 +39,7 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 with: - fetch-depth: 0 + fetch-depth: 0 - name: Check that the CHANGELOG has been modified in the current branch run: git whatchanged --name-only --pretty="" origin/${{ github.event.pull_request.base.ref }}..HEAD | grep CHANGELOG @@ -139,7 +139,7 @@ jobs: with: path: 'src/frontend/**/node_modules' key: front-node_modules-${{ hashFiles('src/frontend/**/yarn.lock') }} - + - name: Check linting run: cd src/frontend/ && yarn lint @@ -147,6 +147,11 @@ jobs: runs-on: ubuntu-latest needs: [build-mails, build-front] timeout-minutes: 10 + strategy: + fail-fast: false + matrix: + shardIndex: [1, 2, 3, 4] + shardTotal: [4] steps: - name: Checkout repository uses: actions/checkout@v4 @@ -196,15 +201,27 @@ jobs: run: cd src/frontend/apps/e2e && yarn install - name: Run e2e tests - run: cd src/frontend/ && yarn e2e:test + run: cd src/frontend/ && yarn e2e:test --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} - uses: actions/upload-artifact@v4 if: always() with: - name: playwright-report + name: playwright-report-${{ matrix.shardIndex }} path: src/frontend/apps/e2e/report/ retention-days: 7 + tests-e2e-feedback: + runs-on: ubuntu-latest + needs: [test-e2e] + if: always() + steps: + - name: All tests ok + if: ${{ !(contains(needs.*.result, 'failure')) }} + run: exit 0 + - name: Some tests failed + if: ${{ contains(needs.*.result, 'failure') }} + run: exit 1 + build-mails: runs-on: ubuntu-latest defaults: @@ -226,8 +243,8 @@ jobs: - name: Persist mails' templates uses: actions/upload-artifact@v4 with: - name: mails-templates - path: src/backend/core/templates/mail + name: mails-templates + path: src/backend/core/templates/mail lint-back: runs-on: ubuntu-latest diff --git a/CHANGELOG.md b/CHANGELOG.md index 1766df7..969d355 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,7 @@ and this project adheres to - ✨(api) add RELEASE version on config endpoint #459 - ✨(backend) manage roles on domain admin view - ✨(frontend) show version number in footer #369 +- 👷(ci) add sharding e2e tests #467 ### Changed