test(e2e): discover live scenarios from registry#5005
Conversation
📝 WalkthroughWalkthroughThis PR introduces infrastructure for live Vitest registry discovery by adding a runtime support gating module, dynamic test registration for supported scenarios, and validation tests that ensure proper support classification across all e2e scenarios. ChangesLive e2e Discovery Test Infrastructure
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Suggested labels
Suggested reviewers
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 docstrings
🧪 Generate unit tests (beta)
Comment |
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. |
E2E Advisor RecommendationRequired E2E: None Dispatch hint: Full advisor summaryE2E Recommendation AdvisorBase: Required E2E
Optional E2E
New E2E recommendations
Dispatch hint
|
E2E Scenario Advisor RecommendationRequired scenario E2E: Dispatch required scenario E2E:
Full scenario advisor summaryE2E Scenario AdvisorBase: Required scenario E2E
Optional scenario E2E
Relevant changed files
|
Stack PRs 4941/4990 stack-01/02/03 were squash-merged into main as #5003, #5004, #5035; merging main resolves the resulting add/add and content conflicts by taking main's versions for already-merged files. Only the 3 new files from 93fb874 remain: runtime-support.ts, registry-scenarios.test.ts, and e2e-live-registry-discovery.test.ts. Signed-off-by: Julie Yaunches <jyaunches@nvidia.com>
|
@coderabbitai review |
✅ Action performedReview finished.
|
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 `@test/e2e-scenario/live/registry-scenarios.test.ts`:
- Around line 46-50: The artifact currently records the resolved validation
state (validation.state.id) as expectedStateId; change the payload passed to
artifacts.writeJson so expectedStateId uses scenario.expectedStateId instead,
and (optionally) add an actualStateId field set to validation.state.id to keep
both expected and resolved states. Update the object passed in the call to
artifacts.writeJson (the block that includes scenario.id, expectedStateId,
probes, pendingRuntimeSuites) to replace validation.state.id with
scenario.expectedStateId and add actualStateId: validation.state.id if you want
to preserve the resolved value.
🪄 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: b85c34a1-aaf3-460d-b1ad-bfb19fcfa6c4
📒 Files selected for processing (3)
test/e2e-scenario/framework-tests/e2e-live-registry-discovery.test.tstest/e2e-scenario/live/registry-scenarios.test.tstest/e2e-scenario/scenarios/runtime-support.ts
| await artifacts.writeJson("scenario-result.json", { | ||
| id: scenario.id, | ||
| expectedStateId: validation.state.id, | ||
| probes: validation.probes.map((probe) => probe.id), | ||
| pendingRuntimeSuites: support.pendingRuntimeSuites, |
There was a problem hiding this comment.
Persist the expected state from the scenario contract, not the resolved validation state.
scenario-result.json currently records expectedStateId from validation.state.id (actual resolved state). This makes artifact metadata misleading. Store scenario.expectedStateId as expected, and optionally add a separate actualStateId.
Suggested fix
await artifacts.writeJson("scenario-result.json", {
id: scenario.id,
- expectedStateId: validation.state.id,
+ expectedStateId: scenario.expectedStateId,
+ actualStateId: validation.state.id,
probes: validation.probes.map((probe) => probe.id),
pendingRuntimeSuites: support.pendingRuntimeSuites,
});📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| await artifacts.writeJson("scenario-result.json", { | |
| id: scenario.id, | |
| expectedStateId: validation.state.id, | |
| probes: validation.probes.map((probe) => probe.id), | |
| pendingRuntimeSuites: support.pendingRuntimeSuites, | |
| await artifacts.writeJson("scenario-result.json", { | |
| id: scenario.id, | |
| expectedStateId: scenario.expectedStateId, | |
| actualStateId: validation.state.id, | |
| probes: validation.probes.map((probe) => probe.id), | |
| pendingRuntimeSuites: support.pendingRuntimeSuites, |
🤖 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/e2e-scenario/live/registry-scenarios.test.ts` around lines 46 - 50, The
artifact currently records the resolved validation state (validation.state.id)
as expectedStateId; change the payload passed to artifacts.writeJson so
expectedStateId uses scenario.expectedStateId instead, and (optionally) add an
actualStateId field set to validation.state.id to keep both expected and
resolved states. Update the object passed in the call to artifacts.writeJson
(the block that includes scenario.id, expectedStateId, probes,
pendingRuntimeSuites) to replace validation.state.id with
scenario.expectedStateId and add actualStateId: validation.state.id if you want
to preserve the resolved value.
Resolves divergence with parent stack PRs (#5002, #5003, #5004, #5005) already merged into main, plus #5022 and #5035 refinements. Conflict resolution prefers main's canonical phase-fixture and framework-plumbing files (those have already received post-#5005 refactors), and re-applies this PR's unique deltas on top: - liveScenarioTestName() helper in runtime-support.ts - Skip-name realignment + module-load [not wired] log in registry-scenarios.test.ts - New e2e-live-skip-name-contract framework test Net effect of this PR vs main is the matrix fan-out workflow, --emit-live-matrix CLI, workflow boundary updates, and the filter-alignment fix. See `git diff origin/main` for the full delta. Co-authored-by: Julie Yaunches <jyaunches@nvidia.com>
Summary
Adds registry-driven live Vitest scenario discovery so typed scenarios automatically appear as live tests. Supported scenarios run through environment, onboarding, and state-validation fixtures; unsupported scenarios are registered as skipped tests with explicit wiring reasons.
Related Issue
Refs #4941
Refs #4990
Changes
liveScenarioSupport(...)metadata for currently fixture-supported live scenarios.test/e2e-scenario/live/registry-scenarios.test.tsto generate one live Vitest test per typed registry scenario.Type of Change
Verification
npx prek run --all-filespassesnpm testpassesnpm run docsbuilds without warnings (doc changes only)Signed-off-by: Carlos Villela cvillela@nvidia.com
Summary by CodeRabbit