tests: align VRT max_pixels tests with #1821 minimal-read semantics#1827
Merged
Conversation
PR #1821 (#1704) made the VRT resample path read only the minimal SrcRect sub-rect that maps to the clipped destination sub-window. Test_vrt_dstrect_resample_cap_1737.py was updated in that PR but two sibling tests asserting the old "full SrcRect rejected by max_pixels" behaviour were missed and now fail in CI on main. test_vrt_source_max_pixels_1796.py: the tiny-VRT-cannot-force-huge- source-decode invariant is now structural (the source read is bounded by the dst sub-window), so the test asserts the positive behaviour (read succeeds, returns 1 pixel) plus a companion test that the per-source cap still fires when the sub-window itself exceeds the budget. test_vrt_source_tile_check_1823.py: TestOutputWindowCheckStillEnforced was checking the OUTPUT WINDOW CHECK with a 1x1 raster and a 4x4 SrcRect; under #1821 the source read shrinks to one pixel and the check no longer fires. Reframed the test to assert that an over-budget OUTPUT EXTENT still rejects via _check_dimensions at the top of read_vrt.
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.
Summary
CI on main has been failing since #1821 (#1704) merged. PR #1821 reads only the minimal SrcRect sub-rect that feeds the clipped destination sub-window for a SimpleSource that needs resampling. That PR updated
test_vrt_dstrect_resample_cap_1737.pyfor the new semantics but missed two sibling tests asserting the old "full SrcRect rejected by max_pixels" behaviour:test_vrt_source_max_pixels_1796.py::test_vrt_source_read_forwards_max_pixelstest_vrt_source_tile_check_1823.py::TestOutputWindowCheckStillEnforced::test_output_window_exceeds_max_pixels_still_rejectedBoth expected
ValueErrormatching "exceed" from a VRT that declared SrcRect 4x4 paired with DstRect 1x1 andmax_pixels=1. Under the new path the source read shrinks to one pixel, the per-source cap and the output-window check no longer fire, and the read succeeds.Changes
test_vrt_source_max_pixels_1796.py: rewritten to two tests.test_tiny_vrt_with_huge_srcrect_now_reads_minimallyasserts the new positive invariant (max_pixels=1succeeds, returns 1 pixel).test_source_cap_still_fires_when_sub_window_exceeds_budgetasserts the per-source guard still bites when the sub-window itself crosses the budget.test_vrt_source_tile_check_1823.py:TestOutputWindowCheckStillEnforcedreframed to assert that an over-budget output extent is still rejected by_check_dimensionsat the top ofread_vrt. Module docstring updated to describe the post-#1821 contract.Test plan
pytest xrspatial/geotiff/tests/test_vrt_source_max_pixels_1796.py xrspatial/geotiff/tests/test_vrt_source_tile_check_1823.py -v-- 6 passedpytest xrspatial/geotiff/tests/ -k vrt-- 360 passed (one unrelated GPU-only pre-existing failure)