test(e2e): migrate Hermes inference switch to vitest#5553
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:
📝 WalkthroughWalkthroughA new live Vitest E2E test validates that switching Hermes inference provider and model updates routing and configuration while preserving the gateway process PID and .env contents. The test is integrated into the CI workflow as a ChangesHermes Inference Switch E2E
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
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 |
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 Dispatch hint: Full advisor summaryE2E Recommendation AdvisorBase: Required E2E
Optional E2E
New E2E recommendations
Dispatch hint
|
Vitest E2E Scenario RecommendationRequired Vitest E2E scenarios: Dispatch required Vitest E2E scenarios:
Full Vitest E2E advisor summaryVitest E2E Scenario AdvisorBase: Required Vitest E2E scenarios
Optional Vitest E2E scenarios
Relevant changed files
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.github/workflows/e2e-vitest-scenarios.yaml (1)
745-792: ⚡ Quick winConsider adding Docker Hub authentication to avoid rate limiting.
The
hermes-inference-switch-vitestjob pulls Docker images duringinstall.shbut lacks Docker Hub authentication, unlike similar jobs such asissue-2478-crash-loop-recovery-vitest(lines 3537-3566). Anonymous Docker Hub pulls are subject to rate limiting, which could cause intermittent CI failures.If Hermes image pulls are expected to hit Docker Hub, consider adding the same Docker auth pattern used by other Docker-dependent jobs in this workflow.
🤖 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 @.github/workflows/e2e-vitest-scenarios.yaml around lines 745 - 792, The hermes-inference-switch-vitest job is missing Docker Hub authentication credentials, which could lead to rate limiting failures when pulling Docker images during the Install OpenShell CLI step. Add a new step before the "Install OpenShell CLI" step that authenticates to Docker Hub using GitHub secrets (similar to the pattern used in the issue-2478-crash-loop-recovery-vitest job). This step should log in to Docker Hub with appropriate credentials to prevent anonymous pull rate limiting issues.
🤖 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 @.github/workflows/e2e-vitest-scenarios.yaml:
- Around line 745-792: The hermes-inference-switch-vitest job is missing Docker
Hub authentication credentials, which could lead to rate limiting failures when
pulling Docker images during the Install OpenShell CLI step. Add a new step
before the "Install OpenShell CLI" step that authenticates to Docker Hub using
GitHub secrets (similar to the pattern used in the
issue-2478-crash-loop-recovery-vitest job). This step should log in to Docker
Hub with appropriate credentials to prevent anonymous pull rate limiting issues.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 1d11cc31-1634-4f4a-a5d4-c2f71a7bc123
📒 Files selected for processing (2)
.github/workflows/e2e-vitest-scenarios.yamltest/e2e-scenario/live/hermes-inference-switch.test.ts
PR Review AdvisorFindings: 0 needs attention, 8 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: 2
🤖 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/hermes-inference-switch.test.ts`:
- Around line 271-279: The inferenceLocalPayload and curl request are hardcoded
to use the OpenAI Chat Completions format with /v1/chat/completions endpoint,
but the test validates both anthropic-messages and openai-responses configs.
Build the probe request dynamically based on the SWITCH_API configuration being
tested instead of using a hardcoded OpenAI format, or restrict this probe to
only execute against chat-completions compatible configs to ensure the test
validates the correct endpoint and payload format for each supported switch
mode.
- Line 226: The assertion using toMatch() on model.api_key can expose the actual
API key value in test output when the assertion fails. Replace the toMatch()
assertion with a boolean predicate that checks if the API key matches the
pattern (such as using a regex test method) and assert the resulting boolean
value instead, so only true or false is printed in failed assertions rather than
the secret key itself.
🪄 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: ee870947-11fa-479a-bd1f-9aee2ee1dba5
📒 Files selected for processing (1)
test/e2e-scenario/live/hermes-inference-switch.test.ts
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
…es-inference-switch Signed-off-by: Carlos Villela <cvillela@nvidia.com>
…es-inference-switch Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
…e-switch' into e2e-migrate/test-hermes-inference-switch Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
…es-inference-switch Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Summary
Migrates the Hermes inference switch E2E into a typed live Vitest scenario. The new test onboards a real Hermes sandbox, switches the inference route, verifies OpenShell route state plus Hermes config/registry state, and sends a live Hermes API chat after the switch.
Related Issue
Refs #5098
Changes
test/e2e/test-hermes-inference-switch.sh..github/workflows/e2e-vitest-scenarios.yaml.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)Targeted commands run:
npx biome check --write test/e2e-scenario/live/hermes-inference-switch.test.tsNEMOCLAW_RUN_E2E_SCENARIOS=1 npx vitest run --project e2e-scenarios-live test/e2e-scenario/live/hermes-inference-switch.test.ts -t __compile_only_nomatch__ --silent=false --reporter=default --passWithNoTestsnpx vitest run --project e2e-vitest-support test/e2e-scenario/support-tests/e2e-scenarios-workflow.test.tsnpx tsx scripts/check-test-file-size-budget.ts test/e2e-scenario/live/hermes-inference-switch.test.tsnpx tsc --noEmit --strict --moduleResolution bundler --module preserve --target ES2022 --types node --allowImportingTsExtensions test/e2e-scenario/live/hermes-inference-switch.test.tsgit diff --checkSigned-off-by: Carlos Villela cvillela@nvidia.com
Summary by CodeRabbit
.envand sandbox/session metadata, checks config hash files/permissions, and probes chat-completions on both external and local endpoints.