Skip to content

test: smoke test TES 1.0 and 1.1 backends - #404

Merged
uniqueg merged 2 commits into
feat/tes-1.1from
feat/tes-smoke
Nov 3, 2026
Merged

uniqueg merged 2 commits into
feat/tes-1.1from
feat/tes-smoke

Conversation

@uniqueg

@uniqueg uniqueg commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

Refs #395 (closed by the final PR from feat/tes-1.1 into dev, 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 artifact TES and version 1.0 as a number, and rejects fields of TES 1.1. It comes first in the backends.

Cases:

  • A task with fields that can be dropped reaches TES 1.0 without them, and is served with them.
  • A task with ignore_error: true goes to TES 1.1, and gets 400 if the client chooses only TES 1.0.
  • GET /tasks filters by state, tag_key and tag_value, also with commas in values.
  • A canceled task is CANCELING until its backend reports CANCELED.

Light lane: this changes only test files (tests/smoke/), no product code, so I reviewed the diff myself.

Verification

  • ruff check and ruff format on tests/smoke, bash -n tests/smoke/check.sh: pass.
  • Not run locally: the smoke test itself, as it needs the Compose stack on shared local ports. ci.yml doesn't run on PRs into feat/tes-1.1, so it first runs on the final PR into dev; 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:

  • Add smoke-test coverage for routing tasks across TES 1.0 and TES 1.1 backends, including compatibility and backend-selection behavior.
  • Expand smoke tests for task listing filters and cancellation state transitions.

Enhancements:

  • Extend the fake TES backend to emulate TES 1.0 incompatibilities, optional held tasks, and cancellation behavior.

Build:

  • Add a TES 1.0 fake backend to the smoke-test Compose stack and configure it as the preferred backend.

Tests:

  • Verify TES version reporting, compatible field handling, backend selection, list filtering, and cancellation behavior in the Compose smoke test.

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
uniqueg marked this pull request as ready for review November 3, 2026 07:38
@sourcery-ai

sourcery-ai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

The 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

Change Details Files
Add a TES 1.0 fake backend and configure it ahead of the TES 1.1 backend to exercise version-aware routing and compatibility behavior.
  • Expose TES 1.0 service metadata and reject TES 1.1-only fields.
  • Require both fake backends to be healthy before gateway and worker startup.
  • Route compatible tasks to TES 1.0 and TES 1.1-only tasks to TES 1.1, including explicit backend selection failures.
tests/smoke/compose.yaml
tests/smoke/config.yaml
tests/smoke/fake_tes.py
Expand the Compose smoke script to validate task compatibility, filtering, and cancellation lifecycle semantics.
  • Verify TES 1.0-compatible fields are preserved when returned and TES 1.1-only fields route correctly.
  • Add state and tag filtering checks, including comma-containing tag values.
  • Add polling helpers and assertions for the intermediate CANCELING state before backend-reported CANCELED.
  • Update task completion expectations to allow canceled tasks and verify TES service version metadata.
tests/smoke/check.sh

Possibly linked issues

  • feat(api): implement TES 1.1 #241: The PR implements the issue’s dual-backend smoke tests, including TES 1.0 field rejection, version-aware routing, and no-eligible-backend behavior.

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@read-the-docs-community

read-the-docs-community Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Documentation build overview

📚 proTES | 🛠️ Build #35605446 | 📁 Comparing 43e4e37 against latest (ed55e4c)

  🔍 Preview build  

7 files changed · + 1 added · ± 6 modified

+ Added

± Modified

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread tests/smoke/fake_tes.py Resolved
Comment thread tests/smoke/check.sh Resolved
Comment thread tests/smoke/check.sh Resolved
Comment thread tests/smoke/check.sh Resolved
Comment thread tests/smoke/check.sh Resolved
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
@uniqueg
uniqueg merged commit b259067 into feat/tes-1.1 Nov 3, 2026
2 checks passed
@uniqueg
uniqueg deleted the feat/tes-smoke branch November 3, 2026 07:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant