Skip to content

test(engine): a streamed export's Z/M loss is said in the read's words - #2237

Closed
giswqs wants to merge 1 commit into
mainfrom
fix-zm-stream-test
Closed

giswqs wants to merge 1 commit into
mainfrom
fix-zm-stream-test

Conversation

@giswqs

@giswqs giswqs commented Nov 15, 2026 •

Copy link
Copy Markdown
Member

tests::dropped_z_values_are_said_on_import_and_export fails on main (all three nextest tries), which blocks the v0.7.0 release PR #2232. Runs on main kept being cancelled by newer pushes, so it went unnoticed.

Cause: #2196 made an export of a layer read in place keep the counted note its fresh read gives (out.geojson: wells: 1 feature had Z or M values (heights or measures), which were dropped: …) instead of also giving the generic its geometry has no Z or M values warning (coalesce_read_zm in crates/engine/src/cmd/share.rs). The loss is still reported, in the reader's words. The test still looked only for the generic text in the stream: true case.

Fix: for the streamed case the test accepts the counted zm_note(Some(1)) as well. A layer read whole must still give the export's own warning, and a 2D layer's export must still say nothing about Z or M. Test-only change; the product behaviour is what #2196 intended.

Reaches: tests only.

Summary by CodeRabbit

  • Tests
    • Updated export notice checks to accept the applicable geometry warning or counted Z/M note, including stream exports.

#2196 made an export of a layer read in place keep the counted note its
fresh read gives ("1 feature had Z or M values ... dropped") in place of
the generic "its geometry has no Z or M values" warning
(coalesce_read_zm). dropped_z_values_are_said_on_import_and_export
still looked only for the generic text, so it has failed on main since.
Accept the counted note for the streamed case; a layer read whole must
still give the export's own warning, and a 2D layer nothing.
@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 export test now accepts the no-Z/M warning or, when streaming is enabled, the counted note for one feature. Comments distinguish whole-layer reads from in-place reads.

Changes: Export notice test

Layer / File(s) Summary
Update export notice assertion
crates/engine/src/tests.rs
The test accepts the no-Z/M export warning or the counted note for one feature when streaming is enabled. Comments distinguish whole-layer and in-place reads.

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

Change: Other

Suggested reviewers: elpidioassinaturas, mavrick-f, choupeanut

Merge Risk: Minimal · up to a09bd

This updates a test to match the existing notice behavior for streamed reads. It does not change production behavior, and no merge-blocking risk was identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the change: a test-only update to the streamed export Z/M loss message, so the test expects the read's wording. It is specific to the main change in the summary and objectives, which a…
Description check Passed The description covers the cause (#2196 changed coalesce_read_zm behavior so an in-place export keeps the counted note), the fix (test accepts zm_note(Some(1)) for the streamed case), and what must st…
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 names the change: a test-only update to the streamed export Z/M loss message, so the test expects the read's wording. It is specific to the main change in the summary and objectives, which accept the counted zm_note(Some(1)) message for stream: true. The title's 'said in the read's words' phrasing is a bit terse, but it is related and not misleading.

Full details: Description check

Explanation

The description covers the cause (#2196 changed coalesce_read_zm behavior so an in-place export keeps the counted note), the fix (test accepts zm_note(Some(1)) for the streamed case), and what must still hold (whole-layer read still gives the export warning; 2D layer says nothing about Z/M). It states the change reaches tests only. The template's Testing section is not filled in: it does not name how the change was verified beyond nextest tries on main, and the Summary is present. The UI evidence section is missing its 'No visible UI change.' line—actually it is present as 'No visible UI change.' in the template and the author left it. The Related issue section is absent, though it references PR #2232 and #2196 in prose and does not use the 'Closes/Part of' form. 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 the notice line,
Two messages pass the test just fine.
The stream counts one, the whole layer reads,
A tidy check for both these leads.
The rabbit hops through green test fields.

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: 71b62973-3979-4c5b-8086-e152645f2a6d
Commits

Reviewing files that changed from the base of the PR and between 67a99f2 and a09bd7e.

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; 6 remain after this review.

@github-actions

Copy link
Copy Markdown
Contributor

Code review

I found no bugs, security issues, performance problems, or AGENTS.md violations in this PR. I posted no inline comments.

Bugs: none.

  • The new predicate accepts the counted note only when stream is true. The whole-layer branch (stream: false) still has to produce the export's own generic warning, so that path stays covered.
  • The counted text matches what the reader emits. zm_note(Some(1)) is the same helper that source/mod.rs:185 uses for streamed reads, and the test's fixture has one Z-bearing feature. coalesce_read_zm (share.rs:687) removes only the generic note, and only when zm_noted is set, so the counted note survives there.
  • The 2D Cities check at the end of the test is unchanged and still requires no Z/M text.
  • The data.convert assertion reuses the same predicate, so it also accepts either note in the streamed case. That is consistent with coalesce_read_zm being called on the convert path too (workflows.rs:1938).

Security: none. Test-only change.

Performance: none.

Quality: nothing worth raising. The predicate is a loose disjunction, and it could be tightened to match the layer name, but the counted note text doesn't carry the name, so that would need a different helper. That is a release-quality-pass item at most, and I did not post it.

AGENTS.md:

  • The "Test both ways" rule is met: the lossy streamed case gets the counted note, and the clean 2D case gets no note.
  • The description says "Reaches: tests only", which is enough for a test-only fix.
  • I could not run the test here (no build or network access). The fix is inferred from the code and the PR description, so CI's nextest result is the real confirmation.

Prior reviews: none on this PR, so there were no earlier concerns to leave alone.

Change size

Compared: the whole PR against main (merge base 67a99f2 to PR head a09bd7e).

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.91 MB (3,056,695 B)
Total size change +316 B
Path Before After Change
crates/engine/src/tests.rs 2.91 MB 2.91 MB +316 B

@github-actions

Copy link
Copy Markdown
Contributor

📖 Docs preview

Item Value
Preview https://preview.rustgis.app/pr-2237/
Web app https://preview.rustgis.app/pr-2237/app/
Commit a09bd7e

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

@giswqs

giswqs commented Nov 15, 2026

Copy link
Copy Markdown
Member Author

Superseded by #2231, which fixed the same test on main (and checks the exact notice text).

@giswqs giswqs closed this Nov 15, 2026
@giswqs
giswqs deleted the fix-zm-stream-test branch November 15, 2026 22:05
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