e2e tests: mcp: construct payloads using structs + serialize#7464
Open
plebedev wants to merge 1 commit into
Open
e2e tests: mcp: construct payloads using structs + serialize#7464plebedev wants to merge 1 commit into
plebedev wants to merge 1 commit into
Conversation
|
✅ All contributors to this pull request have signed the TensorZero CLA. Thank you! |
Author
|
I have read the Contributor License Agreement (CLA) and hereby sign the CLA. |
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.
Contributes to #4710.
Refactor MCP e2e tests to use typed request structs for constructing tool payloads.
Refactor Payload Construction:
Replace raw JSON payloads with typed request structs and small MCP-specific wrapper structs in
mcp/common.rs.Use core request types such as
CreateDatapointsRequest,GetDatapointsRequest,ListDatapointsRequest,UpdateDatapointsRequest,DeleteDatapointsRequest,ListDatasetsRequest,ListInferencesRequest, andGetInferencesRequest.Add typed helpers for MCP-only tool params such as
dataset_name, feedback lookup params, inference params, and list episode params.Keep raw JSON only for intentionally malformed request tests and arbitrary JSON values inside typed request structs.
Affected Tests:
MCP datapoint tests in
create_datapoints.rs,create_datapoints_from_inferences.rs,get_datapoints.rs,list_datapoints.rs,update_datapoints.rs, anddelete_datapoints.rs.MCP inference tests in
inference.rs,list_inferences.rs, andget_inferences.rs.MCP dataset, feedback, and episode tests in
list_datasets.rs,feedback.rs,get_feedback_by_target_id.rs,get_latest_feedback_by_metric.rs,get_feedback_by_variant.rs, andlist_episodes.rs.Verification:
cargo check -p tensorzero-core --test e2e --features e2e_testspasses.