mirror of
https://github.com/outline/outline.git
synced 2026-06-13 03:14:59 +03:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user