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

Remove nock database #494

Open
mcollina opened this issue Jun 10, 2024 · 3 comments
Open

Remove nock database #494

mcollina opened this issue Jun 10, 2024 · 3 comments

Comments

@mcollina
Copy link
Member

Having a "nock" database makes this codebase harder to reason about due to the "dynamic" nature of this mocking.

Can this be refactored out?

@aduh95
Copy link
Contributor

aduh95 commented Jun 10, 2024

Can you clarify what's "dynamic" about it? Note that you need to provide NOCK_ENV=replay env variable, otherwise the nock DB is ignored.

@mcollina
Copy link
Member Author

Maybe I don't understand the source code exactly, but https://github.com/nodejs/corepack/blob/main/.github/workflows/update-nock-files.yml updates it in a PR id passed through. Maybe dynamic is not the right term, but I found this quite hard to reason about.

Why would you need this step?

@aduh95
Copy link
Contributor

aduh95 commented Jun 10, 2024

If we remove it, it’s only going to make the CI more flaky – because tests would rely on network calls instead of the FS. The only thing dynamic about it is that changes in Corepack internals can result in different endpoint being hit, at which point the nock db needs to be updated to cover those new endpoints.

Why do we need the workflow: I use it because I find it simpler to use it than to pull the PR branch locally and update the nock DB manually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants