fix(ci): run packages/eslint-plugin/ tests as part of root npm test (#1766)#1767
Merged
Conversation
…1766) Chain `npm test --workspaces --if-present` onto the root test script so CI's Test & Build job (which runs `npm test`) exercises the ESLint plugin's rule tests. Plugin tests landed in PR #1762 but weren't running in CI, so plugin regressions could land on main silently. `--workspaces --if-present` is forward-compatible: any future workspace that adds a `test` script is automatically picked up. `packages/client-shim` has no `test` script and is correctly skipped. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…icitly Root package.json declares workspaces as [".", "packages/*"], so `npm test --workspaces` re-invokes the root test script, which recurses indefinitely until CI cancels. Switch to an explicit `--workspace=packages/eslint-plugin` invocation so the plugin tests run exactly once. Future workspaces with test scripts get appended explicitly. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
Author
CI recursion fixInitial commit used Fixed by switching to explicit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #1766. Chains
npm test --workspaces --if-presentonto the roottestscript so CI'sTest & Buildjob (which runsnpm test) exercises the ESLint plugin's rule tests.The gap. PR #1752 shipped
packages/eslint-plugin/and PR #1762 added 30 rule tests, but neither wired the plugin'stestscript into rootnpm test. CI'sTest & Buildstep ran the SDK tests only — plugin regressions could land on main silently.The fix. Single-line edit to
package.jsonscripts.test:--workspaces --if-presentinvokes thetestscript in every workspace that defines one, and silently skips those that don't — forward-compatible for any future workspace.Verification
cd packages/eslint-plugin && npm testpasses 30/30 (3 suites:no-credential-read-from-args).npm test --workspaces --if-presentfrom repo root reaches@adcp/eslint-plugin'stestscript. Verified the npm dispatch picks it up.packages/client-shim/package.jsonhas notestscript —--if-presentcorrectly skips it (no behavior change there, and if it ever adds tests they'll be auto-covered)..github/workflows/ci.yml, line 86 in theTest & Buildjob) runsnpm testdirectly, so no workflow edit needed.prettier --checkclean on changed files.Test plan
Test & Buildjob runs both SDK tests and@adcp/eslint-pluginteststestscript are automatically exercised by CI🤖 Generated with Claude Code