Repository navigation
test(engine): cover Shapefile Z/M reader losses - #2420
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
| Imported("Z or M"), | ||
| ), | ||
| ]); | ||
| // Independently encoded shapes: scalar Z, scalar M, and arrays with/without optional M. |
There was a problem hiding this comment.
Test coverage (medium confidence): these fixtures are small, so layer.addData takes the whole-file path (io::read_shapefile_parts). Files over the size threshold go through ShpSource::open_path (crates/data/src/source/mod.rs:439), which decides Z/M loss from the header's shape type (crates/data/src/source/shp.rs:211), not from each record. None of the four new cases reaches that path, and the only existing in-place Z/M check (crates/data/src/io.rs, ~line 5055) covers PointZ alone. Line-Z, PointM and PolylineZM are not tested on the in-place path.
Either add an in-place case for types 13 and 21, or say in SHAPEFILE.md / the ROADMAP line that the large-file reader is out of scope for this corpus. This is not a blocker for the PR as written.
There was a problem hiding this comment.
Confirmed: these tiny fixtures exercise whole-file imports, not the size-triggered in-place ShpSource path. The PR description now states that limit explicitly. The in-place header logic includes types 13 and 21, but this corpus does not test that path; additional in-place cases and fixture-note clarification are left for the release quality pass.
Code reviewBugs: None found. I traced the new cases through the reader code and they check out:
Security: None. Only test fixtures and documentation changed, with no parsing or input-handling changes. Performance: None. Quality:
AGENTS.md: Compliant on everything I checked. Both ways are tested; the lossy fixtures produce the notice and the clean ones do not. Every new binary file is covered by the Already raised: 0. Change sizeCompared with
|
|
The PR description now explicitly limits this slice to whole-file imports; in-place coverage is deferred as noted inline. Consolidating fixture shape-type decoding/names and adding layout assertions for these fixed valid fixtures are also left for the release quality pass. The independently encoded layout and exact XY/ID results have already been checked; no production reader behavior changes here. |
📖 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 |
Summary
Extend the reader-loss corpus through
layer.addDatawith four independently byte-encoded Shapefile pairs: PointZ height, PointM measure, PolylineZ arrays without optional M, and PolylineZ with Z/M arrays. Each valid lossy input must import and reportZ or M; each clean XY partner must import without that loss notice. Check exact XY geometry and ID attributes through both the native reader and the engine command.Allow binary, pair-specific sidecars in the existing harness so each input gets a matching
.shx; retain MapInfo coverage. The binary files total 1,784 bytes. Document their byte layout and attribution and narrow the roadmap remainder. No production reader or encoding changes, new dependencies, or command interfaces.Surface coverage: exercises the shared native engine command used by desktop, CLI and Python. Browser Services/file upload, touch UI, ribbon/shortcuts/search, Assistant/MCP and plugins are unchanged and are not exercised by this filesystem corpus. No new state or action needs undo/removal/reopening behavior. These tiny fixtures exercise whole-file imports (
io::read_shapefile_parts), not the size-triggered in-placeShpSourcereader. Large-file/in-place coverage and other Shapefile loss kinds remain outside this slice.Testing
cargo fmt --all,cargo test -p rustgis-engine --test never_silent_readingandcargo clippy -p rustgis-engine --test never_silent_reading -- -D warningspassed through the host wrapper and queue.2679ffb2c: Linux tests, schema, pre-commit lint, wasm32 and licences. Browser build validation is supplied there; the new integration cases use native filesystem paths.ci:windowsrequests Windows validation of the file fixtures.UI evidence
No visible UI change.
Related issue
Continues the Correct results roadmap's per-format reader-loss corpus after #2387, #2404 and #2412. This is limited to Shapefile Z/M fixtures; #2325, #2396 and #2389 retain their existing scope.
Summary by CodeRabbit
Documentation
Tests