fix: update auth validation test assertions to match new error format#3778
Merged
fix: update auth validation test assertions to match new error format#3778
Conversation
PR #3764 refactored auth validation into validateServerAuth which uses rules.UnsupportedField, changing the error message format. Four tests still expected the old "auth is only supported for HTTP servers" wording. Updated assertions to match the actual structured error messages. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Updates config/auth validation tests to align with the newer structured error format produced by rules.UnsupportedField (introduced via the shared validateServerAuth helper), ensuring the suite asserts against the actual message/suggestion now emitted for auth-on-non-HTTP servers.
Changes:
- Update
TestValidateAuthConfigto expect the structured message fragmentserver type "stdio". - Update stdin config conversion tests to assert on the new structured error message.
- Update TOML
LoadFromFiletest to assert on the new suggestion text emitted for non-HTTP auth blocks.
Show a summary per file
| File | Description |
|---|---|
| internal/config/validation_test.go | Adjusts auth validation test assertion to match UnsupportedField message format. |
| internal/config/config_stdin_test.go | Updates two stdin conversion tests to expect server type "stdio" in the structured validation error. |
| internal/config/config_core_test.go | Updates TOML load test assertion to match the new suggestion text included in the structured error. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 3/3 changed files
- Comments generated: 0
This was referenced Apr 14, 2026
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.
Problem
PR #3764 refactored auth validation into a shared
validateServerAuthhelper that usesrules.UnsupportedFieldfor structured errors. This changed the error message format from the old"auth is only supported for HTTP servers"to a structured"server type \"stdio\""with a suggestion.Four tests were not updated to match the new format:
TestLoadFromFile_AuthOnNonHTTPServerRejected— expected"HTTP"TestConvertStdinServerConfig_ValidationError/stdio_with_auth_block— expected old messageTestConvertStdinServerConfig_StdioWithAuth— expected old message invalErr.MessageTestValidateAuthConfig/auth_on_stdio_server_is_rejected— expected old messageFix
Updated all 4 assertions to match the actual structured error messages from
rules.UnsupportedField.