Skip to content

chore: remove build-dist.sh; clean test contexts on failure#216

Merged
kyocum merged 1 commit into
masterfrom
chore/cleanup-dist-and-test-contexts
Jun 25, 2026
Merged

chore: remove build-dist.sh; clean test contexts on failure#216
kyocum merged 1 commit into
masterfrom
chore/cleanup-dist-and-test-contexts

Conversation

@kyocum

@kyocum kyocum commented Jun 25, 2026

Copy link
Copy Markdown
Owner

Remove obsolete build-dist.sh; conftest cleans up leftover test
contexts on a failed run.

…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>
@kyocum kyocum merged commit 97bfcc3 into master Jun 25, 2026
5 checks passed

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 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".

Comment thread tests/conftest.py
"""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")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

@kyocum kyocum deleted the chore/cleanup-dist-and-test-contexts branch June 25, 2026 23:37
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