Skip to content

Commit

Permalink
Merge pull request #1 from testradar/simplify-retries-implementation
Browse files Browse the repository at this point in the history
Simplify test retries implementation
  • Loading branch information
BuckyMaler authored Feb 5, 2024
2 parents 0c015e8 + b037170 commit 29eed31
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@ jobs:
node-version: 16.x
cache: 'npm'
- run: npm ci
# `JEST_RETRIES` doesn't auto enable test retries.
# It needs to be used with `jest.retryTimes(numRetries)`.
# see: https://github.com/testradar/testradar-example-repo/blob/main/src/setupTests.ts#L7
- run: JEST_RETRIES=2 npm test
- run: npm test

e2e-test:
runs-on: ubuntu-latest
Expand All @@ -36,8 +33,6 @@ jobs:
cache: 'npm'
- name: Cypress Run
uses: cypress-io/github-action@v5
env:
CYPRESS_RETRIES: 2
with:
command: npm run e2e

Expand Down
1 change: 1 addition & 0 deletions cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ export default defineConfig({
setupTestRadar(on, { repositoryId: 674463592 });
},
},
retries: 2,
});
2 changes: 1 addition & 1 deletion src/setupTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
// learn more: https://github.com/testing-library/jest-dom
import '@testing-library/jest-dom';

jest.retryTimes(Number(process.env.JEST_RETRIES ?? 0));
jest.retryTimes(2);

0 comments on commit 29eed31

Please sign in to comment.