test: added retries for ci

This commit is contained in:
alina 🌸 2023-12-02 19:24:35 +03:00
parent 6fb2b652d3
commit d0a7ba4300
Signed by: teidesu
SSH key fingerprint: SHA256:uNeCpw6aTSU4aIObXLvHfLkDa82HWH9EiOj9AXOIRpI
2 changed files with 8 additions and 1 deletions

View file

@ -18,6 +18,7 @@ export default mergeConfig(baseConfig, defineConfig({
fakeTimers: { fakeTimers: {
toFake: ['setTimeout', 'clearTimeout', 'setInterval', 'clearInterval', 'Date'] toFake: ['setTimeout', 'clearTimeout', 'setInterval', 'clearInterval', 'Date']
}, },
retry: process.env.CI ? 3 : 0,
// for whatever reason using exclude-s makes the vite never start the browser, so we use skip-s instead. // for whatever reason using exclude-s makes the vite never start the browser, so we use skip-s instead.
// exclude: [ // exclude: [
// './packages/crypto-node/**', // './packages/crypto-node/**',

View file

@ -57,7 +57,13 @@ jobs:
- name: 'Initialize browser' - name: 'Initialize browser'
run: pnpm exec playwright install --with-deps ${{ matrix.browser }} run: pnpm exec playwright install --with-deps ${{ matrix.browser }}
- name: 'Run tests' - name: 'Run tests'
run: pnpm run test:browser --browser.name=${{ matrix.browser }} # i wish we didn't have to do this, but vitest in browser is very flaky
# see: https://github.com/vitest-dev/vitest/issues/4173
uses: nick-fields/retry@v2
with:
max_attempts: 3
timeout_minutes: 30
command: pnpm run test:browser --browser.name=${{ matrix.browser }}
e2e: e2e:
runs-on: ubuntu-latest runs-on: ubuntu-latest