chore(test): Performance (#12267)

* chore(test): drop no-op per-test Redis flushall

The afterEach created a fresh ioredis-mock client and flushed it, which
doesn't clear state held by clients elsewhere in the test. Removing the
hook saves a few ms across thousands of test cases.

* Cache Jest transform cache
This commit is contained in:
Tom Moor
2026-05-05 08:26:55 -04:00
committed by GitHub
parent a7c95b8d7e
commit 0df6c4947a
2 changed files with 18 additions and 12 deletions
+18 -2
View File
@@ -82,7 +82,15 @@ jobs:
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/install
- run: yarn test:${{ matrix.test-group }}
- name: Restore Jest transform cache
uses: actions/cache@v4
with:
path: /tmp/jest_runner
key: jest-${{ matrix.test-group }}-${{ hashFiles('.babelrc', '.jestconfig.json', 'yarn.lock', 'app/**/*.ts', 'app/**/*.tsx', 'shared/**/*.ts', 'shared/**/*.tsx') }}
restore-keys: |
jest-${{ matrix.test-group }}-${{ hashFiles('.babelrc', '.jestconfig.json', 'yarn.lock') }}-
jest-${{ matrix.test-group }}-
- run: yarn test:${{ matrix.test-group }} --cacheDirectory=/tmp/jest_runner
test-server:
needs: changes
@@ -110,9 +118,17 @@ jobs:
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/install
- name: Restore Jest transform cache
uses: actions/cache@v4
with:
path: /tmp/jest_runner
key: jest-server-${{ matrix.shard }}-${{ hashFiles('.babelrc', '.jestconfig.json', 'yarn.lock', 'server/**/*.ts', 'shared/**/*.ts', 'plugins/**/*.ts') }}
restore-keys: |
jest-server-${{ matrix.shard }}-${{ hashFiles('.babelrc', '.jestconfig.json', 'yarn.lock') }}-
jest-server-${{ matrix.shard }}-
- run: yarn sequelize db:migrate
- name: Run server tests
run: yarn test:server --maxWorkers=2 --shard=${{ matrix.shard }}/4
run: yarn test:server --maxWorkers=2 --shard=${{ matrix.shard }}/4 --cacheDirectory=/tmp/jest_runner
bundle-size:
needs: changes