Repository navigation
test: smoke test TES 1.0 and 1.1 backends - #404
Merged
Merged
Conversation
Add a fake TES 1.0 backend that rejects fields of TES 1.1, as TESK does, and check that droppable fields are dropped for it, that other tasks go to TES 1.1 or are rejected, and the list filters and CANCELING. Refs #395 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_011FSoqMUX3EU35poH13xMgG
uniqueg
marked this pull request as ready for review
November 3, 2026 07:38
Reviewer's GuideThe smoke-test-only changes add a TES 1.0-compatible fake backend alongside TES 1.1, configure ordered version-aware routing, and exercise unsupported-field handling, task listing filters, and cancellation state transitions through the Compose stack. File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 5 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="tests/smoke/fake_tes.py" line_range="81-83" />
<code_context>
+ The names of the fields, as TESK rejects them.
+ """
+ items = (
+ [(item, ("ignore_error",)) for item in task.get("executors") or []]
+ + [(item, ("streamable",)) for item in task.get("inputs") or []]
+ + [(item, ("path_prefix",)) for item in task.get("outputs") or []]
+ )
+ return [name for item, names in items for name in names if name in item]
</code_context>
<issue_to_address>
**TES 1.0 accepts unsupported fields**
When a downgrade leaves either resource field in a task sent to the TES 1.0 backend, `fields_of_tes_11` does not check `resources.backend_parameters` or `resources.backend_parameters_strict`, so the fake backend accepts the task and the smoke test passes without detecting the compatibility regression.
Extend `fields_of_tes_11` to reject both resource fields in tasks sent to the TES 1.0 backend.
Also at `tests/smoke/check.sh:75`, `tests/smoke/fake_tes.py:85`.
</issue_to_address>
### Comment 2
<location path="tests/smoke/check.sh" line_range="100-102" />
<code_context>
+# Canceled tasks are `CANCELING` until their backend reports the final state
check POST "/tasks/${id}:cancel" 200 '. == {}'
+check POST /tasks 200 '.id | length > 0' \
+ '{"tags": {"fake.hold": "true"}, "executors": [{"image": "alpine", "command": ["true"]}]}'
+held="$(jq -r .id "${body}")"
+await_state "${held}" RUNNING
+check POST "/tasks/${held}:cancel" 200 '. == {}'
+check GET "/tasks/${held}?view=MINIMAL" 200 '.state == "CANCELING" or .state == "CANCELED"'
</code_context>
<issue_to_address>
**Interrupted runs leave tasks behind**
When a smoke run is interrupted after creating its held task but before sending the cancel request, and the same Compose backend is reused, the held task remains `RUNNING`, so the final assertion rejects it and a later otherwise-correct smoke run fails.
Ensure the held task is canceled or removed even when the smoke script exits before its cancel request.
Also at `tests/smoke/check.sh:136`.
</issue_to_address>
### Comment 3
<location path="tests/smoke/check.sh" line_range="104" />
<code_context>
+held="$(jq -r .id "${body}")"
+await_state "${held}" RUNNING
+check POST "/tasks/${held}:cancel" 200 '. == {}'
+check GET "/tasks/${held}?view=MINIMAL" 200 '.state == "CANCELING" or .state == "CANCELED"'
+await_state "${held}" CANCELED
# Unknown tasks are forbidden, as tasks of others are
</code_context>
<issue_to_address>
**Intermediate cancellation state goes untested**
When the fake backend reports `CANCELED` before the state check, the smoke assertion accepts either `CANCELING` or `CANCELED`, so it passes even when the API never exposes the intermediate state and does not catch a broken cancellation transition.
Hold the fake backend in a state that lets the smoke test require `CANCELING` before checking for `CANCELED`.
Also at `tests/smoke/fake_tes.py:285`.
</issue_to_address>
### Comment 4
<location path="tests/smoke/check.sh" line_range="68-69" />
<code_context>
check POST /tasks 200 '.id | length > 0' \
- '{"name": "smoke", "executors": [{"image": "alpine", "command": ["true"]}]}'
+ '{"name": "smoke", "tags": {"smoke.key": "a,b"},
+ "inputs": [{"content": "a", "path": "/a", "streamable": true}],
+ "outputs": [{"url": "s3://b/c", "path": "/c", "path_prefix": "/"}],
+ "resources": {"backend_parameters": {"VmSize": "small"}},
+ "executors": [{"image": "alpine", "command": ["true"], "ignore_error": false}]}'
</code_context>
<issue_to_address>
**TES 1.0 required types go unchecked**
When the downgrade fails to add `type` to an input or output, `fields_of_tes_11` does not validate that inputs and outputs have `type`; if `downgrade_task` stops adding TES 1.0's required types, the fake accepts the task and the smoke test still passes.
Have the fake TES 1.0 backend reject inputs or outputs without `type`, and assert the converted types in the smoke test.
Also at `tests/smoke/fake_tes.py:81-84`.
</issue_to_address>
### Comment 5
<location path="tests/smoke/check.sh" line_range="91-92" />
<code_context>
check GET '/tasks?view=MINIMAL' 200 "any(.tasks[]; .id == \"${id}\")"
+check GET '/tasks?view=MINIMAL&state=COMPLETE' 200 "any(.tasks[]; .id == \"${id}\")"
+check GET '/tasks?view=MINIMAL&state=RUNNING' 200 "all(.tasks[]; .id != \"${id}\")"
+check GET '/tasks?view=MINIMAL&tag_key=smoke.key&tag_value=a%2Cb' 200 \
+ "any(.tasks[]; .id == \"${id}\")"
+check GET '/tasks?view=MINIMAL&tag_key=smoke.key&tag_value=a' 200 \
+ "all(.tasks[]; .id != \"${id}\")"
</code_context>
<issue_to_address>
**Tag key filter can be ignored**
When the list implementation applies `tag_value` but ignores `tag_key`, the tag-filter checks in the smoke test still pass at lines 91–96 if listing ignores `tag_key` but applies `tag_value`: none of the other tasks has the queried value under a different key, so the results are unchanged.
Add a task with the queried value under a different tag key and assert that it is excluded by the filter.
Also at `tests/smoke/check.sh:93-96`.
</issue_to_address>Sourcery assessment
Approval pending. 5 findings to address first.
Blocking findings: tests/smoke/fake_tes.py:83, tests/smoke/check.sh:102, tests/smoke/check.sh:104, tests/smoke/check.sh:69, tests/smoke/check.sh:92
The fake TES 1.0 backend also rejects resource fields of TES 1.1 and files without a type, and the tag filter is checked with another key. Refs #395 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_011FSoqMUX3EU35poH13xMgG
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.
Refs #395 (closed by the final PR from
feat/tes-1.1intodev, with the other children of #241).Summary
The Compose smoke test now covers both TES versions. A second fake backend (
fake-tes-10) serves TES 1.0 as TESK does: it reports artifactTESand version1.0as a number, and rejects fields of TES 1.1. It comes first in the backends.Cases:
ignore_error: truegoes to TES 1.1, and gets400if the client chooses only TES 1.0.GET /tasksfilters bystate,tag_keyandtag_value, also with commas in values.CANCELINGuntil its backend reportsCANCELED.Light lane: this changes only test files (
tests/smoke/), no product code, so I reviewed the diff myself.Verification
ruff checkandruff formatontests/smoke,bash -n tests/smoke/check.sh: pass.ci.ymldoesn't run on PRs intofeat/tes-1.1, so it first runs on the final PR intodev; failures get fixed there before that PR merges.Open questions
None.
🤖 Generated with Claude Code
https://claude.ai/code/session_011FSoqMUX3EU35poH13xMgG
Summary by Sourcery
Expand the Compose smoke test to validate TES 1.0 and TES 1.1 interoperability, filtering, and cancellation workflows.
New Features:
Enhancements:
Build:
Tests: