Skip to content

Shard PRISM coordinator tests by domain - #73

Open
kiwidream wants to merge 1 commit into
1.x.xfrom
prism-test-shards
Open

Shard PRISM coordinator tests by domain#73
kiwidream wants to merge 1 commit into
1.x.xfrom
prism-test-shards

Conversation

@kiwidream

@kiwidream kiwidream commented Jul 20, 2026

Copy link
Copy Markdown
Member

Position in the stack

PR 1 of 9. Base: 1.x.x. Next: PR 74.

Review this PR against its configured base. Retargeting a later PR to 1.x.x would show the cumulative stack instead of one review slice. The complete order is in the stack guide.

Why this slice exists

The production refactor needs domain-focused regression suites. Splitting the monolithic coordinator tests first gives every later ownership extraction a small, discoverable test boundary without mixing test movement into its production diff.

What changes

  • Split the coordinator/job-cache test monolith into domain suites for configuration, candidates, tip refresh and delivery, vardiff, retained jobs, payout state, metrics, share writing, and related behavior.
  • Centralize lightweight fakes and builders in shared PRISM test-support modules.
  • Preserve the existing latest-tip, refresh, queue, reconnect, payout, candidate, and delivery regression inventory.
  • Remove three unused test imports reported by Docker Ruff.

No production code changes in this PR.

Why the diff is large

GitHub reports roughly 14,300 additions and 14,200 deletions across 21 files because one large test file was split many ways. A many-to-many split cannot be represented as a simple rename, so unchanged test bodies appear as deleted from the old file and added to new shards.

The substantive review surface is limited to fixture/import rewiring and the three unused-import removals. Review the new shard boundaries and shared support modules first, then verify that test cases were moved rather than weakened or dropped.

Review focus

  • No production files or runtime contracts change.
  • Shared fixtures retain the same defaults and failure behavior.
  • Test discovery still reaches every moved case.
  • Later PRs can add owner tests without recreating coordinator-wide setup.

Validation

  • Full Python discovery at this boundary: 1,192 passed.
  • Docker Python compile passed.
  • Docker Ruff passed for the changed tests.
  • git diff --check passed.

Landing note

Merge review slices bottom-up if they are landed individually. If the stack is collapsed for release history, preserve these PRs as the review record and build the integration change from a refreshed target base.


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.


Note

Low Risk
Test-only refactor with no production paths modified; risk is limited to accidental test loss or fixture drift during the split.

Overview
Splits the monolithic PRISM coordinator unittest file into domain-focused suites (e.g. block candidates, config, job cache, tip refresh) so later refactors can hang tests on clear boundaries instead of one huge module.

Adds tests/prism_coordinator_test_support.py and tests/prism_vardiff_test_support.py with shared no-environment fakes (FakeRpc, FakeLedger, coordinator() builders, audit-bundle stubs, vardiff helpers). Shards import these via star-imports or explicit imports instead of duplicating setup in each file.

No production/runtime changes. Touch-ups only: drop a few unused imports in CTV broadcaster and compose-profile tests.

The large line count is mostly move-only test bodies; review the new file boundaries and that shared fixtures keep the same defaults (e.g. tip_refresh_failure_holdoff_seconds = 0.0 for monotonic-frozen tests).

Reviewed by Cursor Bugbot for commit d8a99b5. Bugbot is set up for automated code reviews on this repo. Configure here.

@kiwidream
kiwidream force-pushed the prism-test-shards branch from 920a2e6 to d8a99b5 Compare July 22, 2026 13:50
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