Skip to content

test(engine): cover city models, KMZ and GeoPackage in the loss corpus - #2387

Merged
Mavrick-F merged 1 commit into
opengeos:mainfrom
Mavrick-F:test/reader-loss-table
Nov 18, 2026
Merged

Mavrick-F merged 1 commit into
opengeos:mainfrom
Mavrick-F:test/reader-loss-table

Conversation

@Mavrick-F

@Mavrick-F Mavrick-F commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Summary

The never-silent reading corpus accepted only text, leaving binary and archive reader paths outside its paired clean/lossy checks. Accept byte fixtures and add GeoPackage PointZ, CityJSON and CityGML varying line heights, plus every existing KML loss case through KMZ.

The GeoPackage fixture encodes its point independently of RustGIS’s 2D exporter. KMZ cases are derived from the KML rows so future additions exercise both containers. Each case checks that the lossy file reports its loss (or refuses it with a reason) and the clean file does not report that loss. Existing known-silent cases retain their expectations.

This is a first slice of the roadmap’s reader-loss corpus, not complete coverage of those formats. No production behavior, dependencies, saved formats or command interfaces change.

Surfaces: exercises the shared engine through layer.addData, used by desktop, CLI, Python and agent callers. The browser upload command is not exercised by this native test; phone/UI controls, ribbon placement, shortcuts, plugin interfaces and Undo behavior are unchanged.

Testing

  • cargo test --locked -p rustgis-engine --test never_silent_reading: passed, including every clean/lossy pair (0.03 seconds test runtime).
  • cargo clippy --locked -p rustgis-engine --all-targets -- -D warnings: passed.
  • Formatting and commit hooks passed.
  • Full fork CI on this head: passed workspace tests, lint, layers, schema, wasm and licenses.

UI evidence

No visible UI change.

Related issue

ROADMAP.md → Correct results: lossy sample files for readers outside the never-silent corpus.

Summary by CodeRabbit

  • Tests

    • Expanded checks for reading KMZ, CityJSON, CityGML, and GeoPackage files, including cases where height data may be lost.
    • Test results now identify the file associated with a failure.
  • Documentation

    • Updated the roadmap to reflect current format coverage and outstanding work for lossy file conversions.

@coderabbitai

coderabbitai Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The reading test harness now handles byte-based fixtures and tests KMZ, CityJSON, CityGML, and GeoPackage height-loss cases. The roadmap and test documentation reflect the updated coverage.

Changes: Lossy Reading Test Coverage

Layer / File(s) Summary
Byte-based cases and fixture inputs
crates/engine/tests/never_silent_reading.rs
Test cases now store file contents as bytes. The case builder accepts a fixture directory, and read accepts byte slices.
Additional format and height-loss cases
crates/engine/tests/never_silent_reading.rs, ROADMAP.md
The test corpus adds KMZ cases from KML cases, plus CityJSON, CityGML, and GeoPackage height-loss cases. The test documentation and roadmap describe the updated coverage.
Case-specific test diagnostics
crates/engine/tests/never_silent_reading.rs
Failure messages identify the case and file. The existing checks for clean reads, notices, refusals, crashes, and layer addition remain.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Possibly related PRs

Suggested reviewers: flight1973, giswqs, jgregoriorincon

Merge Risk: Minimal · up to 76855

This PR only extends test coverage for lossy-reading cases and updates the roadmap. It does not change production behavior, so merge risk is minimal.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title uses the conventional test(scope) prefix and names the three concrete additions: city models, KMZ, and GeoPackage in the loss corpus. The raw summary and objectives confirm that the change a…
Description check Passed The description follows the template sections (Summary, Testing, UI evidence, Related issue). The Summary explains what changed and why. Testing lists the commands run and their results. UI evidence s…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title uses the conventional test(scope) prefix and names the three concrete additions: city models, KMZ, and GeoPackage in the loss corpus. The raw summary and objectives confirm that the change adds CityJSON/CityGML height-loss cases, KMZ cases derived from KML, and GeoPackage PointZ coverage to the never-silent reading corpus. It is specific and matches the main change.

Full details: Description check

Explanation

