Skip to content

test: replace next 300 explicit test loops - #9381

Merged
cv merged 2 commits into
mainfrom
codex/convert-test-loops-tenth
Aug 18, 2026
Merged

test: replace next 300 explicit test loops#9381
cv merged 2 commits into
mainfrom
codex/convert-test-loops-tenth

Conversation

@cv

@cv cv commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

Replaces the next 300 explicit test loops with parameterized cases or direct collection iteration. Input-driven validation now reports one case per row, while setup, cleanup, and runtime-output checks retain their single-scenario behavior.

Changes

  • Convert three input-driven validation groups to it.each with behavior-oriented titles.
  • Replace 297 synchronous setup, cleanup, and output-check loops with direct collection callbacks.
  • Reduce the explicit test-loop count from 443 to 143 without adding Array.from or Boolean aggregate assertions.

Type of Change

  • 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

  • Tests added or updated for changed behavior
  • Existing tests cover changed behavior — justification: This is a behavior-preserving test refactor; the converted tests continue to exercise the same paths and assertions.
  • Tests not applicable — justification:
  • 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: Test-only changes preserve assertions and scenario sequencing; the independent documentation-writer review of the exact commit passed with no findings.
  • Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue:

DGX Station Hardware Evidence

  • Tested on DGX Station
  • Tested commit:
  • Station profile/scenario:
  • Result:
  • Supporting evidence:

Verification

  • PR description includes a Signed-off-by: line and every commit appears as Verified in GitHub
  • 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
  • Targeted behavior tests pass for the current change set, or tests are marked not applicable above — command/result or justification: npm run test:changed passed 2,493 tests across 87 files; changed integration and package-contract projects passed 2,309 tests with 5 skipped; the final title correction passed its 25-test focused suite and the title-style check.
  • Applicable broad gate passed — npm test for broad runtime/test-harness changes; npm run check for repo-wide validation/coverage changes — command/result: Not applicable because runtime and test-harness behavior did not change.
  • Quality Gates section completed with required justifications or waivers
  • No secrets, API keys, or credentials committed
  • npm run docs builds without warnings (doc changes only)
  • Doc pages follow the style guide (doc changes only)
  • New doc pages include SPDX header and frontmatter (new pages only)

Signed-off-by: Carlos Villela cvillela@nvidia.com

Summary by CodeRabbit

  • Tests
    • Standardized test iteration and cleanup patterns across the test suite.
    • Preserved existing assertions, coverage, ordering, and observable behavior.
    • Expanded readiness validation to cover all policy and provider failure states.
    • Added clearer separate coverage for invalid provider and model selections.
    • Improved parameterized testing for sandbox probing and runtime identity validation.

Signed-off-by: Carlos Villela <cvillela@nvidia.com>
@cv cv self-assigned this Aug 18, 2026
@coderabbitai

coderabbitai Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 3dccfdc2-1570-40c3-822e-3ccc6b2e86e3

📥 Commits

Reviewing files that changed from the base of the PR and between 91ebd37 and 6be6637.

📒 Files selected for processing (5)
  • test/e2e/support/e2e-workflow.test.ts
  • test/e2e/support/workflow-plan.test.ts
  • test/effective-policy-contracts.test.ts
  • test/onboard-policy-suggestions.test.ts
  • test/personal-open-internet-policy.test.ts
🚧 Files skipped from review as they are similar to previous changes (4)
  • test/onboard-policy-suggestions.test.ts
  • test/e2e/support/workflow-plan.test.ts
  • test/e2e/support/e2e-workflow.test.ts
  • test/effective-policy-contracts.test.ts

Included review availability: Your plan includes up to 12 reviews per rolling hour; 11 remain after this review.


📝 Walkthrough

Walkthrough

The pull request replaces test-only for...of loops with forEach iterations across command, library, and end-to-end suites. It also parameterizes readiness failure cases and adds selector validation coverage.

Changes

Test iteration normalization

Layer / File(s) Summary
Loop conversion across test suites
src/**/*.test.ts, test/**/*.test.ts
Test setup, cleanup, fixture creation, and assertions now use forEach. Inputs, ordering, assertions, and observable behavior remain unchanged.
Readiness and selector coverage
src/lib/actions/sandbox/mcp-bridge-resolution-probe.test.ts, src/lib/cua/runtime-readiness.test.ts
Readiness failures use parameterized cases. Runtime-readiness tests separately cover invalid provider and model selectors, including credential-like, URL-like, host-like, delimiter, and non-printable values.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 6be66

This change reorganizes existing tests without changing product or runtime behavior, and the reported validation passes. No actionable merge-blocking risk remains beyond normal checks and review.

🚥 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 primary change: replacing 300 explicit test loops.
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.
✨ 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 codex/convert-test-loops-tenth

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

@github-code-quality

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall coverage in commit 91ebd37 in the codex/convert-test-l... branch remains at 96%, unchanged from commit c2a7292 in the main branch.

@copy-pr-bot

copy-pr-bot Bot commented Aug 18, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@rsliter

rsliter commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

💅 also so close to a negative line change!!!!

@cv
cv merged commit fb01aff into main Aug 18, 2026
22 checks passed
@cv
cv deleted the codex/convert-test-loops-tenth branch August 18, 2026 02:14
@github-actions github-actions Bot added the v0.0.110 Release target label Aug 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v0.0.110 Release target

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants