Repository navigation
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 5 remain after this review. 📝 WalkthroughWalkthroughChangesPNG test color encoding
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~5 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to The PR narrowly repairs avatar test PNG generation, and no remaining merge-blocking behavior is identified. 🚥 Pre-merge checks | ✅ 24 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (24 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
All contributors have signed the CLA ✍️ ✅ |
The avatar test helpers fill a bitmap with
`color.usingColorSpace(.deviceRGB)`. For `NSColor.green` that conversion
gives a color `NSBitmapImageRep.setColor` rejects ("Unrecognized colorspace
number -1"), so every pixel stays transparent. The renderer then correctly
falls back to the placeholder symbol, and the tests that expect a green
picture fail.
Rebuild each color from its components with `NSColor(deviceRed:green:blue:alpha:)`
before writing it. A standalone probe shows the old call leaves 0,0,0,0 and
the new one writes green.
7018fb5 to
5582f6e
Compare
|
Thanks for tracking this one down! Main picked up the same fix in c8bfb58, so I'm closing this as done. Really appreciate all the test cleanup :) |
Summary
Four account avatar tests fail because their test images are fully transparent:
hostedRequestRendersPictureThroughSharedRenderer,circularImageCenterCropsWideSourceAtRequestedScale,circularImageCenterCropsTallSourceandcircularImageClipsCornersInsideTheBitmap. Each expects green pixels and reads zeros.Both test helpers fill a bitmap with
color.usingColorSpace(.deviceRGB). ForNSColor.green,NSBitmapImageRep.setColorrejects that converted color ("Unrecognized colorspace number -1") and writes nothing. A standalone probe on macOS 26.6 arm64 reads back 0,0,0,0 for that call and green forNSColor(deviceRed: 0, green: 1, blue: 0, alpha: 1). The renderer then correctly falls back to the placeholder symbol.The helpers now rebuild each color from its components with
NSColor(deviceRed:green:blue:alpha:)before writing it. Product code is unchanged.Testing
StackAccountAvatarViewTestsandStackAccountAvatarImageLoaderTestson an EC2 Mac (Xcode 26.6, macOS 15.7) throughscripts/ci/run-app-host-xcodebuild.sh, the way CI runs app-host tests. At main4638e5b1eaplus the compile fixes in Fix the compile errors that keep main and its unit tests from building #12584, both suites fail on the four tests above. With this change on the same base, both suites pass.setColor(NSColor.green.usingColorSpace(.deviceRGB))and green aftersetColor(NSColor(deviceRed: 0, green: 1, blue: 0, alpha: 1)).Demo Video
Not applicable. The change only affects unit tests.
Review Trigger (Copy/Paste as PR comment)
Checklist
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by cubic
Fixes four account avatar tests that failed because their test images were fully transparent. Test helpers now rebuild each color with
NSColor(deviceRed:green:blue:alpha:)before writing it to the bitmap, so the expected green pixels are actually written instead of being rejected bysetColorand left transparent. Product code is unchanged.Written for commit 5582f6e. Summary will update on new commits.
Summary by CodeRabbit
Bug Fixes
Tests