From 31d8686632c36b6c579fe04591c73f7f4b8d47dd Mon Sep 17 00:00:00 2001 From: Pekka Enberg Date: Sun, 27 Sep 2026 10:33:01 +0300 Subject: [PATCH] Local Antithesis test suite runner Add `thesis`, a local runner for the Antithesis Test Composer templates in testing/antithesis/, replacing stress-composer/shuffle-run.sh. thesis runs a template as a single seeded timeline: first_ commands, randomly chosen driver steps, then finally_ and eventually_ commands. It seeds Python's global RNG in every command it launches, which the Antithesis SDK's get_random() and random_choice() fall back to outside Antithesis, so the same seed replays the same commands with the same random choices. It also evaluates SDK assertions, which do not raise on their own: a false always() or a reached unreachable() fails the run, and a failure prints the command that reproduces it. Run it from the repository root with: uv run --group antithesis thesis run testing/antithesis/stress-composer --seed 42 The antithesis dependency group builds pyturso from the checkout, so runs exercise local changes. --- AGENTS.md | 2 +- CONTRIBUTING.md | 9 + pyproject.toml | 8 +- testing/antithesis/README.md | 28 ++ .../antithesis/stress-composer/shuffle-run.sh | 13 - tools/thesis/README.md | 96 ++++++ tools/thesis/pyproject.toml | 23 ++ tools/thesis/src/thesis/__init__.py | 3 + .../thesis/src/thesis/_boot/sitecustomize.py | 37 ++ tools/thesis/src/thesis/assertions.py | 119 +++++++ tools/thesis/src/thesis/cli.py | 103 ++++++ tools/thesis/src/thesis/composer.py | 72 ++++ tools/thesis/src/thesis/runner.py | 319 ++++++++++++++++++ tools/thesis/tests/test_run.py | 214 ++++++++++++ uv.lock | 46 +++ 15 files changed, 1077 insertions(+), 15 deletions(-) delete mode 100755 testing/antithesis/stress-composer/shuffle-run.sh create mode 100644 tools/thesis/README.md create mode 100644 tools/thesis/pyproject.toml create mode 100644 tools/thesis/src/thesis/__init__.py create mode 100644 tools/thesis/src/thesis/_boot/sitecustomize.py create mode 100644 tools/thesis/src/thesis/assertions.py create mode 100644 tools/thesis/src/thesis/cli.py create mode 100644 tools/thesis/src/thesis/composer.py create mode 100644 tools/thesis/src/thesis/runner.py create mode 100644 tools/thesis/tests/test_run.py diff --git a/AGENTS.md b/AGENTS.md index 8045ed9ba..ef6a2abf4 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -55,7 +55,7 @@ limbo/ ├── testing/ # simulator/, concurrent-simulator/, differential-oracle/ ├── sync/ # engine/, sdk-kit/ (Turso Cloud sync) ├── sdk-kit/ # High-level SDK abstraction -└── tools/ # dbhash utility +└── tools/ # dbhash utility, thesis (local Antithesis runner) ``` ## Where to Look diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 88cf3a2e5..ad9aa822a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -443,6 +443,15 @@ testing (DST) tool for the following: - Discovering bugs that the DST did not catch (and improve the DST) - Discovering bugs that the DST does not cover (for example, non-simulated I/O) +The test templates live in `testing/antithesis/`. You can run one locally, without an Antithesis account, with +[`thesis`](tools/thesis): + +```bash +uv run --group antithesis thesis run testing/antithesis/stress-composer --seed 42 +``` + +See [`testing/antithesis/README.md`](testing/antithesis/README.md#running-a-template-locally) for details. + If you have an Antithesis account, you first need to configure some environment variables: diff --git a/pyproject.toml b/pyproject.toml index 27c8142e8..f0f401c06 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,11 +10,17 @@ version = "0.1.0" [tool.uv] package = false +[dependency-groups] +# Runs the Antithesis test templates locally: uv run --group antithesis thesis run testing/antithesis/