test: reduce and improve tests in mcp_http_tests.rs#994
Open
github-actions[bot] wants to merge 1 commit into
Open
test: reduce and improve tests in mcp_http_tests.rs#994github-actions[bot] wants to merge 1 commit into
github-actions[bot] wants to merge 1 commit into
Conversation
- 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>
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.
Test Suite Reduction:
tests/mcp_http_tests.rsWhat was wrong
test_health_endpoint_no_auth_required: duplicate oftest_health_endpoint_returns_ok. Both tests make an unauthenticatedGET /healthand assert200. 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 for500,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_health_endpoint_no_auth_requiredtest_health_endpoint_returns_oktest_auth_accepts_correct_tokenassert_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.comspsprodweu4.vssps.visualstudio.comSee Network Configuration for more information.