Repository navigation
test(analysis): compact generated reference geometry - #1361
Conversation
Walkthrough
Pre-merge checks:
|
| text = '{"type":"FeatureCollection","features":[\n' + ",\n".join( | ||
| json.dumps(f, separators=(",", ":")) for f in feats | ||
| ) + "\n]}" |
There was a problem hiding this comment.
Nit (low severity, latent): with no features, ",\n".join(...) is empty, so this writes a blank line inside the array: {"type":"FeatureCollection","features":[ / empty line / ]}. It is still valid JSON, and no current case produces an empty file, so this is not blocking. A small fix that keeps output byte-identical for non-empty layers (so --check is unaffected):
| text = '{"type":"FeatureCollection","features":[\n' + ",\n".join( | |
| json.dumps(f, separators=(",", ":")) for f in feats | |
| ) + "\n]}" | |
| body = ",\n".join(json.dumps(f, separators=(",", ":")) for f in feats) | |
| text = '{"type":"FeatureCollection","features":[' + ("\n" + body if feats else "") + "\n]}" |
There was a problem hiding this comment.
Confirmed with an empty feature list: the output remains valid JSON and parses to an empty FeatureCollection. No current fixture is empty. Leaving this formatting nit for the release quality pass.
Code reviewScope note: Bugs: None found.
Security: None. The change is test fixtures plus a Python writer with no external input. Performance: None. The format change reduces fixture size by about 43%, as the PR states. Quality:
AGENTS.md: No violations found.
Confidence: High that the format change is correct and the Rust side is unaffected. Medium-high on the byte-level equivalence claim, since I could only spot-check it. Prior reviews: The thread list is empty, so there were no earlier concerns to skip. Change sizeCompared with the base branch: the whole PR, merge base 8ebc4ce to PR head 8d291a6.
The table lists the 20 largest changes. The remaining two files, |
|
The local comparison covered all 21 changed expected files against baseline 8ebc4ce, without a diff-size limit: both parsed JSON and every non-whitespace character matched exactly. The generator regeneration/check, full CI (3,390 tests), wasm build and hooks passed before publication. |
|
The walkthrough says the station buffer adds coordinates to complete rings. That fixture is unchanged after parsing against baseline 8ebc4ce, as are all 21 expected files; no coordinates or ring closures were added. The local check also compared every non-whitespace character, without GitHub diff-size limits. The five unavailable diffs are covered by that check and the passing generator consistency workflow. |
📖 Docs preview
GitHub Pages takes a minute or two to publish a new commit. Newer commits from the fork aren't published until a maintainer adds the |
|
@coderabbitai approve |
Action performed
|
Summary
The generated analysis reference outputs, including the buffer outlines added in #1161, spend much of their size on indentation. Write each expected feature on one compact JSON line, keeping feature boundaries visible and retaining every coordinate digit.
The 21 expected-output files shrink from 1,177,604 to 660,899 bytes (43.9%), and from 69,252 to 209 lines. Parsed JSON and all non-whitespace characters match the baseline exactly. Geometry, numeric precision, test tolerances and application behavior are unchanged. This reduces fixture storage; it does not claim faster application performance.
Testing
uv run crates/analysis/tests/reference/generate.py --checkcargo xtask cicargo build --locked --target wasm32-unknown-unknown -p rustgis-webpre-commit run --all-filesUI evidence
No visible UI change.
Related issue
Follow-up to #1161.
Summary by CodeRabbit