Fix SSE endpoint rewrite E2E tests using nonexistent flags#4080
Merged
ChrisJBurns merged 1 commit intomainfrom Mar 11, 2026
Merged
Fix SSE endpoint rewrite E2E tests using nonexistent flags#4080ChrisJBurns merged 1 commit intomainfrom
ChrisJBurns merged 1 commit intomainfrom
Conversation
The SSE endpoint rewrite tests were orphaned from CI until #4074 rebalanced the E2E buckets. Now that they run, all 4 fail: - 3 tests used `--remote-url` which is not a CLI flag; the URL should be passed as the positional argument (the run command auto-detects URLs and treats them as remote servers). - 1 test used `thv list --registry` which is not valid; the correct invocation is `thv registry list`. Both flags were silently ignored because Cobra's UnknownFlags whitelist is enabled on the run command, causing the "requires at least 1 arg" error. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
reyortiz3
approved these changes
Mar 11, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4080 +/- ##
==========================================
+ Coverage 68.50% 68.55% +0.05%
==========================================
Files 447 447
Lines 45663 45663
==========================================
+ Hits 31281 31305 +24
+ Misses 11964 11940 -24
Partials 2418 2418 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
JAORMX
added a commit
that referenced
this pull request
Mar 11, 2026
These SSE endpoint rewrite tests were orphaned from CI until the matrix rebalance (#4074), then had stale flags fixed (#4080), but have never actually passed. Four root causes are addressed: 1. GenerateMCPServerURL omits /sse for remote SSE URLs with empty path, causing waitForInitializeSuccess to GET / instead of /sse (404). 2. getSSERewriteConfig reads X-Forwarded-* from the outbound request which has auto-injected headers from SetXForwarded(), converting relative endpoint URLs into absolute ones with the proxy's own host. 3. Test 3 mock server lacks a 404 fallback for non-/sse paths. 4. Test 4 (OSV + endpoint-prefix) fails due to #3372; skip it. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
3 tasks
aponcedeleonch
pushed a commit
that referenced
this pull request
Mar 11, 2026
Fix deterministic E2E proxy SSE endpoint rewrite test failures These SSE endpoint rewrite tests were orphaned from CI until the matrix rebalance (#4074), then had stale flags fixed (#4080), but have never actually passed. Four root causes are addressed: 1. GenerateMCPServerURL omits /sse for remote SSE URLs with empty path, causing waitForInitializeSuccess to GET / instead of /sse (404). 2. getSSERewriteConfig reads X-Forwarded-* from the outbound request which has auto-injected headers from SetXForwarded(), converting relative endpoint URLs into absolute ones with the proxy's own host. 3. Test 3 mock server lacks a 404 fallback for non-/sse paths. 4. Test 4 (OSV + endpoint-prefix) fails due to #3372; skip it. Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
proxybucket. Now that they run, all 4 tests fail because they invokethvwith flags that don't exist.--remote-url <url>(not a real flag) instead of passing the URL as the positional argument. Theruncommand auto-detects URLs and treats them as remote servers. Because Cobra'sUnknownFlagswhitelist is enabled, the flag was silently ignored, leaving no positional arg and causing "requires at least 1 arg(s)".thv list --registryinstead of the correctthv registry listsubcommand.Type of change
Test plan
task lint-fix)Verified
go vet ./test/e2e/...passes. The actual E2E tests require CI infrastructure (Docker) to run fully, but the fix is straightforward: replacing nonexistent flags with correct CLI invocations.Generated with Claude Code