Add regression tests for the bug classes that escaped 0.4.x CI#87
Merged
Conversation
Adds four targeted tests for bug classes that escaped CI during the 0.4.0-0.4.4 release cycle: 1. tests/test_snow_index.py: multi-orbit calc_delta_cross_ratio with disjoint time sets and a single-acquisition orbit (T021-shape). Would have caught the read-only-buffer regression under numpy 2.x + newer xarray (fixed in #85). 2. tests/test_wetsnow.py: multi-timestep flag_wet_snow snowcover-mask coverage. Asserts wet_snow is 0/NaN wherever snowcover is False across ALL timesteps, not just the last. Would have caught the stale-`ts` bug (#79). 3. tests/test_generating_dataarrays.py: non-CONUS smoke test for generate_forest_fraction_dataarray. Mocks download_proba_v to a small synthetic tif and runs both the no-ref and with-ref branches. Would have caught the missing-arg/OOM/clip_box class (#79, #80, #85). 4. tests/test_pipeline_synthetic.py (new file): runs the entire post-download pipeline (preprocessing -> snow-index -> wet-snow) against a synthetic multi-orbit + single-acquisition dataset. Offline counterpart to the integration test we still don't run in CI; catches regressions in the s1 preprocessing -> snow-index -> wet snow chain without network or Earthdata creds. All 77 unit tests pass (was 73 before these additions). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Adds four targeted tests for the bug classes that leaked through to released versions during the 0.4.0-0.4.4 cycle. All run as pure unit tests — no network, no Earthdata creds — and would have flagged the regressions on PR rather than in user-facing crashes.
What's covered
What's still NOT covered
Future work for higher confidence: either run `RUN_INTEGRATION=1` in CI (needs Earthdata creds), or record a tiny real-data fixture for the post-download pipeline test.
Test plan
🤖 Generated with Claude Code