The description follows the template sections (Summary, Testing, UI evidence, Related issue). The Summary explains what changed and why. Testing lists the commands run and their results. UI evidence states 'No visible UI change.', as the template allows. Related issue links the ROADMAP.md entry, though it does not use the template's Closes/Part of wording. Overall the description is mostly complete.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

A rabbit checks each file with care
Bytes and fixtures join the run
KMZ brings its KML pair
Height-loss cases add to the set
The roadmap notes what tests now cover
Then hops away beneath the sun

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 3958f240-7127-438f-824f-2a60027cbee3
Commits

Reviewing files that changed from the base of the PR and between a60c9c9 and 76855da.

Files selected for processing: 2

  • ROADMAP.md
  • crates/engine/tests/never_silent_reading.rs

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 3 remain after this review.

@github-actions

Copy link
Copy Markdown
Contributor

Code review

Verdict: no bugs, security issues or AGENTS.md violations found. The new cases look right on reading. I did not compile or run the tests, since this review is read-only.

Bugs: none found. Checked:

  • CityJSON and CityGML varying-height lines reach heights_differ → z_dropped → the "Z or M" notice (crates/data/src/citymodel.rs:781-814). The CityJSON unit test at crates/data/src/cityjson/tests.rs:565-588 covers the same path. Confidence: high.
  • The hand-built GeoPackage blob is valid: GP magic, version 0, flags 0x01 (little-endian header), SRS 4326, WKB type 1001 for PointZ, and application_id 1196444487 (GPKG). Confidence: high.
  • The KMZ derivation matches the zip::write(&[(String, Vec<u8>)]) -> Result<_, String> signature, Expect is Copy, rusqlite is already a dev-dependency, and rustgis_engine::data re-exports rustgis_data. Confidence: high.

Security: none. Test-only change, no new dependencies, no input handling in production code.

Performance: none. The fixtures are a few hundred bytes each.

Quality (nits, low severity):

  • gpkg() (never_silent_reading.rs:398-424) opens a fixed, pid-named file without removing a stale copy first. If one is left over, CREATE TABLE fails and the unwrap panics the test instead of reporting a result. Suggested fix: let _ = std::fs::remove_file(&path); before Connection::open. Confidence: medium that it is real, low that it ever triggers.
  • The temp root is only removed at the end of the test (line 506), so a panic in the fixture helpers leaves it behind. Confidence: high, negligible impact.
  • ROADMAP.md now lists FileGDB as a reader still needing cases. It was not in the previous list. This is accurate, but it is a scope change worth confirming. Confidence: high.

AGENTS.md: compliant. The unwraps are in test code, the change touches no saved format (so no schema or fixture update is needed), there is no UI or wasm impact, and no assets were added. The PR body states its surfaces.

Prior review threads: none on this PR, so no earlier concerns were left alone. I posted no inline comments: the only items are the low-severity nits above.

Change size

Compared with the base branch: the whole PR against main (merge base a60c9c9 to PR head 76855da).

Measure Value
Files changed 2 (added 0, modified 2, removed 0, renamed 0)
Size before 39.1 KB (40,046 B)
Size after 43.4 KB (44,406 B)
Total size change +4.3 KB (+4,360 B)
Path Before After Change
crates/engine/tests/never_silent_reading.rs 19.5 KB 23.7 KB +4.2 KB
ROADMAP.md 19.6 KB 19.6 KB +61 B

@Mavrick-F

Copy link
Copy Markdown
Member Author

FileGDB is intentionally listed: it is a supported reader outside this corpus and belongs in the remaining-coverage inventory. This PR adds no FileGDB implementation or fixtures.

The two temporary-file cleanup suggestions are left for the release quality pass. The test retains the existing PID-based directory lifecycle; neither suggestion changes the paired reader-loss checks, which pass on this head.

@github-actions

Copy link
Copy Markdown
Contributor

📖 Docs preview

Item Value
Preview https://preview.rustgis.app/pr-2387/
Web app https://preview.rustgis.app/pr-2387/app/
Commit 76855da

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 preview label (once per commit).

@Mavrick-F
Mavrick-F added this pull request to the merge queue Nov 18, 2026
Merged via the queue into opengeos:main with commit 99c9f31 Nov 18, 2026
24 checks passed
@Mavrick-F
Mavrick-F deleted the test/reader-loss-table branch November 18, 2026 06:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant