Repository navigation
Add Task SDK client contract tests - #77146
Merged
Merged
Conversation
The Task SDK client is tested against a mocked server, and the Execution API routes against a hand-written client. Neither catches a client that assumes something the server doesn't do. apache#76825's first version had that bug, and only the Kubernetes e2e job caught it. Add a task_sdk_client fixture that sends the real client's requests to this tree's routes in process, as the Dag processor and triggerer do. Use it to test the client methods that interpret a response: XCom reads, and the not-found mapping for Variables, Connections and the task and asset state stores. Document the convention in the Execution API AGENTS.md. Two cases are left out on purpose: - Reading a mapped task's XCom with no map index. main returns null for it until apache#76825 is merged, and that PR adds the case here. - 401/403 to PERMISSION_DENIED. The in-process API overrides the access checks, so a test would only send the client a hand-written 403, which the mocked client tests already cover.
uranusjr
requested review from
amoghrajesh,
ashb,
choo121600,
jason810496,
jscheffl,
potiuk and
shahar1
as code owners
November 16, 2026 06:02
jason810496
approved these changes
Nov 16, 2026
jason810496
left a comment
Member
There was a problem hiding this comment.
There're some missing cases like task_instances.start or dag_runs.trigger but there's no harm to fill up the gap as follow-up, thanks.
This was referenced Nov 17, 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.
The Task SDK client is tested against a mocked server, and the Execution API routes against a hand-written client. Neither catches a client that assumes something the server doesn't do. #76825's first version had that bug, and only the Kubernetes e2e job caught it.
Add a task_sdk_client fixture that sends the real client's requests to this tree's routes in process, as the Dag processor and triggerer do. Use it to test the client methods that interpret a response: XCom reads, and the not-found mapping for Variables, Connections and the task and asset state stores. Document the convention in the Execution API AGENTS.md.
Two cases are left out on purpose: