Skip to content

test(pnpm): group release-brittle tests under a shared describe#11767

Merged
zkochan merged 1 commit into
mainfrom
fix-tests
May 20, 2026
Merged

test(pnpm): group release-brittle tests under a shared describe#11767
zkochan merged 1 commit into
mainfrom
fix-tests

Conversation

@zkochan

@zkochan zkochan commented May 20, 2026

Copy link
Copy Markdown
Member

Summary

Three tests resolve the running pnpm version's integrity from registry-mock, which proxies pnpm to npmjs. Between a chore(release): commit and the matching npm publish landing, the fetch errors with No matching version found for pnpm@<version> and the tests fail. They pass again once the version is on npmjs.

This PR groups them under describe('release-brittle: may fail until current version is published to npm', ...) in each of the two affected files, so the failure mode is obvious from the test name and the explanation lives in a single comment per file instead of being repeated per test.

Affected tests:

  • pnpm/test/packageManagerCheck.test.tspnpm --version exits promptly when devEngines.packageManager matches the running pnpm
  • pnpm/test/packageManagerCheck.test.tsdevEngines.packageManager with version range should match current version
  • pnpm/test/configurationalDependencies.test.tspackageManagerDependencies is refreshed when pnpm is invoked via corepack (#11397)

No production code changes; no changeset.

Test plan

  • After the next chore(release): commit lands, confirm these tests still fail with the now-clearer describe label and don't trigger fresh investigation.
  • After the corresponding npm publish, confirm they pass again.

Written by an agent (Claude Code, claude-opus-4-7).

Summary by CodeRabbit

  • Tests
    • Reorganized test suites with improved documentation noting brittleness and expected behavior during release cycles until the current version is published to npm.

Review Change Stack

Three tests resolve the running pnpm version's integrity from registry-mock,
which proxies pnpm to npmjs. They fail every release between the version
bump commit and the matching npm publish ("No matching version found for
pnpm@<version>"), then pass again once the version lands on npmjs. Group
them under a 'release-brittle' describe in each file so the failure mode
is obvious from the test name and only stated once.
Copilot AI review requested due to automatic review settings May 20, 2026 12:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR improves the clarity of a known intermittent test failure mode by grouping tests that depend on the currently running pnpm version being available on npmjs (via registry-mock proxying). This makes “release window” failures self-explanatory in test output and avoids repeating the same explanatory comment for each test.

Changes:

  • Group two packageManagerCheck tests under a shared describe('release-brittle: ...') with a single explanation comment.
  • Group the configurationalDependencies corepack regression test under the same shared describe('release-brittle: ...') with a single explanation comment.
  • Update Jest imports to include describe where needed.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
pnpm/test/packageManagerCheck.test.ts Adds a shared describe('release-brittle: ...') wrapper + single explanatory comment for two npm-publish-window-sensitive tests.
pnpm/test/configurationalDependencies.test.ts Adds a shared describe('release-brittle: ...') wrapper + single explanatory comment for the corepack-related lockfile refresh regression test.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@coderabbitai

coderabbitai Bot commented May 20, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 2f7fb92a-f26a-4927-9155-c4b0423e188e

📥 Commits

Reviewing files that changed from the base of the PR and between 0fb7233 and 1b3fc85.

📒 Files selected for processing (2)
  • pnpm/test/configurationalDependencies.test.ts
  • pnpm/test/packageManagerCheck.test.ts
📜 Recent review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: ubuntu-latest / Node.js 24 / Test
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx}: Follow Standard Style with trailing commas, prefer functions over classes, declare functions after they are used (rely on hoisting), and use a single options object for functions with more than two or three arguments
Sort imports in three groups: standard libraries, external dependencies (alphabetically), then relative imports
Write code that explains itself through clear naming and types — do not write comments that merely restate what the code already says; use comments only for non-obvious reasons, hidden invariants, or workarounds

Files:

  • pnpm/test/configurationalDependencies.test.ts
  • pnpm/test/packageManagerCheck.test.ts
**/*.test.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use util.types.isNativeError() instead of instanceof Error when type-checking errors in Jest tests, as instanceof checks can fail across VM realms

Files:

  • pnpm/test/configurationalDependencies.test.ts
  • pnpm/test/packageManagerCheck.test.ts
🧠 Learnings (1)
📚 Learning: 2026-05-14T09:04:00.133Z
Learnt from: zkochan
Repo: pnpm/pnpm PR: 11622
File: resolving/npm-resolver/test/publishedBy.test.ts:350-354
Timestamp: 2026-05-14T09:04:00.133Z
Learning: In the pnpm/pnpm repository, ESLint is the authoritative style linter. Do not raise review findings for missing trailing commas in multiline function calls (e.g., `fs.writeFileSync(...)`) when this repo’s ESLint configuration does not report them and lint passes. Prefer deferring to the ESLint results for this specific trailing-comma rule rather than enforcing it manually in code review.

Applied to files:

  • pnpm/test/configurationalDependencies.test.ts
  • pnpm/test/packageManagerCheck.test.ts
🔇 Additional comments (4)
pnpm/test/configurationalDependencies.test.ts (2)

4-4: LGTM!


152-197: LGTM!

pnpm/test/packageManagerCheck.test.ts (2)

1-1: LGTM!


432-484: LGTM!


📝 Walkthrough

Walkthrough

This PR reorganizes test suites in two pnpm test files by wrapping existing regression and brittle tests in descriptive describe blocks. Both files now import describe from @jest/globals and group tests marked as potentially flaky due to registry synchronization delays before new versions are published.

Changes

Release-brittle test organization

Layer / File(s) Summary
Mark corepack configuration test as release-brittle
pnpm/test/configurationalDependencies.test.ts
Import describe and wrap the existing #11397 test (packageManagerDependencies is refreshed when pnpm is invoked via corepack) in a describe('release-brittle: ...') suite. Adjust test indentation and formatting within the wrapper while preserving the core assertion logic on packageManagerDependencies?.pnpm.version.
Reorganize regression tests as release-brittle
pnpm/test/packageManagerCheck.test.ts
Import describe and move two previously top-level regression tests (pnpm --version prompt-exit behavior and devEngines.packageManager version-range matching) into a new describe('release-brittle: may fail until current version is published to npm', ...) block with explanatory comments about registry synchronization lag.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • pnpm/pnpm#11571: Both PRs modify pnpm/test/packageManagerCheck.test.ts to regroup the same pnpm --version and devEngines.packageManager regression assertions under a release-brittle wrapper, indicating this PR adjusts the test coverage for the worker-pool termination fix from #11571.

Suggested labels

area: cli/dlx

Poem

🐰 Tests now sleep in brittle beds,
Wrapped in describe with gentle threads,
When npm lags, they pause and rest,
Marked with labels, clearly blessed.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: grouping release-brittle tests under a shared describe block.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@zkochan zkochan merged commit ef87f3c into main May 20, 2026
19 checks passed
@zkochan zkochan deleted the fix-tests branch May 20, 2026 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants