Skip to content

test: verify counted loss notices for every export - #2231

Merged
giswqs merged 1 commit into
mainfrom
fix/release-sweep-closeout-2026-11-15
Nov 15, 2026
Merged

giswqs merged 1 commit into
mainfrom
fix/release-sweep-closeout-2026-11-15

Conversation

@giswqs

@giswqs giswqs commented Nov 15, 2026 •

Copy link
Copy Markdown
Member

Summary

The Linux regression in #2196 expected the old generic Z/M warning after a streamed export. Streamed reads now preserve a more precise counted diagnostic, so the assertion failed despite the loss being reported.

Update the regression to require exactly one output-qualified loss notice for each export and conversion: a counted reader notice for streamed data and the prior-loss notice for resident data. Repeating the export also verifies that each output receives its own complete notice without duplicates.

Testing

  • Rust formatting and diff checks passed.
  • The focused dropped_z_values_are_said_on_import_and_export test is running; its result is pending.
  • Full workspace validation is pending. This PR is submitted before long-running tests finish.

UI evidence

No visible UI change. This first commit only changes a regression test.

Surfaces and provenance

The regression exercises the shared engine export and conversion commands used by desktop, browser, CLI, Python, mobile, Assistant/MCP and plugins. No command interface, saved format or undo behavior changes. No external project code was followed.

Related issue

Follow-up to #2196. Mobile picker review fixes will be added to this same PR when ready.

Summary by CodeRabbit

  • Tests
    • Expanded export and conversion checks to verify that each output receives exactly one path-specific Z/M notice.
    • Added coverage confirming exported geometry retains its values and that notices distinguish streamed input diagnostics from geometry values dropped during non-streamed reads. Also verifies the notice after WKT conversion.

@coderabbitai

coderabbitai Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The test now checks path-specific Z/M notices for streamed and non-streamed exports, confirms exported geometry values, and checks the notice after WKT conversion.

Changes: Z/M notice tests

Layer / File(s) Summary
Export and conversion assertions
crates/engine/src/tests.rs
The test checks one path-specific notice per export and verifies the exported geometry values. It distinguishes the streamed and non-streamed notice text, then checks the path-specific notice after WKT conversion.

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

Change: Other

Suggested reviewers: bearinmindcat, choupeanut, mavrick-f

Merge Risk: Minimal · up to 43534

This PR only updates a regression test for Z/M loss notices on export and conversion. It does not change runtime behavior, so the risk to users is minimal. Merge once the focused test and workspace validation pass.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "test: verify counted loss notices for every export" names the main change: the regression test now requires one output-specific counted loss notice per export and conversion. It is specific…
Description check Passed The description has a Summary that explains the cause (the Linux regression in #2196 after streamed exports) and the change (one output-qualified loss notice per export and conversion, plus a repeat-e…
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 "test: verify counted loss notices for every export" names the main change: the regression test now requires one output-specific counted loss notice per export and conversion. It is specific and matches the summary and objectives. It is concise and free of noise.

Full details: Description check

Explanation

The description has a Summary that explains the cause (the Linux regression in #2196 after streamed exports) and the change (one output-qualified loss notice per export and conversion, plus a repeat-export check). The Testing section lists formatting checks and a pending focused test, with the full workspace validation still pending. The UI evidence section states no visible UI change, as the template allows. The Related issue section references follow-up to #2196. The template's Testing and Related issue sections are filled in only partly, and the Related issue section does not use the template's "Closes" or "Part of" wording. Overall the description is mostly complete.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • 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 notice line,
Two export paths report just fine.
The geometry keeps its pair,
WKT gets a notice there.
Then hops away to nibble clover.

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: 98585ddb-c935-405e-8154-2dd871729aeb
Commits

Reviewing files that changed from the base of the PR and between 225f9b6 and 43534f5.

Files selected for processing: 1

  • crates/engine/src/tests.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.

} else {
"its geometry has no Z or M values, which were dropped when wells was read".into()
};
assert_eq!(notes, [&format!("{}: {loss}", path.display())], "stream {stream}");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Likely failing for stream == true. The streamed GeoJSON and CSV paths never see the counted reader note, so this exact-match assertion should fail on the first export.

Why: share.exportLayer takes the chunk branch for streamed .geojson (export::streams includes geojson and csv; share.rs:723). That branch calls chunk_export() and write_source_to, neither of which carries info.notes. unreadable stays Unreadable::default(), so zm_noted is false and coalesce_read_zm keeps only the generic zm_export_note. The result is "<path>: its geometry has no Z or M values, which were dropped when wells was read", not the wells: 1 feature had Z or M values… text this test expects. data.convert to .csv has the same shape: its chunk branch (workflows.rs:1903-1928) builds notes from export_notes and never reads info.notes.

The counted note only reaches the export on the load_all_counted path (share.rs:724-725, workflows.rs:1930-1943), which streamed GeoJSON and CSV skip.

The PR body also says the focused test result is still pending, so this probably hasn't been run. Please run cargo test -p rustgis-engine dropped_z_values_are_said_on_import_and_export before merging.

Either the chunk branches need to carry the reader's counted Z/M note (and set zm_noted), or the streamed expectation needs to be the generic wording. The comment at lines 23011-23012 ("A counted reader diagnostic replaces the generic export warning") describes behaviour the chunk path doesn't have.

@github-actions

Copy link
Copy Markdown
Contributor

Code review

Bugs

  • Likely failing assertion for streamed inputs (stream == true), confidence ~75%. The chunked export and convert paths for streamed GeoJSON and CSV never read the reader's counted Z/M note. They only emit the generic "its geometry has no Z or M values…" warning, so the new exact-match assertion in dropped_z_values_are_said_on_import_and_export should fail on the first export. Relevant code: crates/engine/src/cmd/share.rs:723-778 and crates/engine/src/cmd/workflows.rs:1903-1943. The PR body says the focused test is still pending, so it has likely not been run. Posted as an inline comment on crates/engine/src/tests.rs:23009.

Security

  • None found. The diff touches only test code.

Performance

  • None found.

Quality

  • The comment at tests.rs:23011-23012 says a counted reader diagnostic "replaces the generic export warning." That is only true on the whole-read path, not the chunked path. Fix it together with the bug above.
  • Nit, grouped: the comment "even after import or an earlier export said it" is hard to parse. Consider rewording it.

AGENTS.md

  • The test code uses unwrap(), which is acceptable in test code.
  • The PR touches no saved format, command, or ribbon, so the "reach every surface" and schema rules don't apply.

Confidence notes

  • I could not compile or run the test, since this environment has no shell.
  • I checked the expected strings against rustgis_data::zm_note and zm_export_note, and they match.
  • No prior review threads existed, so no earlier concerns were skipped.

Change size

Compared: the whole PR against main (merge base 225f9b6 to PR head 43534f5).

Measure Value
Files changed 1 (added 0, modified 1, removed 0, renamed 0)
Size before 2.91 MB (3,056,379 B)
Size after 2.92 MB (3,057,010 B)
Total size change +631 B
Path Before After Change
crates/engine/src/tests.rs 2.91 MB 2.92 MB +631 B

@github-actions

Copy link
Copy Markdown
Contributor

📖 Docs preview

Item Value
Preview https://preview.rustgis.app/pr-2231/
Web app https://preview.rustgis.app/pr-2231/app/
Commit 43534f5

GitHub Pages takes a minute or two to publish a new commit.

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