Skip to content

Add skiplibcheck tests#83

Merged
PavelVanecek merged 4 commits intomainfrom
skiplibcheck
Dec 1, 2025
Merged

Add skiplibcheck tests#83
PavelVanecek merged 4 commits intomainfrom
skiplibcheck

Conversation

@PavelVanecek
Copy link
Collaborator

@PavelVanecek PavelVanecek commented Dec 1, 2025

This reproduces recharts/recharts#6664. No solution yet, only test!

Also added descriptions and better output in the UI, and marked two passing tests as stable.

Summary by CodeRabbit

  • New Features

    • Added new test scenarios for TypeScript configuration compatibility and React 16 support
    • Test descriptions now display in the test UI for better clarity
    • Enhanced test automation with additional verification capabilities
  • Bug Fixes

    • Improved test outcome reporting with clearer output messages
    • Marked React 18 and React 19 integration tests as stable

✏️ Tip: You can customize this high-level summary in your review settings.

- Add optional description field to TestMetadata interface
- Add descriptions for skipLibCheck tests with links to GitHub issue
- Display description in UI with ellipsis for long text
- Include description in API response
- Style description as italic gray text with max width
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 1, 2025

Walkthrough

Adds two integration test projects with TypeScript, React 16/19, and skipLibCheck configurations. Extends test infrastructure to support description metadata, dependency version verification across package managers, and refactors test outcome handling with optional output parameters. Updates test UI frontend to display descriptions.

Changes

Cohort / File(s) Change Summary
Integration: ts-react16-skip-lib-check-false
integrations/ts-react16-skip-lib-check-false/main.ts, integrations/ts-react16-skip-lib-check-false/package.json, integrations/ts-react16-skip-lib-check-false/tsconfig.json
New integration project configuration with React 16.8.x, Recharts, and TypeScript, including dependency overrides/resolutions to align transitive dependencies and a tsconfig with skipLibCheck false.
Integration: ts-skip-lib-check-false
integrations/ts-skip-lib-check-false/main.ts, integrations/ts-skip-lib-check-false/package.json, integrations/ts-skip-lib-check-false/tsconfig.json
New integration project configuration with React 19, Recharts, and TypeScript, and a tsconfig targeting ES2020 with strict and noEmit flags.
Test Infrastructure: Controllers & Outcomes
test-ui/server/scripts/NpmController.ts, test-ui/server/scripts/TestOutcome.ts, test-ui/server/scripts/YarnController.ts
Extended TestOutcome.ok() to accept optional output parameter; refactored YarnController with new methods (install, test, build, pack, verifySingleDependencyVersion, parseYarnListOutput); updated NpmController exception message and success return structure.
Test Configuration & Server
test-ui/server/scripts/test-registry.ts, test-ui/server/server.ts
Added optional description field to TestMetadata interface; promoted ts-react18 and ts-react19 tests to stable; added four new skipLibCheck and React-16 integration tests with descriptions; simplified runPhase result handling; updated GET /api/tests endpoint to include description and aggregated verify output.
Test UI Frontend
test-ui/src/App.tsx, test-ui/src/App.css, test-ui/src/types.ts
Added optional description field to Test interface; rendered conditional description span in TestItem with truncation styling; added .test-description CSS class with color, font-size, italics, and ellipsis overflow handling.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Areas requiring extra attention:

  • YarnController.parseYarnListOutput: Recursive JSON tree traversal logic for extracting dependency versions—verify the recursion handles nested structures correctly and terminates properly.
  • YarnController.verifySingleDependencyVersion: Ensure error handling for missing or unparseable yarn list output is robust and edge cases (monorepos, uninstalled dependencies) are handled.
  • Test outcome propagation chain: TestOutcome.ok() signature change, NpmController/YarnController integration, server.ts aggregation of output—verify the optional output parameter flows correctly through all callers and doesn't break existing tests.
  • Integration project dependency overrides: Validate that overrides/resolutions in package.json correctly pin transitive dependencies for React 16.8.x compatibility without conflicts.

Possibly related PRs

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add skiplibcheck tests' directly reflects the main purpose of the PR, which is to add new test cases for skipLibCheck scenarios.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch skiplibcheck

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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (5)
integrations/ts-react16-skip-lib-check-false/package.json (1)

1-35: Dependency wiring for the React 16 scenario looks intentional; consider adding ReactDOM types if needed

Using recharts: "latest" with React 16.8.x plus the overrides/resolutions block is a reasonable way to keep this scenario pinned on React 16 while tracking latest Recharts/TS. If any typings in this setup end up referencing react-dom directly, you may want to add @types/react-dom here as well; otherwise this can stay as-is.

Please verify via CI that the chosen ranges and overrides resolve cleanly with your current npm/Yarn version.

integrations/ts-skip-lib-check-false/package.json (1)

1-17: React 19 + latest Recharts/TS scenario is set up reasonably; optional types tweak

This package.json cleanly defines a “latest React” + “latest Recharts/TS” scenario for skipLibCheck=false. As with the React 16 project, consider adding @types/react-dom if any typings or code paths start depending on ReactDOM APIs; otherwise the current setup is fine for an integration test.

Given these ranges aim at the latest React line, please double-check that the resolved React/ReactDOM versions and Recharts peer deps line up with the React 19 release you want to target.

test-ui/server/scripts/NpmController.ts (1)

55-58: Parse error message is generic but acceptable

Switching to new Error("Failed to parse npm ls JSON output") is fine, though you might consider including a bit of the raw output in the error text if you need easier debugging later.

test-ui/server/server.ts (1)

238-251: Avoid "undefined" lines and lost context in verify output

If controller.verifySingleDependencyVersion returns a failing TestOutcome without an output (e.g. Yarn path where only error.message is set), this line will append "undefined\n" to testData.phases.verify.output, and the subsequent phase.output = result.output assignment will discard any previously accumulated per-dependency messages.

Consider normalizing per-dependency text before appending, and preserving it on failure, e.g.:

-  for (const dep of dependencies) {
+  for (const dep of dependencies) {
     try {
       const result = await controller.verifySingleDependencyVersion(dep);
-      testData.phases.verify.output += result.output + `\n`;
-      if (!result.success) {
-        return result; // Return early on first failure
-      }
+      const line =
+        result.output ??
+        (result.error instanceof Error
+          ? result.error.message
+          : String(result.error ?? dep));
+      testData.phases.verify.output += line + "\n";
+      if (!result.success) {
+        return TestOutcome.fail("verify", new Error(testData.phases.verify.output));
+      }
@@
-  return TestOutcome.ok("verify", testData.phases.verify.output);
+  return TestOutcome.ok("verify", testData.phases.verify.output);

This keeps the verify log readable and preserves context even when a dependency check fails.

test-ui/server/scripts/YarnController.ts (1)

108-173: Yarn dependency version verification logic is solid, but see verify aggregation note

Running yarn list --pattern ... --json, parsing stdout, and distinguishing “not found”, “no output”, zero/multiple versions, and success is a good approach. Returning TestOutcome.ok(dependencyName, message) ensures a human-readable line for successes.

As mentioned in the server comment, some fail paths construct plain Error objects without stdout/stderr, so result.output is undefined and the verify phase needs to normalize this when aggregating output.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 88a346e and a2adb66.

📒 Files selected for processing (14)
  • integrations/ts-react16-skip-lib-check-false/main.ts (1 hunks)
  • integrations/ts-react16-skip-lib-check-false/package.json (1 hunks)
  • integrations/ts-react16-skip-lib-check-false/tsconfig.json (1 hunks)
  • integrations/ts-skip-lib-check-false/main.ts (1 hunks)
  • integrations/ts-skip-lib-check-false/package.json (1 hunks)
  • integrations/ts-skip-lib-check-false/tsconfig.json (1 hunks)
  • test-ui/server/scripts/NpmController.ts (2 hunks)
  • test-ui/server/scripts/TestOutcome.ts (1 hunks)
  • test-ui/server/scripts/YarnController.ts (1 hunks)
  • test-ui/server/scripts/test-registry.ts (5 hunks)
  • test-ui/server/server.ts (4 hunks)
  • test-ui/src/App.css (1 hunks)
  • test-ui/src/App.tsx (1 hunks)
  • test-ui/src/types.ts (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: PavelVanecek
Repo: recharts/recharts-integ PR: 80
File: .github/workflows/integ.yml:57-57
Timestamp: 2025-11-30T04:39:58.861Z
Learning: In .github/workflows/integ.yml, Node.js version 22.18.x is the minimum required version because it enables built-in TypeScript type stripping by default, which is essential for the test-ui TypeScript/ESM implementation.
📚 Learning: 2025-11-30T04:39:58.861Z
Learnt from: PavelVanecek
Repo: recharts/recharts-integ PR: 80
File: .github/workflows/integ.yml:57-57
Timestamp: 2025-11-30T04:39:58.861Z
Learning: In .github/workflows/integ.yml, Node.js version 22.18.x is the minimum required version because it enables built-in TypeScript type stripping by default, which is essential for the test-ui TypeScript/ESM implementation.

Applied to files:

  • integrations/ts-skip-lib-check-false/tsconfig.json
  • test-ui/server/scripts/test-registry.ts
  • integrations/ts-react16-skip-lib-check-false/tsconfig.json
🧬 Code graph analysis (4)
test-ui/server/scripts/NpmController.ts (1)
test-ui/server/scripts/TestOutcome.ts (1)
  • TestOutcome (18-52)
test-ui/server/server.ts (1)
test-ui/server/scripts/TestOutcome.ts (1)
  • TestOutcome (18-52)
test-ui/server/scripts/YarnController.ts (2)
test-ui/server/scripts/Controller.ts (1)
  • execAsync (36-45)
test-ui/server/scripts/TestOutcome.ts (1)
  • TestOutcome (18-52)
test-ui/server/scripts/TestOutcome.ts (1)
scripts/run-everything.js (1)
  • output (14-31)
⏰ 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). (18)
  • GitHub Check: yarn:integrations/ts-react18 on node 25.x
  • GitHub Check: yarn:my-charts-react17:app-react16 on node 25.x
  • GitHub Check: yarn:integrations/ts-react19 on node 25.x
  • GitHub Check: yarn:integrations/ts-react16-resolutions on node 25.x
  • GitHub Check: npm:integrations/ts-react18 on node 25.x
  • GitHub Check: npm:my-charts-react18:app-react18 on node 25.x
  • GitHub Check: npm:my-charts-react18:app-react17 on node 25.x
  • GitHub Check: yarn:my-charts-react18:app-react18 on node 24.x
  • GitHub Check: npm:my-charts-react16:app-react16 on node 25.x
  • GitHub Check: npm:my-charts-react19:app-react18 on node 25.x
  • GitHub Check: yarn:my-charts-react17:app-react17 on node 24.x
  • GitHub Check: npm:integrations/ts-react19 on node 25.x
  • GitHub Check: npm:integrations/ts4-react17 on node 25.x
  • GitHub Check: yarn:my-charts-react19:app-react19 on node 24.x
  • GitHub Check: yarn:my-charts-react17:app-react16 on node 24.x
  • GitHub Check: npm:my-charts-react18:app-react17 on node 24.x
  • GitHub Check: npm:my-charts-react16:app-react16 on node 24.x
  • GitHub Check: npm:integrations/ts-react19 on node 24.x
🔇 Additional comments (22)
integrations/ts-react16-skip-lib-check-false/main.ts (1)

1-2: Minimal Recharts usage looks appropriate for this integration

Importing the namespace and logging it is enough to trigger type-checking and exercise the Recharts types without adding noise or extra surface area.

Please just confirm this pattern matches the other existing TS integration mains so the harness treats them consistently.

integrations/ts-react16-skip-lib-check-false/tsconfig.json (1)

1-16: tsconfig is consistent with the skipLibCheck=false React 16 scenario

Disabling skipLibCheck, using module: "ESNext" with moduleResolution: "bundler", and noEmit: true is a good fit for a pure type-check integration, and scoping to main.ts keeps the surface minimal.

Once wired into the runner, please confirm this config matches the other TS/React16 scenarios (aside from the deliberate skipLibCheck difference).

integrations/ts-skip-lib-check-false/main.ts (1)

1-2: Symmetric minimal entrypoint for the non-React16 scenario looks good

Mirroring the other integration with a simple namespace import and log keeps the scenario focused purely on type-checking Recharts under this config.

Please confirm the test harness discovers and runs this integration in the same way as the others.

integrations/ts-skip-lib-check-false/tsconfig.json (1)

1-16: Consistent tsconfig for the generic skipLibCheck=false project

The options (ES2020/ESNext, moduleResolution: "bundler", skipLibCheck: false, noEmit: true) mirror the React 16 variant and should give you a clean, focused lib-check scenario.

After wiring this into your matrix, please confirm CI runs tsc --noEmit here with the expected TS version.

test-ui/src/types.ts (1)

1-11: Test metadata extension looks consistent

Adding description?: string on Test aligns with server-side TestMetadata.description and UI usage in App.tsx. No issues from this change alone.

test-ui/src/App.css (1)

505-513: Description styling is appropriate and consistent

.test-description styling (grey, small, italic, ellipsis) fits the existing visual language and should work well in the flex header without layout issues.

test-ui/server/scripts/NpmController.ts (1)

93-97: Good: verify phase now receives structured success output

Returning TestOutcome.ok("verify", msg) provides the verify phase with a clear, single-version summary for npm, consistent with how the server consumes result.output.

test-ui/src/App.tsx (1)

232-236: Description rendering is correctly wired

test.description is rendered conditionally, uses the new .test-description class, and doubles as a tooltip via title={test.description}. This cleanly consumes the optional field with no impact on tests lacking a description.

test-ui/server/scripts/TestOutcome.ts (1)

36-38: TestOutcome.ok extension is coherent with callers

Allowing an optional output on ok matches how verify phases now pass human-readable summaries, while remaining compatible with existing ok("install")-style calls.

test-ui/server/scripts/test-registry.ts (5)

12-34: Server-side metadata now matches client Test description

Adding description?: string (with JSDoc) keeps the registry as the single source of truth and aligns with Test.description on the client and /api/tests payloads.


52-61: Helpful explanation for failing React 16 npm test

The multi-line description clearly documents why this test fails and links to remediation guidance. This should make the UI much more self-explanatory.


63-81: Descriptions for override/resolution tests are clear

The new descriptions succinctly document the npm overrides vs yarn resolutions strategies. This is useful context when scanning tests in the UI.


83-97: Stability flip for React 18/19 npm tests looks intentional

Marking npm:integrations/ts-react18 and ts-react19 as "stable" lines up with the PR description about promoting passing tests.


164-203: New skipLibCheck tests and descriptions are well structured

The four new tests (npm/yarn, with/without React16 + RTK2) and their descriptions are consistent with the naming scheme and clearly reference the linked issue.

test-ui/server/server.ts (2)

115-122: /api/tests now exposes descriptions end-to-end

Including description: metadata.description here correctly propagates registry descriptions to the client without changing existing fields.


183-186: Phase status/output mapping is straightforward

Using result.success and result.output to drive phase.status and phase.output matches the extended TestOutcome shape and keeps phase handling centralized.

test-ui/server/scripts/YarnController.ts (6)

28-32: Yarn clean behavior matches Controller expectations

Calling super.clean() then yarn cache clean and returning TestOutcome.ok("clean") is consistent with the npm controller’s semantics.


34-41: Yarn install error handling is fine

Wrapping yarn install in try/catch and mapping to TestOutcome.fail("install", e) aligns with how npm handles install failures.


43-77: Test script detection is sensible

Reading package.json and skipping yarn run test when there is no scripts.test matches npm’s --if-present behavior. Treating “no package.json” as a failure is also a reasonable signal for a misconfigured integration.


79-86: Build behavior mirrors npm controller

yarn run build mapped to TestOutcome.ok("build") / fail("build", e) keeps build semantics consistent across package managers.


175-207: parseYarnListOutput correctly handles scoped packages and recursion

Splitting on @, popping the version, and rejoining the rest covers scoped packages like @reduxjs/toolkit, and the recursive walk over children matches Yarn’s tree structure. Silently skipping malformed lines is reasonable for CLI output.


88-106: The review comment's premise is incorrect. Testing confirms that yarn pack --json outputs a single JSON object on one line, not multiple JSON objects per line. The current implementation using JSON.parse(trimmed) correctly handles yarn's actual output format. The suggested refactoring to parse line-by-line is unnecessary and would add complexity without solving any real problem.

Likely an incorrect or invalid review comment.

@PavelVanecek PavelVanecek merged commit 6f059b3 into main Dec 1, 2025
77 checks passed
@PavelVanecek PavelVanecek deleted the skiplibcheck branch December 1, 2025 01:58
This was referenced Dec 1, 2025
@coderabbitai coderabbitai bot mentioned this pull request Dec 23, 2025
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

Successfully merging this pull request may close these issues.

1 participant