From eedd85626e5e7a63c9b13dc15f34081c896e00d7 Mon Sep 17 00:00:00 2001 From: Cristian Cepeda <43882+pastuxso@users.noreply.github.com> Date: Mon, 12 Feb 2024 10:38:38 -0500 Subject: [PATCH] Updates vitest config to deal with flaky tests (#16) --- .github/workflows/test.yaml | 15 ++++++++++++--- CONTRIBUTING.md | 4 ++-- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 24a17a4..7bbca3c 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -1,15 +1,24 @@ name: Test Changes -on: [push, pull_request] +on: + pull_request: + push: + branches: + - main + +# cancel old edit events being processed +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true jobs: test: runs-on: ubuntu-latest steps: - name: Clone Repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Setup Node version - uses: actions/setup-node@v2 + uses: actions/setup-node@v4 with: node-version: 20.x - name: Install dependencies diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ae1334c..11973a0 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -44,12 +44,12 @@ npx eslint src tests unit tests via [Vitest](https://vitest.dev/): ```sh {"id":"01HF7GMQ6NTPMHCVN4BY0W782F","name":"test:unit"} -npx vitest --config ./vitest.config.ts +npx vitest --config ./vitest.config.ts --retry=3 ``` Update snapshots used in tests if necesary: -```sh {"name":"test:unit:snapshots"} +```sh {"id":"01HPEYC6NE0WP6X2KTGQAHZVSN","name":"test:unit:snapshots"} npx vitest --config ./vitest.config.ts -u ```