Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: store nocks in a sqlite database #374

Merged
merged 8 commits into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions .github/workflows/update-nock-files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ jobs:
- name: Install Node
uses: actions/setup-node@v4
with:
# Let's use the oldest version supported to be sure the V8
# serialization is compatible with all supported versions.
node-version: 18.x
node-version: lts/*

- name: Get the Yarn cache directory path
id: yarn-cache-dir-path
Expand All @@ -43,21 +41,21 @@ jobs:
- run: corepack yarn build # We need the stubs to run the tests

- name: Remove old Nock files to avoid conflicts
run: rm -r tests/nock
run: rm tests/nocks.db

- run: corepack yarn test
env:
NOCK_ENV: record

- name: Check if anything has changed
id: contains-changes
run: echo "result=$(git --no-pager diff --quiet -- tests/nock || echo "yes")" >> $GITHUB_OUTPUT
run: echo "result=$(git --no-pager diff --quiet -- tests/nocks.db || echo "yes")" >> $GITHUB_OUTPUT
shell: bash

- name: Commit changes
if: ${{ steps.contains-changes.outputs.result == 'yes' }}
run: |
git add tests/nock/
git add tests/nocks.db
git config --global user.email "actions@github.com"
git config --global user.name "GitHub Actions"
git commit -m "update Nock files"
Expand All @@ -72,10 +70,10 @@ jobs:
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload `tests/nock` in case of failure
- name: Upload `tests/nocks.db` in case of failure
uses: actions/upload-artifact@v4
if: ${{ failure() && steps.contains-changes.outputs.result == 'yes' }}
with:
name: nock
path: |
tests/nock
tests/nocks.db
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"@yarnpkg/fslib": "^3.0.0-rc.48",
"@zkochan/cmd-shim": "^6.0.0",
"babel-plugin-dynamic-import-node": "^2.3.3",
"better-sqlite3": "^9.4.1",
"clipanion": "^3.0.1",
"debug": "^4.1.1",
"esbuild": "0.19.5",
Expand Down
2 changes: 0 additions & 2 deletions tests/_runCli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ export async function runCli(cwd: PortablePath, argv: Array<string>): Promise<{e
const err: Array<Buffer> = [];

return new Promise((resolve, reject) => {
if (process.env.RUN_CLI_ID)
(process.env.RUN_CLI_ID as any)++;
const child = spawn(process.execPath, [`--no-warnings`, `-r`, require.resolve(`./recordRequests.js`), require.resolve(`../dist/corepack.js`), ...argv], {
cwd: npath.fromPortablePath(cwd),
env: process.env,
Expand Down
1 change: 0 additions & 1 deletion tests/nock/0mijz-lZ_5pF8f6tlAdbKg-1.dat

This file was deleted.

1 change: 0 additions & 1 deletion tests/nock/2Vuch5EnmzPEVel1DWYfPQ-1.dat

This file was deleted.

1 change: 0 additions & 1 deletion tests/nock/2bh2z3MgoMIcnxHAMev5uQ-1.dat

This file was deleted.

1 change: 0 additions & 1 deletion tests/nock/2ituqIIXsQUU5l2SZSMRDQ-1.dat

This file was deleted.

1 change: 0 additions & 1 deletion tests/nock/3cCMRJMrFyNpV7MlFGUXYw-1.dat

This file was deleted.

1 change: 0 additions & 1 deletion tests/nock/4IfgwoxNR5JV5bBojS26Kg-1.dat

This file was deleted.

1 change: 0 additions & 1 deletion tests/nock/4IfgwoxNR5JV5bBojS26Kg-2.dat

This file was deleted.

1 change: 0 additions & 1 deletion tests/nock/4IfgwoxNR5JV5bBojS26Kg-3.dat

This file was deleted.

1 change: 0 additions & 1 deletion tests/nock/6BSdMkNfyZxTnw4r9rK5ig-1.dat

This file was deleted.

1 change: 0 additions & 1 deletion tests/nock/6wKqy4gh7jHaGEejJ6MskQ-1.dat

This file was deleted.

1 change: 0 additions & 1 deletion tests/nock/6zkNeK1b_EJchZZ1iQz7GQ-1.dat

This file was deleted.

1 change: 0 additions & 1 deletion tests/nock/7_ZKSRHG7OfkRvPJHYpxbQ-1.dat

This file was deleted.

Binary file removed tests/nock/8LXMft4IyEWeaqoiynS5FA-1.dat
Binary file not shown.
1 change: 0 additions & 1 deletion tests/nock/AL__3okpCdfjA6kGuG2rFQ-1.dat

This file was deleted.

1 change: 0 additions & 1 deletion tests/nock/Bk2ABpjab9iEEgLyTDm7Nw-2.dat

This file was deleted.

1 change: 0 additions & 1 deletion tests/nock/ClrKWNyvjynLF4vcKkUjqQ-1.dat

This file was deleted.

1 change: 0 additions & 1 deletion tests/nock/D4fdrCUUCl7i1D6eeg49zQ-1.dat

This file was deleted.

1 change: 0 additions & 1 deletion tests/nock/GSh7RCQN4e8flEL6h2lnwQ-1.dat

This file was deleted.

1 change: 0 additions & 1 deletion tests/nock/K26guRbYG9vZYQwgFU5lHg-1.dat

This file was deleted.

1 change: 0 additions & 1 deletion tests/nock/LU_vfrNkPzIhLrr405IpzQ-1.dat

This file was deleted.

1 change: 0 additions & 1 deletion tests/nock/M82EVNBXM8yFkn6tOCflMA-1.dat

This file was deleted.

1 change: 0 additions & 1 deletion tests/nock/MVR-DPxEL7jQE9aetA791Q-1.dat

This file was deleted.

1 change: 0 additions & 1 deletion tests/nock/MuEAzZXT77khPx8FpLSF2A-1.dat

This file was deleted.

1 change: 0 additions & 1 deletion tests/nock/S9h20CvrT1ljP2zwMQUMFw-1.dat

This file was deleted.

1 change: 0 additions & 1 deletion tests/nock/TnyRFo6IK894n_HQkACElA-1.dat

This file was deleted.

1 change: 0 additions & 1 deletion tests/nock/Vp5BnbFIGGY7ZeZMncmwMw-1.dat

This file was deleted.

1 change: 0 additions & 1 deletion tests/nock/VtMTrMazyfrMmIBBLfdGzA-1.dat

This file was deleted.

1 change: 0 additions & 1 deletion tests/nock/WAsCdU-KCdvkg9dJ46zkWQ-1.dat

This file was deleted.

1 change: 0 additions & 1 deletion tests/nock/WyEcK5FmdvhvOqnb2mHi5A-1.dat

This file was deleted.

1 change: 0 additions & 1 deletion tests/nock/WyEcK5FmdvhvOqnb2mHi5A-3.dat

This file was deleted.

1 change: 0 additions & 1 deletion tests/nock/XtnC4qVqg7VJUOAoKyxAbA-1.dat

This file was deleted.

1 change: 0 additions & 1 deletion tests/nock/XtnC4qVqg7VJUOAoKyxAbA-2.dat

This file was deleted.

1 change: 0 additions & 1 deletion tests/nock/XtnC4qVqg7VJUOAoKyxAbA-3.dat

This file was deleted.

1 change: 0 additions & 1 deletion tests/nock/_2yNDOq6UlHEKY9lwBEOig-1.dat

This file was deleted.

1 change: 0 additions & 1 deletion tests/nock/_ssVB5fpNumqL8RMl4TqHw-1.dat

This file was deleted.

1 change: 0 additions & 1 deletion tests/nock/_ssVB5fpNumqL8RMl4TqHw-3.dat

This file was deleted.

Binary file removed tests/nock/bNE0FYc3WlnFGzjHaIdf5A-1.dat
Binary file not shown.
1 change: 0 additions & 1 deletion tests/nock/cRq-o3WTbH0_0MVIM498_Q-1.dat

This file was deleted.

Loading