geotiff tests: consolidate VRT validation cluster#2406
Merged
Conversation
Folds the validator-side VRT files into one parametrised module: - test_vrt_validation_2321.py - test_vrt_capability_validator_2371.py - test_vrt_unsupported_2370.py - test_vrt_narrow_except_1670.py - test_vrt_path_containment_1671.py All five are removed in this commit. The new ``vrt/test_validation.py`` parametrises the validator-rule matrix, the entry-point matrix (package read_vrt, internal _vrt.read_vrt, open_geotiff), the narrow-except matrix (exception class x default/strict mode), and the path-containment matrix. Also removes the stale ``CLUSTER_AUDIT.md`` from PR 1 that leaked to main, and updates two release-gate citations in ``docs/source/reference/release_gate_geotiff.rst`` so the ``test_release_gate_cites_only_existing_test_files`` gate still passes. Adds a temporary ``CLUSTER_AUDIT_PR2.md`` mapping every old ``file::test`` to its new ``file::test_id``; deleted in a follow-up commit on this branch before merge per the epic #2390 contract. Tests-only restructure. No changes to ``xrspatial/geotiff/`` source modules. ``find xrspatial/geotiff/tests -name 'test_*.py' | wc -l`` drops from 356 to 352 (5 deleted, 1 added).
brendancol
commented
May 26, 2026
Contributor
Author
brendancol
left a comment
There was a problem hiding this comment.
PR Review: geotiff tests: consolidate VRT validation cluster
Blockers
None.
Suggestions
-
xrspatial/geotiff/tests/vrt/test_validation.py:1036-1046--_zstd_error_or_skip()is dead code. The helper is never called; the two zstd tests use@pytest.mark.skipif(not _has_zstandard())and importZstdErrorinline. Remove the unused helper. -
xrspatial/geotiff/tests/vrt/test_validation.py:594-609--test_warped_subclass_band_rejected_via_open_geotiffswallows the rejection with a four-waypytest.raises((ValueError, NotImplementedError, RuntimeError, UnsupportedGeoTIFFFeatureError))and never checks the error message. The oldtest_warped_vrt_subclass_raisesfromtest_vrt_unsupported_2370.pyasserted the message named'warp'or'vrtwarped'(via_assert_raises_or_xfailkeywords). Add a keyword assertion (e.g.assert any(k in str(excinfo.value).lower() for k in ('warp', 'vrtwarped'))) so a future regression that raises a genericValueErrorwithout naming the failure mode actually fails the test.
Nits
-
xrspatial/geotiff/tests/vrt/test_validation.py:74-77, 1236-1240--_uniqand_unique_dirboth build{label}_{uuid.uuid4().hex[:8]}names._unique_dircould call_uniqand thenmkdir, rather than re-rolling the uuid format inline. -
xrspatial/geotiff/tests/vrt/test_validation.py:61-66-- the alias dance (_package_read_vrt = _public_read_vrt) is one indirection more than needed. Either import once as_package_read_vrtdirectly, or drop the second name.
What looks good
- The audit in
CLUSTER_AUDIT_PR2.mdmaps every oldfile::testto its new home and notes the twoxfail(strict=False)carryovers fromtest_vrt_unsupported_2370.py. Row count matches the old files. - Parametrise IDs are descriptive throughout (
reject[bad-resample-alg],truthy[true],entry[package-read_vrt]). No issue numbers leak into test names. - Both
release_gate_geotiff.rstcitations are repointed tovrt/test_validation.pysotest_release_gate_cites_only_existing_test_filesstays green. - The stale PR-1
CLUSTER_AUDIT.mdis removed in the same commit. - File count drops from 356 to 352 (5 deleted, 1 added), matching the PR description.
- Source-TIFF and VRT filenames carry uuid suffixes so parallel test workers across worktrees do not collide.
Checklist
- Tests-only restructure; no
xrspatial/geotiff/source modules touched - Entry-point matrix preserved (package
read_vrt, internal_vrt.read_vrt,open_geotiff) - Edge cases (warped / nested / mixed-{crs,dtype,band-count} / mask / resample / path-traversal) preserved
- No premature materialization
- Docstrings on every public test and helper
* Drop the dead `_zstd_error_or_skip()` helper; the two zstd tests use module-level `skipif(not _has_zstandard())` and import `ZstdError` inline. * Tighten `test_warped_subclass_band_rejected_via_open_geotiff` with a message-keyword assertion (`'warp'` or `'vrtwarped'`) so a regression that raises a generic `ValueError` without naming the failure mode fails the test. * Collapse `_unique_dir` onto `_uniq` so the uuid format is in one place. * Drop the alias dance (`_package_read_vrt = _public_read_vrt`); import the backend `read_vrt` directly as `_package_read_vrt`.
brendancol
commented
May 26, 2026
Contributor
Author
brendancol
left a comment
There was a problem hiding this comment.
Follow-up review after commit 2175775
All four findings from the prior review have been addressed:
Suggestions
-
_zstd_error_or_skip()removed (commit 2175775,vrt/test_validation.py). -
test_warped_subclass_band_rejected_via_open_geotiffnow asserts the message contains'warp'or'vrtwarped'so a generic-ValueErrorregression fails the test.
Nits
-
_unique_dirnow calls_uniq(label)instead of re-rolling the uuid format. - The alias dance is gone; the module imports the backend
read_vrtas_package_read_vrtdirectly.
Verification
pytest xrspatial/geotiff/tests/vrt/test_validation.py -q: 81 passed, 2 xfailed.- No source modules under
xrspatial/geotiff/touched.
Only the temporary CLUSTER_AUDIT_PR2.md is left to remove before merge, per the epic contract.
The audit table served its purpose during review (mapping every old ``file::test`` to its new home in ``vrt/test_validation.py``). Per the epic, the audit is deleted on the same branch before merge so it does not land on main.
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2395. Tracks epic #2390 (PR 2 of 11).
Summary
Folds the validator-side VRT cluster into one parametrised module under
xrspatial/geotiff/tests/vrt/test_validation.py. The new file covers four matrices: validator-rule rejections, entry-point parity (read_vrtx_internal_read_vrtxopen_geotiff), the narrow-except contract (exception class x default/strict mode), and path containment.Files removed
xrspatial/geotiff/tests/test_vrt_validation_2321.pyxrspatial/geotiff/tests/test_vrt_capability_validator_2371.pyxrspatial/geotiff/tests/test_vrt_unsupported_2370.pyxrspatial/geotiff/tests/test_vrt_narrow_except_1670.pyxrspatial/geotiff/tests/test_vrt_path_containment_1671.pyAlso removes the stale
xrspatial/geotiff/tests/CLUSTER_AUDIT.mdthat PR 1 (#2394) left behind on main when its final cleanup commit landed after the merge.find xrspatial/geotiff/tests -name 'test_*.py' | wc -ldrops from 356 to 352 (5 deleted, 1 added).Notes
xfailintest_vrt_unsupported_2370.pystay underpytest.mark.xfail(strict=False)in the consolidated file (mixed source CRS, mixed source dtype widening). The validator does not yet deliver those rejections; the wrappers will start passing without an edit here when it does.docs/source/reference/release_gate_geotiff.rsthad two citations pointing at deleted files; both are repointed atvrt/test_validation.pysotest_release_gate_cites_only_existing_test_filesstays green.xrspatial/geotiff/tests/CLUSTER_AUDIT_PR2.mdlands with this commit and will be deleted in a follow-up commit on this branch before merge per the epic contract.xrspatial/geotiff/source modules.Test plan
pytest xrspatial/geotiff/tests/vrt/test_validation.py -v-- 81 passed, 2 xfailedpytest xrspatial/geotiff/tests/ -x -q-- 5709 passed, 68 skipped, 6 xfailed, 1 xpassed