Skip to content

test: reduce and improve tests in mcp_http_tests.rs#994

Open
github-actions[bot] wants to merge 1 commit into
mainfrom
test-reducer/mcp-http-tests-2026-06-13-40b206489e45b1b6
Open

test: reduce and improve tests in mcp_http_tests.rs#994
github-actions[bot] wants to merge 1 commit into
mainfrom
test-reducer/mcp-http-tests-2026-06-13-40b206489e45b1b6

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Test Suite Reduction: tests/mcp_http_tests.rs

What was wrong

  • test_health_endpoint_no_auth_required: duplicate of test_health_endpoint_returns_ok. Both tests make an unauthenticated GET /health and assert 200. The "no auth required" test is a strict subset — it omits the body check (assert_eq!(resp.text(), "ok")), so its coverage is entirely contained by the first test.

  • test_auth_accepts_correct_token: weak assertion. assert_ne!(resp.status(), 401) would pass silently for 500, 404, or any non-401 status code, including error responses. The test name claims the token is accepted, which requires asserting a successful response, not merely the absence of a 401.

Changes

Test Action Reason
test_health_endpoint_no_auth_required Removed Duplicate — strict subset of test_health_endpoint_returns_ok
test_auth_accepts_correct_token Rewritten Weak assertion: assert_ne!(status, 401)assert!(status.is_success())

Verification

  • cargo test --test mcp_http_tests --test audit_it: all 10 tests pass ✅
  • cargo test: all 1840+ tests pass, 0 failures ✅
  • cargo clippy --all-targets --all-features: no warnings ✅

Warning

Firewall blocked 2 domains

The following domains were blocked by the firewall during workflow execution:

  • spsprodeus21.vssps.visualstudio.com
  • spsprodweu4.vssps.visualstudio.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "spsprodeus21.vssps.visualstudio.com"
    - "spsprodweu4.vssps.visualstudio.com"

See Network Configuration for more information.

Generated by Test Reducer · sonnet46 1.6M ·

- Remove test_health_endpoint_no_auth_required: duplicate of
  test_health_endpoint_returns_ok (strict subset — same unauthenticated
  GET /health, same 200 assertion, missing the body check).
  would pass silently for 500/404/etc.; replaced with

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@jamesadevine jamesadevine marked this pull request as ready for review June 13, 2026 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants