Skip to content

test(render): accept a blended text edge in the turned label background check - #1016

Merged
giswqs merged 1 commit into
mainfrom
fix/mac-label-background-test
Oct 27, 2026
Merged

giswqs merged 1 commit into
mainfrom
fix/mac-label-background-test

Conversation

@giswqs

@giswqs giswqs commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

Fixes the macOS failure on main (run 40492312989): a_background_fills_behind_the_text_and_keeps_other_labels_off read pixel (183, 183, 0) at the turned label's middle, an anti-aliased glyph edge over the yellow background. Which glyphs fall there depends on the platform's font. The check now asks that the pixel isn't the grey map (blue < 40), which the background, the text and their blend all pass.

Summary by CodeRabbit

  • Tests
    • Updated a rendering test to verify that a turned label’s center pixel is not blue.

…nd check

On macOS the system font puts an anti-aliased glyph edge at the turned
label's middle, a yellow-black blend (183, 183, 0) that is neither the
background nor the text, so main's macOS test failed. Check instead that
the pixel is not the grey map: the background, the text and their blend
all have no blue.
@giswqs giswqs added the ci:macos Run the macOS CI jobs on this pull request label Oct 27, 2026
@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

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: d5bee75b-c960-4e61-81d9-926c4de4cb7a
Commits

Reviewing files that changed from the base of the PR and between 4e5ea10 and 29b28a0.

Files selected for processing: 1
  • crates/render/src/lib.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.

Walkthrough

The turned-label test replaces its yellow-or-dark center-pixel expectation with an assertion that the pixel’s blue channel is below 40.

Changes: Turned-label test

Layer / File(s) Summary
Center-pixel assertion
crates/render/src/lib.rs
The test now asserts that the center pixel’s blue channel is below 40.

Priority: Low

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Other

Possibly related PRs

  • opengeos/RustGIS#1007: This PR adds the label background behavior and introduces the test updated here.

Suggested reviewers: pick2510

Merge Risk: Minimal · up to 29b28

The focused test assertion is valid and introduces no identified merge-blocking risk.

Pre-merge checks: Passed 3 · Failed 1 · Inconclusive 1

Failed Failed checks: 1 warning · 1 inconclusive

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within survi… Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check Inconclusive The description states the failure, the platform (macOS), the CI run, and the cause (an anti-aliased glyph edge over the yellow background that depends on the platform font). It also explains the fix:… Add a Testing section that states how the change was verified. Examples: the command run (such as cargo xtask ci or cargo test for the render crate), or confirmation that the test passes on macOS. Add a Related issue section. Link the faili…
Passed Passed checks: 3 passed
Check name Status Explanation
Title check Passed The title is clear and specific. It names the scope (test(render)) and the change (the turned label background check now accepts a blended text edge). The raw summary and PR objectives both describe t…
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 is clear and specific. It names the scope (test(render)) and the change (the turned label background check now accepts a blended text edge). The raw summary and PR objectives both describe this same change to the a_background_fills_behind_the_text_and_keeps_other_labels_off test, so the title matches the changeset.

Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 1 files.

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Full details: Description check

Explanation

The description states the failure, the platform (macOS), the CI run, and the cause (an anti-aliased glyph edge over the yellow background that depends on the platform font). It also explains the fix: the check now asks that the pixel is not the grey map (blue < 40). This covers the Summary section of the template. The description does not include a Testing section (for example, how the fix was verified, such as running cargo xtask ci or the test locally) and does not include a Related issue section (for example, a link to the failing run or an issue). These are missing template sections.

Resolution

Add a Testing section that states how the change was verified. Examples: the command run (such as cargo xtask ci or cargo test for the render crate), or confirmation that the test passes on macOS. Add a Related issue section. Link the failing macOS CI run (run 40492312989) or any tracking issue, or state that none exists.

Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 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 pixel’s hue,
And sees the blue fall under two-score.
The turned label rests in view,
While tests keep watch beside the door.
Then hops away to nibble greens,
Beneath the moon’s soft silver sheen.

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

Code review

I reviewed the single changed file, crates/render/src/lib.rs, a one-assertion test change. I read the surrounding test, the drawn/yellow/blue helpers, and the repo's rustfmt.toml. I did not run the test; this review is by reading only.

Bugs: None found. The new check pixel(60, 50).blue() < 40 still fails if the label draws nothing there, because the map is grey (128,128,128). The next assertion (yellow count > 100) still guards that the background is drawn. The failing macOS pixel (183,183,0) has blue 0, so it passes. Confidence: high.

Security: None. Test-only change.

Performance: None.

Quality: Nit, low severity. The check is now loose: any pixel with blue < 40 passes, so it no longer distinguishes background from text. That looseness is the intended fix for platform-dependent glyph placement, and the yellow-count line covers the background. The comment is accurate: render loads system fonts rather than bundling them (no include_bytes! in the crate), which is why glyph coverage varies by platform. A possible follow-up is a bundled test font, which would make the original tighter assertion deterministic. Confidence: medium.

AGENTS.md: Compliant. The only change is in test code, so the unwrap rule does not apply. The new line is under the repo's max_width = 140. No wasm, layering, asset or translation impact.

No inline comments were posted, because I found no defect worth an inline comment.

Change size

Compared: the whole PR against main (merge base 9ad05db to PR head 29b28a0).

Measure Value
Files changed 1 (added 0, modified 1, removed 0, renamed 0)
Size before 347.2 KB
Size after 347.4 KB
Total size change +162 B
Path Before After Change
crates/render/src/lib.rs 347.2 KB 347.4 KB +162 B

@github-actions

Copy link
Copy Markdown
Contributor

📖 Docs preview

Item Value
Preview https://preview.rustgis.app/pr-1016/
Web app https://preview.rustgis.app/pr-1016/app/
Commit 29b28a0

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

@giswqs
giswqs merged commit c0488c5 into main Oct 27, 2026
33 checks passed
@giswqs
giswqs deleted the fix/mac-label-background-test branch October 27, 2026 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:macos Run the macOS CI jobs on this pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant