Skip to content

Commit

Permalink
Only retry tests on CI (vercel#12998)
Browse files Browse the repository at this point in the history
  • Loading branch information
Janpot authored May 17, 2020
1 parent ca372a9 commit 9f8076b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions run-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ const TIMINGS_API = `https://next-timings.jjsweb.site/api/timings`
{
stdio: 'inherit',
env: {
JEST_RETRY_TIMES: 3,
...process.env,
...(isAzure
? {
Expand Down
6 changes: 5 additions & 1 deletion test/jest-setup-after-env.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/* eslint-env jest */

jest.retryTimes(3)
if (process.env.JEST_RETRY_TIMES) {
const retries = Number(process.env.JEST_RETRY_TIMES)
console.log(`Configuring jest retries: ${retries}`)
jest.retryTimes(retries)
}

0 comments on commit 9f8076b

Please sign in to comment.