{{ message }}
test(providers): cover env omission and singular server merge in MCP transform - #10634
Open
he-yufeng wants to merge 1 commit into
Open
test(providers): cover env omission and singular server merge in MCP transform#10634he-yufeng wants to merge 1 commit into
he-yufeng wants to merge 1 commit into
Conversation
…transform Two cases from promptfoo#10510 that current main still lacks after promptfoo#10557: the conditional env spread must omit the key entirely (no phantom env: undefined reaching the SDK), and a singular server entry must land in the same output map as servers entries.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #10634 +/- ##
==========================================
- Coverage 82.68% 82.67% -0.02%
==========================================
Files 946 946
Lines 81074 81074
Branches 27179 27179
==========================================
- Hits 67034 67025 -9
- Misses 14040 14049 +9 Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
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.

Summary
Follow-up to #10510 (superseded by #10557). Two of the four transform tests from that PR still add coverage that current
maindoes not have, so here they are on their own:envstays absent when a stdio server declares none.transformMCPServerConfigToClaudeCodespreadsconfig.envconditionally; this pins that the key is omitted entirely (not emitted asenv: undefined) so the SDK never sees a phantom empty env.serverentry lands in the same map asservers. The two shapes are merged before transformation; this pins parity for the singular form, including env forwarding, alongside aserversentry in one call.Both pass against
mainas of today and fail when the corresponding line is removed (checked locally by deleting the conditional spread and theconfig.servermerge).To verify
npx vitest run test/providers/mcp/transform.test.ts