Add release-gate tests for stable GeoTIFF features (#2340)#2353
Conversation
PR 6 of 6 in the GeoTIFF release contract epic. Adds a small, deterministic release-gate test per stable feature so a release engineer can run `pytest -m release_gate` and know the next release does not silently regress a stable promise. Coverage: - Local read: pixels, crs, transform, nodata round-trip. - Local write: pixels, crs, transform, nodata round-trip via the public to_geotiff API. - Stable lossless codecs (none, deflate, lzw, packbits, zstd) on uint16 and float32, plus a cross-file parity check against SUPPORTED_FEATURES. - COG write/read for every stable lossless codec. - Canonical attrs contract: canonical keys present, georef_status='full', contract version stamp shape, and a full write-read-write-read cycle. - Windowed reads: subset returned, crs preserved, transform origin shifts to the window, full-extent matches unwindowed. - Dask read parity: pixels and canonical attrs match eager, lazy reads stay dask-backed. Registers the `release_gate` pytest marker in setup.cfg. Tests run by default; release engineers can filter with `pytest -m release_gate`.
brendancol
left a comment
There was a problem hiding this comment.
PR Review: Add release-gate tests for stable GeoTIFF features (#2340)
Blockers
None.
Suggestions
test_release_gate_dask_parity.py: two of the three tests callopen_geotiff(path, chunks=8)without first runningpytest.importorskip("dask"). The third does. If dask ever moves out of the test environment, the unprotected two will error at collection while the third skips. Add the import-skip to all three for consistency, or hoist it to module scope.
Nits
test_release_gate_codecs.pyline 119:from xrspatial.geotiff import SUPPORTED_FEATURESis inside the test body; the other release-gate files import at module top. Easy hoist._make_data_arrayis duplicated betweentest_release_gate_local_write.pyandtest_release_gate_cog.py. The duplication is on purpose (each gate is self-contained), but worth flagging in case a follow-up wants to share it.
What looks good
- One file per stable feature, each one small and fast — 45 tests in about 4 seconds.
- Assertion messages name the contract being checked, so a failure tells the reader which release-notes claim broke.
test_release_gate_codec_stable_set_matches_supported_featurespins the local stable-codec list againstSUPPORTED_FEATURES, so a tier change can't desync the gate from the runtime constant.- Temp filenames include
_2340.tif, matching the project's parallel-worktree convention. - The
release_gatemarker is registered insetup.cfgand tests run by default;pytest -m release_gatepicks just the gates when a release engineer wants the short loop.
Checklist
- Tests assert documented contract behaviour, not just that the code runs.
- Stable lossless codec set matches
SUPPORTED_FEATURES. - Round-trip pixel, CRS, transform, and nodata checks present for every stable feature.
- Windowed read transform origin shift is verified explicitly.
- Dask parity test compares pixels and canonical attrs against the eager backend.
- Temp filenames are unique across files and parametrize cases.
-
release_gatemarker registered insetup.cfg.
…2340) - test_release_gate_dask_parity.py: move pytest.importorskip("dask") to module scope so all three tests skip uniformly when dask is absent. Previously only the lazy-shape test was protected; the two parity tests would error at collection in a dask-less environment. - test_release_gate_codecs.py: hoist `SUPPORTED_FEATURES` import to the top of the module to match the convention used by the other release-gate files.
brendancol
left a comment
There was a problem hiding this comment.
Follow-up review
Disposition of the original review:
- Suggestion (dask import-skip): Fixed.
pytest.importorskip("dask")is now at module scope intest_release_gate_dask_parity.py, so all three tests skip uniformly when dask is absent. - Nit (SUPPORTED_FEATURES import): Fixed. Hoisted to module top in
test_release_gate_codecs.py. - Nit (
_make_data_arrayduplication): Dismissed. Each release-gate file is intentionally self-contained so a single file can be cited from the release-contract checklist without pulling in shared helpers. A follow-up can consolidate if it wants to.
No new findings on the updated diff. Marker registration, test isolation, and assertion-message specificity are unchanged.
PR Review: Add release-gate tests for stable GeoTIFF features (#2340)Test-only PR (7 new test files plus a marker registration in Blockers (must fix before merge)None. Suggestions (should fix, not blocking)
Nits (optional improvements)
What looks good
Checklist
|
Self-review fix on PR #2353. test_release_gate_cog.py previously redefined ``STABLE_LOSSLESS_CODECS`` as a local copy of the same tuple in test_release_gate_codecs.py. The cross-check against ``SUPPORTED_FEATURES`` only runs against the codecs-file copy, so a future tier change that updated the codecs file but forgot the COG file would leave the COG gate silently parametrized on a stale list. Import the tuple from the sibling file so the two files cannot drift.
Re-review (post self-fix)Followed up on the Suggestion in the previous review by importing The two Nits remain open and are intentionally cosmetic. The No further actionable findings. Holding for CI. |
PR 6 of 6 in the GeoTIFF release contract epic (#2340). Adds one small, deterministic release-gate test per stable feature so a release engineer can run
pytest -m release_gateand know the next release does not silently regress a stable promise.Summary
release_gatepytest marker registered insetup.cfg. Tests run by default; the marker exists so the release-gate subset can be selected withpytest -m release_gate(~4 seconds, 45 tests).attrs['crs'],attrs['transform'], andattrs['nodata']end to end.Coverage map
test_release_gate_local_read.pytest_release_gate_local_write.pytest_release_gate_codecs.pytest_release_gate_cog.pytest_release_gate_attrs_contract.pytest_release_gate_windowed_read.pytest_release_gate_dask_parity.pyThe codec file also pins a cross-check between its local
STABLE_LOSSLESS_CODECSconstant and thecodec.*entries taggedstableinSUPPORTED_FEATURES, so a future tier change cannot silently desync the gate from the runtime tier table.Out of scope (other PRs in epic #2340)
SUPPORTED_FEATURESedits (PR 1)Test plan
pytest xrspatial/geotiff/tests/test_release_gate_local_read.py-- 4 tests passpytest xrspatial/geotiff/tests/test_release_gate_local_write.py-- 4 tests passpytest xrspatial/geotiff/tests/test_release_gate_codecs.py-- 11 tests passpytest xrspatial/geotiff/tests/test_release_gate_cog.py-- 15 tests passpytest xrspatial/geotiff/tests/test_release_gate_attrs_contract.py-- 4 tests passpytest xrspatial/geotiff/tests/test_release_gate_windowed_read.py-- 4 tests passpytest xrspatial/geotiff/tests/test_release_gate_dask_parity.py-- 3 tests passpytest -m release_gate xrspatial/geotiff/tests/-- 45 tests pass, 5412 deselected, ~4 secondstest_release_gate_2321.pystill passes