Skip to content

Tests: per-directory canonical sidecars and unwritable folders - #99

Merged
TorecLuik merged 5 commits into
test-suitefrom
test/canonical-sidecar-stubs
Nov 16, 2026
Merged

TorecLuik merged 5 commits into
test-suitefrom
test/canonical-sidecar-stubs

Conversation

@TorecLuik

@TorecLuik TorecLuik commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

Harness update for #95 (refs #94).

  • Stubs for the sidecar helpers accept the new processed_folder keyword (lambda path, **_kwargs) and the namespace gets PROCESSED_DATA_FOLDER; still passes against the current master source.

  • New tests, skipped until the matching source exists: _write_canonical_marker rewrites a legacy-only store through the importer; upgrade_reused_canonical survives an unwritable sidecar folder with a WARNING.

  • Verified: current master source 46 passed / 2 skipped; the Migration script: move canonical sidecars via importer helpers #95 branch 48 passed; full harness against Migration script: move canonical sidecars via importer helpers #95 480 passed / 11 skipped; the new tests fail when the corresponding source change is reverted.

  • test-suite (3185bf4, Tests: SSH recovery harness follows the one-path core contract #92) is merged into this branch.

  • New: parametrised Image/Plate save_as_zarr tests with a real unwritable .processed (asserts no canonical source, no attach_*, no export subprocess, Zarr packaged directly, warning logged); upgrade_reused_canonical survives a corrupt sidecar, an unreadable folder and a nameless path; a failed sidecar move renames the store back. Stubs for the sidecar helpers accept processed_folder, and namespaces define PROCESSED_DATA_FOLDER.

  • Mutations verified: narrowing the load catch, removing the indexing handler, and neutralising the rollback each fail a test.

  • Results: current master 464 passed / 33 skipped; Migration script: move canonical sidecars via importer helpers #95 branch 485 passed / 12 skipped.

Merge together with #95, not before.

Merge order (production and test PRs, interleaved)

Each step keeps master CI green: every (production state, test-suite state) pair on this path was run locally with core 2.9.0b26 from PyPI (482, 484, 484, 513, 524, 588, 594, 597, 606 passed; no failures). The production PRs merge cleanly in this order: each branch already contains the conflict resolutions with the PRs before it.

  1. test PR Tests: install biomero core 2.9.0b26 in the harness #103 (test-suite: biomero>=2.9.0b26,<3 in tests/requirements.txt, so core-dependent tests run in CI)
  2. test PRs Tests: schema imports, metadata view imports and workflow color #89, Tests: detached resume, cancel and registration #91 and Tests: per-directory canonical sidecars and unwritable folders #99 (capability-gated; they pass for the current master and for the new source) (this PR)
  3. production PR Remove the input marker from results after import on every path #97
  4. test PR Tests: remove the input marker from results after import #98 (fails on master before Remove the input marker from results after import on every path #97, by design)
  5. production PR Import Zarr contracts from biomero-schema and own the workflow color #88
  6. production PR Detached processing: own launcher registration, resume and cancel in the scripts #90
  7. production PR Migration script: move canonical sidecars via importer helpers #95
  8. test PR Tests: shared output names come from core constants #102
  9. production PR Use the core script-output constants #101

A production PR's own check stays red until the test PRs before it in this list are merged (CI runs the shared harness from test-suite, which is not pinned); merge the test PR, then rerun the check.

🤖 Generated with Claude Code

TorecLuik and others added 3 commits November 13, 2026 14:18
Stubs accept the processed_folder keyword; new tests are skipped until the
matching source is available.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@TorecLuik

Copy link
Copy Markdown
Collaborator Author

Independent review

Verdict: pass with one should-fix. Full review, own commits 0194599 and 5910c93.

Severity Where Finding
should fix tests/test_canonical_zarr_transfer.py:~946-950 and ~980-985; tests/test_canonical_marker_atomic.py:~89-93 and ~127-131 The new tests are gated by searching the source text for a log message or code fragment ("Could not write the canonical sidecar", "Ignoring the canonical sidecar of", "renamed the ", "processed_folder=PROCESSED_DATA_FOLDER"). A source that has the feature but words the message differently (or reformats the call) skips instead of failing, hiding a regression exactly where the feature exists. Fix: gate on a structural marker (for example the processed_folder parameter in the AST), fail in CI when the marker is present but the behaviour is not, and keep the message only as an assertion.
nit tests/test_sidecar_unwritable_fallback.py (end of _load_namespace) namespace["read_zarr_semantic_guard"] = ... repeats a key already in the dict; tmp_path is unused by _load_namespace.
nit tests/test_sidecar_unwritable_fallback.py Ungated, so it also runs on master (passes there; the broad except already exists). Useful regression test; the PR text could say so.

Runs: vs master 484 passed / 14 skipped; vs #97 484 / 14. Against #101 it needs #102's shared-name namespace (expected).

Mutations on #101 source (tests from #102 head):

  • except OSError -> except KeyError around the sidecar write in upgrade_reused_canonical: red.
  • narrow the sidecar load catch to (OSError,): red (2 params).
  • remove the store rename-back in _move_canonical_store: red.
  • drop processed_folder in the migrate script's _write_canonical_marker: red.
  • except Exception -> except KeyError around existing Zarr indexing in save_as_zarr: red for Image and Plate.
  • reword the "Could not write the canonical sidecar" message: the test SKIPS, suite green (the finding above).

Nothing found for: weak assertions (the unwritable-folder test uses a real filesystem failure and checks no export, no attach, direct packaging and the warning).

🤖 Generated with Claude Code

TorecLuik and others added 2 commits November 16, 2026 14:15
The four tests skipped when a log message was reworded. Gate on the
processed_folder keyword / move_canonical_marker call the feature adds so a
reworded message fails. Drop a redundant guard assignment and an unused
tmp_path parameter.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@TorecLuik

Copy link
Copy Markdown
Collaborator Author

Resolved in a275eba: the four sidecar tests are gated on the processed_folder keyword / move_canonical_marker call that the feature adds, not on log text. Rewording the warning messages on the #101 source now fails 4 tests instead of skipping them. Also removed the redundant read_zarr_semantic_guard assignment and unused tmp_path in test_sidecar_unwritable_fallback.py. Merged test-suite.

🤖 Generated with Claude Code

@TorecLuik
TorecLuik merged commit 093f974 into test-suite Nov 16, 2026
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