Skip to content

test(runner): a conformance kit every [runner] must pass, run against LocalRunner - #269

Merged
AlexS-scale merged 4 commits into
mainfrom
AlexS/runner-conformance-kit
Oct 21, 2026
Merged

AlexS-scale merged 4 commits into
mainfrom
AlexS/runner-conformance-kit

Conversation

@AlexS-scale

@AlexS-scale AlexS-scale commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The stores have shared kits in tst/store/ that every backend must pass; runners had none, so the contract task run, task run-batch, eval run and the explorer rely on lived only in LocalRunner's own tests and the CLI tests. This adds tst/runner/conformance.py, in the same shape as the store kits (plain functions plus CASES), and runs it against LocalRunner.

Each case gets a runner that was never started (the CLI never calls start()) and is stopped afterwards. The cases store real tasks with Task.put and read the run index and the task instances, so a remote runner passes only if its worker shares the caller's stores and has the kit's Step registered. A Temporal runner plugin can run the same cases against a test server and an in-process worker.

Case What it pins
a_run_completes_and_is_recorded_under_its_handle the status and the run index agree on COMPLETED; the record carries the handle's run_id, instance_id and task; the stored instance carries workflow_id, the submitted metadata and what the step wrote
a_run_whose_step_fails_fails_with_its_error FAILED with the step's error, in the status and the index
a_cancelled_run_ends_canceled cancel() of a started run returns True and the run ends CANCELED
a_run_given_an_instance_continues_it_from_start_step submit(instance_id=...) keeps the instance, starts from metadata["start_step"] without rerunning earlier steps, and carries their stored context
a_run_it_does_not_have_or_that_ended_cannot_be_cancelled cancel() is False for an ended or unknown run; status() is None for an unknown one

Left out to keep this small: KEEP_KEY (observing a teardown neutrally needs a fake sandbox provider configured in the worker) and a started runner, the explorer's mode.

Validation

  • The 5 cases pass on LocalRunner, 15 times in a row under -n 4.
  • Each of these breaks to LocalRunner fails at least one case: a resume that restarts from step 0, one that ignores the stored instance, one that mints a new instance, no workflow_id, dropped metadata, a cancel recorded as FAILED, cancel() returning True for an ended run, and a failed run recorded as COMPLETED.
  • Unit suite: 9,178 passed. The 2 failures in test_mcp_cli_builder.py also fail on main locally (the generated script runs under a system python3 without click).

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge, with no outstanding findings.

Summary

Adds five shared runner checks and runs them against LocalRunner.

  • Runner backends can now run a shared check of their core contract.

Reviews (4) · Last reviewed commit: "test(runner): validate saved run identit..." · Reviewed by Greptile

@AlexS-scale
AlexS-scale requested a review from a team as a code owner October 20, 2026 20:52
Comment thread tst/runner/conformance.py Outdated
Comment thread tst/runner/conformance.py Outdated
Comment thread tst/runner/conformance.py Outdated
@AlexS-scale
AlexS-scale merged commit 749e765 into main Oct 21, 2026
14 checks passed
@AlexS-scale
AlexS-scale deleted the AlexS/runner-conformance-kit branch October 21, 2026 00:43
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.

2 participants