ci(test): ratchet test conditional growth#5558
Conversation
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds a test-conditionals enforcement system consisting of: a TypeScript AST scanner script that detects and scores ChangesTest-conditionals guardrail
E2E test housekeeping
Estimated code review effort🎯 4 (Complex) | ⏱️ ~65 minutes Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
🌿 Preview your docs: https://nvidia-preview-pr-5558.docs.buildwithfern.com/nemoclaw |
Code Coverage OverviewLanguages: TypeScript TypeScript / code-coverage/pluginThe overall coverage in the branch is 96%. Coverage data for the branch is not yet available. Show a code coverage summary of the most covered files.
TypeScript / code-coverage/cliThe overall coverage in the branch is 46%. Coverage data for the branch is not yet available. Show a code coverage summary of the most covered files.
Updated |
E2E Advisor RecommendationRequired E2E: None Full advisor summaryE2E Recommendation AdvisorBase: Required E2E
Optional E2E
New E2E recommendations
|
Vitest E2E Scenario RecommendationRequired Vitest E2E scenarios: None Full Vitest E2E advisor summaryVitest E2E Scenario AdvisorBase: Required Vitest E2E scenarios
Optional Vitest E2E scenarios
Relevant changed files
|
PR Review AdvisorFindings: 0 needs attention, 2 worth checking, 0 nice ideas Review findings🛠️ Needs attention
🔎 Worth checking
🌱 Nice ideas
Consider writing more tests for
Since last review detailsCurrent findings:
This is an automated advisory review. A human maintainer must make the final merge decision. |
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@scripts/find-test-conditionals.ts`:
- Around line 113-117: The scriptKindFor function currently returns
ts.ScriptKind.JS for JSX files, which causes JSX syntax to be misparsed as
comparison operators. Add a new conditional check in the scriptKindFor function
that specifically detects JSX file extensions (such as .jsx, .mjsx, .cjsx) and
returns ts.ScriptKind.JSX for these files. Place this check before the existing
JS check that matches /\.[cm]?jsx?$/i to ensure JSX files are correctly
identified and parsed with the appropriate ScriptKind.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 26dc3384-c089-4fe5-b304-a34d22bcaa2f
📒 Files selected for processing (4)
.github/workflows/codebase-growth-guardrails.yamlpackage.jsonscripts/find-test-conditionals.tstest/test-conditionals-scanner.test.ts
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Summary
Adds a local test-conditional scanner and hooks a net-new
ifratchet into the existing codebase growth guardrail workflow. This keeps current test branching debt visible while blocking changed test files from adding more conditional complexity.Changes
scripts/find-test-conditionals.tsto report and scoreifstatements in test/spec files.npm run test-conditionals:scanand focused scanner unit coverage..github/workflows/codebase-growth-guardrails.yamlwith a data-only pull_request_target check that rejects net-newifstatements in changed test files.Type of Change
Verification
Verifiedin GitHubnpx prek run --from-ref main --to-ref HEADpassesnpm testpasses (broad runtime changes only)npm run docsbuilds without warnings (doc changes only)Signed-off-by: Carlos Villela cvillela@nvidia.com
Summary by CodeRabbit
Release Notes
ifusage in changed test/spec files between the PR base and head, failing the build if it increases.