chore: remove build-dist.sh; clean test contexts on failure#216
Conversation
…lure - Remove build-dist.sh: it used the removed `python setup.py sdist` and is superseded by the uv-based publish workflow; nothing references it. - conftest: add a pytest_sessionfinish hook that, on a non-zero exit, deletes leftover test contexts (names like __test*/___test*). Tests clean up on success but a mid-test failure leaves contexts behind that pollute later runs (stale bundles -> spurious failures). Best-effort and scoped to test contexts, so real user contexts are untouched. Verified: failing run removes the leftover context; passing run (40 tests) is unaffected. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8b7387f9dd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| """A context the suite creates: leading underscores followed by 'test' | ||
| (e.g. ``__test_context_1__``, ``___test_context___``). Real user contexts | ||
| do not match, so they are never touched.""" | ||
| return name.startswith("_") and name.lstrip("_").startswith("test") |
There was a problem hiding this comment.
Restrict failure cleanup to known test contexts
When a developer runs the suite against an existing Disdat config, this predicate is applied to every api.ls_contexts() entry after any failed run, while ensure_disdat_initialized explicitly leaves that developer config in place. Disdat context creation does not reserve this namespace, so legitimate contexts such as _testdata or __testing_experiment match after lstrip("_") and will be deleted even though the suite did not create them. Track contexts created during the run or match only the exact test context names/prefixes used by the tests.
Useful? React with 👍 / 👎.
Remove obsolete build-dist.sh; conftest cleans up leftover test
contexts on a failed run.