Repository navigation
test(ai-proxy): verify the Anthropic Messages upstream request - #14278
Open
Zi-Yi-Ming wants to merge 1 commit into
Open
Zi-Yi-Ming wants to merge 1 commit into
Zi-Yi-Ming wants to merge 1 commit into
Conversation
Assert the method, configured API key, and decoded request body at the test upstream before serving the existing Anthropic fixture response.
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.
Description
The Anthropic fixture tests match the recorded response, which the mock selects from
X-AI-Fixture. That response alone gives no evidence about the method, configured credentials, or JSON sent upstream.Use the native Messages path for the existing JSON and SSE fixture cases. The JSON case adds a block-local
/v1/messageshandler that checksPOST, the configuredx-api-key, and the decoded model, token limit, and message. A log assertion confirms that the checked handler served the request. The handler still uses the existing fixture loader and recorded response.Related issue
Refs #13340.
Validation
Run from the APISIX checkout with a dedicated test etcd and the CI-pinned Test::Nginx checkout.
ai-proxy-fixture.tpassed all 51 TAP assertions.ai-proxy-protocol-conversion.tpassed all 89.git diff --checkpassed in the working branch.PUT, removedx-api-key, or sent an emptymessagesarray. Each failed the corresponding check.Checklist