Skip to content

Fix SSE endpoint rewrite E2E tests using nonexistent flags#4080

Merged
ChrisJBurns merged 1 commit intomainfrom
fix-sse-endpoint-rewrite-e2e-tests
Mar 11, 2026
Merged

Fix SSE endpoint rewrite E2E tests using nonexistent flags#4080
ChrisJBurns merged 1 commit intomainfrom
fix-sse-endpoint-rewrite-e2e-tests

Conversation

@ChrisJBurns
Copy link
Copy Markdown
Collaborator

Summary

  • The SSE endpoint rewrite E2E tests were orphaned from CI until Rebalance E2E test CI matrix from 4 to 8 buckets #4074 rebalanced the E2E test buckets into the proxy bucket. Now that they run, all 4 tests fail because they invoke thv with flags that don't exist.
  • 3 tests passed --remote-url <url> (not a real flag) instead of passing the URL as the positional argument. The run command auto-detects URLs and treats them as remote servers. Because Cobra's UnknownFlags whitelist is enabled, the flag was silently ignored, leaving no positional arg and causing "requires at least 1 arg(s)".
  • 1 test used thv list --registry instead of the correct thv registry list subcommand.

Type of change

  • Bug fix

Test plan

  • Linting (task lint-fix)
  • Manual testing (describe below)

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

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>
@github-actions github-actions bot added the size/XS Extra small PR: < 100 lines changed label Mar 10, 2026
@ChrisJBurns ChrisJBurns mentioned this pull request Mar 11, 2026
2 tasks
@ChrisJBurns ChrisJBurns merged commit 69cf7fe into main Mar 11, 2026
74 of 77 checks passed
@ChrisJBurns ChrisJBurns deleted the fix-sse-endpoint-rewrite-e2e-tests branch March 11, 2026 01:23
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.55%. Comparing base (c598eda) to head (4ae946b).
⚠️ Report is 1 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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>
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XS Extra small PR: < 100 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants