From 63c395786c40ccd934f6421573af1065c5538ee3 Mon Sep 17 00:00:00 2001 From: Vitali Zaidman Date: Thu, 10 Oct 2024 13:01:24 +0100 Subject: [PATCH] skip certain tests when installing yarn ignoring the lockfile --- .github/workflows/nightly-tests.yml | 4 +++- .github/workflows/test.yml | 2 ++ jest.config.js | 7 +++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nightly-tests.yml b/.github/workflows/nightly-tests.yml index 3843bda35..541c8dde7 100644 --- a/.github/workflows/nightly-tests.yml +++ b/.github/workflows/nightly-tests.yml @@ -11,6 +11,9 @@ on: schedule: # Daily at at 5:00 UTC - cron: '0 5 * * *' + # @nocommit (this is just used to trigger nightlies on this PR) + pull_request: + types: [opened, synchronize] jobs: test: @@ -26,7 +29,6 @@ jobs: 'current' # newest ] no-lockfile: ['false', 'true'] - name: "Tests [Node.js ${{ matrix.node-version }}, ${{ matrix.runs-on }}, ${{ matrix.no-lockfile == 'false' && 'Using yarn.lock' || 'Ignoring yarn.lock' }}]" uses: ./.github/workflows/test.yml with: node-version: ${{ matrix.node-version }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7da3ddc69..ac3c3c8cc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -27,3 +27,5 @@ jobs: no-lockfile: ${{ inputs.no-lockfile }} - name: Run Jest Tests run: yarn jest --ci --maxWorkers 4 --reporters=default --reporters=jest-junit --rootdir='./' + env: + YARN_INSTALL_NO_LOCKFILE: ${{ inputs.no-lockfile }} diff --git a/jest.config.js b/jest.config.js index c8021801d..1b61a25a1 100644 --- a/jest.config.js +++ b/jest.config.js @@ -9,6 +9,12 @@ */ module.exports = function jestConfig() { + const testPathIgnorePatterns = []; + if (process.env.YARN_INSTALL_NO_LOCKFILE) { + // flaky babel types test - this should be removed once babel is updated + testPathIgnorePatterns.push('__tests__/babel-lib-defs-test.js'); + } + /** @type {import('jest').Config} **/ const config = { modulePathIgnorePatterns: ['/node_modules/', 'packages/[^/]+/build/'], @@ -18,6 +24,7 @@ module.exports = function jestConfig() { }, testEnvironment: 'node', testRegex: '/__tests__/.*-test\\.js$', + testPathIgnorePatterns, fakeTimers: { enableGlobally: true, legacyFakeTimers: false,