perf(test): split cumulative suites across shards - #8320
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (11)
💤 Files with no reviewable changes (5)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughAdded shared advisor fixtures and replaced monolithic advisor and merge-gate test coverage with focused Vitest suites. The tests cover advisor normalization, provenance, rendering, coordinator evidence, PR state, Actions run selection, pagination, retries, and fail-closed validation. ChangesPR review advisor coverage
Maintainer merge-gate evidence
Estimated code review effort: 5 (Critical) | ~120 minutes Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (3)
test/pr-review-advisor-context.test.ts (1)
4-39: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winRemove unused imports from the split test files.
The copied import blocks load unused modules and obscure each file's scope.
test/pr-review-advisor-context.test.ts: removeAjv2020,buildRiskPlan, the session imports,normalizeReviewResult,readTrustedSecurityReviewSkill,recordSynthesisValidationFailureOnDraft,renderDetailedReview,renderSummary,reviewLedgerConsistencyIssues,reviewQualityIssues,buildComment, andtestTimeoutOptions.test/pr-review-advisor-normalization.test.ts: removefs,tmpdir,Ajv2020, the GitHub imports, and the unusedanalyze.mtsimports.test/pr-review-advisor-quality.test.ts: removetmpdir,Ajv2020, the GitHub, session, andbuildRiskPlanimports, the unusedanalyze.mtsimports, andtestTimeoutOptions.test/pr-review-advisor-rendering.test.ts: removefs,tmpdir, the GitHub, session, andbuildRiskPlanimports, the unusedanalyze.mtsimports, andtestTimeoutOptions.🤖 Prompt for 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. In `@test/pr-review-advisor-context.test.ts` around lines 4 - 39, Remove the listed unused imports from the split test files: in test/pr-review-advisor-context.test.ts lines 4-39 remove Ajv2020, buildRiskPlan, the session imports, the specified analyze.mts symbols, buildComment, and testTimeoutOptions; apply the corresponding removals in test/pr-review-advisor-normalization.test.ts lines 4-39, test/pr-review-advisor-quality.test.ts lines 4-39, and test/pr-review-advisor-rendering.test.ts lines 4-43 for their unused filesystem, GitHub, session, risk-plan, analyze.mts, Ajv2020, and timeout imports, leaving each file scoped only to symbols it uses.test/skills/check-gates-run-selection-evidence.test.ts (1)
28-142: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winSplit this test so each title matches one claim.
The title describes cancellation of a later metadata-only run. The body then asserts two more independent behaviors: rejection of an invalid job shape (Line 82) and rejection of an unexpected job (Line 113). A failure in the second or third block reports the first title. The split of this suite is a good moment to separate the three scenarios into three
itblocks or oneit.eachmatrix.🤖 Prompt for 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. In `@test/skills/check-gates-run-selection-evidence.test.ts` around lines 28 - 142, Split the test into three independently named cases: the canceled later metadata-only run, the incomplete latest-attempt job shape, and the unexpected-job rejection. Move each corresponding runGate setup and assertions into its own it block (or use an it.each matrix), ensuring each title describes only the behavior it verifies.test/skills/check-gates-coordinator-seed-evidence.test.ts (1)
17-33: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winUnused imports remain in every split file. The split copied the monolithic import block into each new file without trimming it to the symbols each file actually uses. If the CLI or plugin type-check config enables
noUnusedLocals, or if lint runs on these paths, the build fails.
test/skills/check-gates-coordinator-seed-evidence.test.ts#L17-L33: removeHEAD_SHA,runGate,successfulRequiredChecks, and the typesActionRunFixture,ComplianceFixture,CoordinatorRunPartitionFixture.test/skills/check-gates-run-selection-evidence.test.ts#L5-L25: removeBASE_SHA,coordinationCheck,E2E_COORDINATION_EXTERNAL_ID,installerHashRun,REQUIRED_CHECK_NAMES,successfulRequiredChecksWithoutE2e.test/skills/check-gates-actions-evidence.test.ts#L5-L25: removecoordinationCheck,E2E_COORDINATION_EXTERNAL_ID,installerHashRun,prWorkflowJobs,prWorkflowRun, and the typeActionRunFixture.test/skills/check-gates-pr-state-evidence.test.ts#L5-L25: removeCUSTOM_RUN_URL,e2eChecks,e2eJobs,e2eRunFixture,INCOMPLETE_E2E,prWorkflowJobs,REQUIRED_CHECK_NAMES, and the typesActionJobFixtureandActionRunFixture.test/skills/check-gates-coordinator-rejection-evidence.test.ts#L13-L29: removecoordinationCheck,e2eManualCoordinatorRun,exactDiffGateRun,prWorkflowRun,runGate,successfulRequiredChecks, and the four imported types.test/skills/check-gates-coordinator-final-evidence.test.ts#L12-L28: removeBASE_SHA,HEAD_SHA,e2eManualCoordinatorRun,exactDiffGateRun,prWorkflowRun,runGate,successfulRequiredChecks, and the four imported types.test/skills/check-gates-coordinator-test-fixtures.ts#L4-L4: remove the wholevitestimport; this module exports fixtures only.As per coding guidelines: "Keep TypeScript implementation and test code compatible with the repository CLI and plugin type-check configurations."
🤖 Prompt for 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. In `@test/skills/check-gates-coordinator-seed-evidence.test.ts` around lines 17 - 33, Trim each split test file's imports to only the symbols it uses: in test/skills/check-gates-coordinator-seed-evidence.test.ts#L17-L33 remove HEAD_SHA, runGate, successfulRequiredChecks, ActionRunFixture, ComplianceFixture, and CoordinatorRunPartitionFixture; in test/skills/check-gates-run-selection-evidence.test.ts#L5-L25 remove BASE_SHA, coordinationCheck, E2E_COORDINATION_EXTERNAL_ID, installerHashRun, REQUIRED_CHECK_NAMES, and successfulRequiredChecksWithoutE2e; in test/skills/check-gates-actions-evidence.test.ts#L5-L25 remove coordinationCheck, E2E_COORDINATION_EXTERNAL_ID, installerHashRun, prWorkflowJobs, prWorkflowRun, and ActionRunFixture; in test/skills/check-gates-pr-state-evidence.test.ts#L5-L25 remove CUSTOM_RUN_URL, e2eChecks, e2eJobs, e2eRunFixture, INCOMPLETE_E2E, prWorkflowJobs, REQUIRED_CHECK_NAMES, ActionJobFixture, and ActionRunFixture; in test/skills/check-gates-coordinator-rejection-evidence.test.ts#L13-L29 remove coordinationCheck, e2eManualCoordinatorRun, exactDiffGateRun, prWorkflowRun, runGate, successfulRequiredChecks, and all four imported types; in test/skills/check-gates-coordinator-final-evidence.test.ts#L12-L28 remove BASE_SHA, HEAD_SHA, e2eManualCoordinatorRun, exactDiffGateRun, prWorkflowRun, runGate, successfulRequiredChecks, and all four imported types; and remove the entire vitest import from test/skills/check-gates-coordinator-test-fixtures.ts#L4-L4.Source: Coding guidelines
🤖 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.
Nitpick comments:
In `@test/pr-review-advisor-context.test.ts`:
- Around line 4-39: Remove the listed unused imports from the split test files:
in test/pr-review-advisor-context.test.ts lines 4-39 remove Ajv2020,
buildRiskPlan, the session imports, the specified analyze.mts symbols,
buildComment, and testTimeoutOptions; apply the corresponding removals in
test/pr-review-advisor-normalization.test.ts lines 4-39,
test/pr-review-advisor-quality.test.ts lines 4-39, and
test/pr-review-advisor-rendering.test.ts lines 4-43 for their unused filesystem,
GitHub, session, risk-plan, analyze.mts, Ajv2020, and timeout imports, leaving
each file scoped only to symbols it uses.
In `@test/skills/check-gates-coordinator-seed-evidence.test.ts`:
- Around line 17-33: Trim each split test file's imports to only the symbols it
uses: in test/skills/check-gates-coordinator-seed-evidence.test.ts#L17-L33
remove HEAD_SHA, runGate, successfulRequiredChecks, ActionRunFixture,
ComplianceFixture, and CoordinatorRunPartitionFixture; in
test/skills/check-gates-run-selection-evidence.test.ts#L5-L25 remove BASE_SHA,
coordinationCheck, E2E_COORDINATION_EXTERNAL_ID, installerHashRun,
REQUIRED_CHECK_NAMES, and successfulRequiredChecksWithoutE2e; in
test/skills/check-gates-actions-evidence.test.ts#L5-L25 remove
coordinationCheck, E2E_COORDINATION_EXTERNAL_ID, installerHashRun,
prWorkflowJobs, prWorkflowRun, and ActionRunFixture; in
test/skills/check-gates-pr-state-evidence.test.ts#L5-L25 remove CUSTOM_RUN_URL,
e2eChecks, e2eJobs, e2eRunFixture, INCOMPLETE_E2E, prWorkflowJobs,
REQUIRED_CHECK_NAMES, ActionJobFixture, and ActionRunFixture; in
test/skills/check-gates-coordinator-rejection-evidence.test.ts#L13-L29 remove
coordinationCheck, e2eManualCoordinatorRun, exactDiffGateRun, prWorkflowRun,
runGate, successfulRequiredChecks, and all four imported types; in
test/skills/check-gates-coordinator-final-evidence.test.ts#L12-L28 remove
BASE_SHA, HEAD_SHA, e2eManualCoordinatorRun, exactDiffGateRun, prWorkflowRun,
runGate, successfulRequiredChecks, and all four imported types; and remove the
entire vitest import from
test/skills/check-gates-coordinator-test-fixtures.ts#L4-L4.
In `@test/skills/check-gates-run-selection-evidence.test.ts`:
- Around line 28-142: Split the test into three independently named cases: the
canceled later metadata-only run, the incomplete latest-attempt job shape, and
the unexpected-job rejection. Move each corresponding runGate setup and
assertions into its own it block (or use an it.each matrix), ensuring each title
describes only the behavior it verifies.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 460fcfda-010b-4264-a9f9-e5dfa51eff89
📒 Files selected for processing (15)
test/helpers/pr-review-advisor-test-fixtures.tstest/pr-review-advisor-context.test.tstest/pr-review-advisor-normalization.test.tstest/pr-review-advisor-quality.test.tstest/pr-review-advisor-rendering.test.tstest/pr-review-advisor.test.tstest/skills/check-gates-actions-evidence.test.tstest/skills/check-gates-coordinator-evidence.test.tstest/skills/check-gates-coordinator-final-evidence.test.tstest/skills/check-gates-coordinator-rejection-evidence.test.tstest/skills/check-gates-coordinator-seed-evidence.test.tstest/skills/check-gates-coordinator-test-fixtures.tstest/skills/check-gates-evidence.test.tstest/skills/check-gates-pr-state-evidence.test.tstest/skills/check-gates-run-selection-evidence.test.ts
💤 Files with no reviewable changes (3)
- test/skills/check-gates-evidence.test.ts
- test/pr-review-advisor.test.ts
- test/skills/check-gates-coordinator-evidence.test.ts
PR Review Advisor — No blocking findings reportedAdvisor assessment: No blocking advisor findings reported Model lanes
Second-opinion terminology and E2E selections are advisory. They do not change the primary assessment or E2E / PR Gate. 2 semantic terminology decisionsTerminology decisions are advisory. They affect the assessment only when a separate finding identifies concrete semantic impact.
E2E guidanceAdvisory only. E2E / PR Gate selects and runs jobs independently. Recommended E2E: None This automated review informs maintainers. Warnings and suggestions do not require a response. A maintainer decides whether to merge. |
There was a problem hiding this comment.
CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
<!-- markdownlint-disable MD041 --> ## Summary Merged PR #8320 deleted `test/pr-review-advisor.test.ts`, but its CLI sharding timing hint remained. Remove the obsolete entry so the timing manifest references only existing test files. ## Changes - Remove the timing hint for the deleted monolithic PR Review Advisor test file. - Keep the split advisor tests on the conservative default timing until CI produces replacement measurements. ## Type of Change - [x] Code change (feature, bug fix, or refactor) - [ ] Code change with doc updates - [ ] Doc only (prose changes, no code sample modifications) - [ ] Doc only (includes code sample changes) ## Quality Gates - [x] Tests added or updated for changed behavior - [ ] Existing tests cover changed behavior — justification: - [ ] Tests not applicable — justification: - [ ] Docs updated for user-facing behavior changes - [x] Docs not applicable — justification: This changes CI-only test-sharding data. - [ ] Sensitive paths changed (security, policy, credentials, preflight, onboarding, inference, runner, sandbox, or messaging) - [ ] Sensitive-path review completed or maintainer-approved waiver recorded — reviewer/approval link/justification: - [ ] Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue: ## Documentation Writer Review - [x] Documentation writer subagent reviewed the completed changes - Result: `no-docs-needed` - Evidence: The change removes an obsolete path from CI-only timing data and does not affect user-visible behavior. - Agent: Pi CLI <!-- docs-review-head-sha: 33d5526 --> <!-- docs-review-agents-blob-sha: 3dd7c24 --> ## DGX Station Hardware Evidence - [ ] Tested on DGX Station - Tested commit: - Station profile/scenario: - Result: - Supporting evidence: ## Verification - [x] PR description includes a `Signed-off-by:` line and every commit appears as `Verified` in GitHub - [x] Normal `pre-commit`, `commit-msg`, and `pre-push` hooks passed, or `npm run validate:pr` passed after refreshing `origin/main` when hooks were skipped or unavailable - [x] Targeted behavior tests pass for the current change set, or tests are marked not applicable above — `npx vitest run --project integration test/cli-coverage-sequencer.test.ts` (8 passed) - [ ] Applicable broad gate passed — `npm test` for broad runtime/test-harness changes; `npm run check` for repo-wide validation/coverage changes - [x] Quality Gates section completed with required justifications or waivers - [x] No secrets, API keys, or credentials committed - [ ] `npm run docs` builds without warnings (doc changes only) - [ ] Doc pages follow the [style guide](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md) (doc changes only) - [ ] New doc pages include SPDX header and frontmatter (new pages only) --- Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Summary
Three cumulative-cost integration test files were atomic Vitest shard inputs with recent CI medians of 63–84 seconds. Their behavior groups now live in separate test files with shared fixtures, allowing Vitest to distribute them across CLI shards.
Changes
Type of Change
Quality Gates
Documentation Writer Review
no-docs-neededDGX Station Hardware Evidence
Verification
Signed-off-by:line and every commit appears asVerifiedin GitHubpre-commit,commit-msg, andpre-pushhooks passed, ornpm run validate:prpassed after refreshingorigin/mainwhen hooks were skipped or unavailablenpm testfor broad runtime/test-harness changes;npm run checkfor repo-wide validation/coverage changesnpm run docsbuilds without warnings (doc changes only)Signed-off-by: Carlos Villela cvillela@nvidia.com
Summary by CodeRabbit