test(e2e): scope verdaccio registry to workspace config#10435
test(e2e): scope verdaccio registry to workspace config#10435davidfirst wants to merge 2 commits into
Conversation
Tests set the npm registry via 'bit config set registry', which defaults
to Bit's global config and leaks the local verdaccio URL into every
workspace when run locally. Pass --local-track so it's written to the
test workspace's workspace.jsonc instead, and drop the now-redundant
delConfig('registry') cleanup calls.
PR Summary by QodoE2E: write verdaccio registry to workspace config (avoid global Bit config leak) Description
Diagram
High-Level Assessment
Files changed (6)
|
Code Review by Qodo
1. Reimport drift no longer scoped
|
| npmCiRegistry.configureCustomNameInPackageJsonHarmony(name); | ||
| await npmCiRegistry.init(); | ||
| helper.command.setConfig('registry', npmCiRegistry.getRegistryUrl()); | ||
| helper.command.setConfig('registry', npmCiRegistry.getRegistryUrl(), '--local-track'); |
There was a problem hiding this comment.
1. Reimport drift no longer scoped 🐞 Bug ☼ Reliability
In deps-graph-reimport.e2e.ts and deps-graph.e2e.ts, the tests set the registry via --local-track and then call reInitWorkspace() one or more times, but continue with installs/imports in the new workspace without reapplying the registry, which can either hit the default registry or stop exercising the intended reimport/drift regression scenarios.
Agent Prompt
## Issue description
The deps-graph E2E tests set `registry` using `bit config set ... --local-track`, which persists into `workspace.jsonc`, but later call `helper.scopeHelper.reInitWorkspace()` which empties the workspace directory and removes `workspace.jsonc`. After re-initialization, the tests continue running `install`/`import` steps without reapplying the mocked registry, so those operations may hit the default registry and either fail or stop validating the intended reimport/drift regression behavior.
## Issue Context
These suites use registry-mock and `addDistTag()` to mutate registry state and create drift-sensitive conditions; if later steps are executed without the mock registry configured in the newly initialized workspace, the test can pass for the wrong reason (the newer dist-tagged versions aren’t visible) or fail because packages cannot be resolved.
## Fix Focus Areas
- e2e/harmony/deps-graph-reimport.e2e.ts[29-74]
- e2e/harmony/deps-graph-reimport.e2e.ts[87-155]
- e2e/harmony/deps-graph.e2e.ts[147-218]
- e2e/harmony/deps-graph.e2e.ts[244-289]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
|
Code review by qodo was updated up to the latest commit 51e52ca |
E2E tests set the npm registry with
bit config set registry <verdaccio-url>, which defaults to Bit's global config store. When the suite runs locally, the local verdaccio URL leaks into every other Bit workspace, so unrelated installs try to reach the (now-dead) local registry.Pass
--local-trackso the registry is written to the test workspace'sworkspace.jsonc(originworkspace) instead of the global config.getConfigstill reads it during install, but it's confined to the throwaway test workspace. Also removed the now-redundantdelConfig('registry')cleanup calls.