Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@
"build:packages": "npm run build --workspaces",
"build:sandbox": "node scripts/build_sandbox.js",
"bundle": "npm run generate && node esbuild.config.js && node scripts/copy_bundle_assets.js",
"test": "cross-env NODE_OPTIONS=\"--max-old-space-size=3072\" npm run test --workspaces --if-present --parallel",
"test:ci": "cross-env NODE_OPTIONS=\"--max-old-space-size=3072\" npm run test:ci --workspaces --if-present --parallel && npm run test:scripts",
"test:release": "cross-env NODE_OPTIONS=\"--max-old-space-size=3072\" npm run test:ci --workspaces --if-present --parallel -- --coverage.enabled=false && npm run test:scripts",
"test": "cross-env NODE_OPTIONS=\"--max-old-space-size=3072\" npm run test --workspaces --if-present",
"test:ci": "cross-env NODE_OPTIONS=\"--max-old-space-size=3072\" npm run test:ci --workspaces --if-present && npm run test:scripts",
"test:release": "cross-env NODE_OPTIONS=\"--max-old-space-size=3072\" npm run test:ci --workspaces --if-present -- --coverage.enabled=false && npm run test:scripts",
"test:scripts": "vitest run --config ./scripts/tests/vitest.config.ts",
"test:e2e": "cross-env VERBOSE=true KEEP_OUTPUT=true npm run test:integration:sandbox:none",
"test:chrome-extension:e2e": "npm -w packages/chrome-extension run test:e2e:chrome",
Expand Down
2 changes: 1 addition & 1 deletion scripts/tests/no-ak-integration-ci.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ describe('no-AK integration CI wiring', () => {
);
expect(smokeWorkflow).toContain('npm run test:ci');
expect(smokeWorkflow).not.toContain(
'npm run test:ci --workspaces --if-present --parallel',
'npm run test:ci --workspaces --if-present',
);
// Same ordering as the gate: autocrlf off before the checkout, the `./`
// configure action after it.
Expand Down
2 changes: 1 addition & 1 deletion scripts/tests/package-scripts.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ describe('package scripts', () => {
expect(packageJson.scripts['test:release']).toBe(
[
'cross-env NODE_OPTIONS="--max-old-space-size=3072"',
'npm run test:ci --workspaces --if-present --parallel -- --coverage.enabled=false',
'npm run test:ci --workspaces --if-present -- --coverage.enabled=false',

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Suggestion] Of the three scripts this PR fixes (test, test:ci, test:release), only test:release is pinned by an exact-value assertion; test and test:ci are asserted nowhere (I checked every packageJson.scripts read site). So the exact --parallel regression this PR fixes can silently recur for the two most-used scripts. — Failure scenario: a future change re-adds --parallel (or another unsupported npm flag) to the test or test:ci script in package.json. No test fails, and CI stays green because CI's npm 10.x tolerates unknown flags — exactly why the original flag went unnoticed — while every developer on npm ≥ 12 hits the identical EUNKNOWNCONFIG failure of issue #8721 again at runtime. Probed on both npm versions: 10.9.4 accepts the flag (exit 0), 12.0.2 hard-fails with EUNKNOWNCONFIG, byte-for-byte the issue report. Consider extending the existing pin pattern to cover test and test:ci too, e.g.:

for (const name of ['test', 'test:ci', 'test:release']) {
  expect(packageJson.scripts[name]).not.toContain('--parallel');
}

— qwen3.8-max via Qwen Code /review (v0.21.7)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like immortalising the original problem (adding a flag to the calls that never actually worked) with a test here is unlikely to be really helpful, and in its suggestged form it wouldn't catch many other potential problems.

There might be better, more general solutions that chip away at this problem (testing with newer npm versions as they come out, testing with a matrix of npm/node versions....) that would catch such regressions or issues better than adding a fragile check.

I have a change like the way it was suggesged above, prepared and happy to push if the above logic doesn't make sense and the test is still preferred.

'&& npm run test:scripts',
].join(' '),
);
Expand Down
Loading