test: guard the scroll/Vegas card, without depending on logo assets - #404
Merged
Conversation
Re-lands the guard pulled from #359, rebuilt so it cannot fail on inputs that are not the plugin's rendering. Why it exists: check_plugin.py drives every scoreboard in `switch` mode, so its renders come from the full-screen scorebug in sports.py. game_renderer.py -- the scroll/Vegas card renderer -- is imported but never called. Replacing render_game_card, _draw_upcoming_center, _center_gap_width and _logo_slot_width with functions that raise leaves all 16 of hockey's harness renders passing and byte-identical. A harness.json variant setting `*_display_mode: "scroll"` does not help either: those renders come out identical to the switch ones. Why the first attempt failed: it rendered with real logos loaded from the core checkout, and 21 of its 72 goldens differed in CI on the *same* Pillow 12.3.0. The logo files themselves vary between checkouts -- main recently dropped case-colliding duplicate league logos -- so the goldens encoded one machine's asset set rather than the plugin's rendering. The cards are now drawn without logos, leaving the repo's own fonts as the only input. The geometry is still covered: _center_gap_width and _logo_slot_width are computed to lay the card out whether or not a logo is painted. Verified it still bites: widening the centre gap by 2px in the core mixin fails 24 of the 72 cards; on the clean tree all 72 pass, twice in a row. Two details kept from the first version, both deliberate: it asserts the card COUNT rather than only the mismatch count, because a comparison whose inputs quietly went missing reports zero differences and reads as a pass; and it chdir()s to the core, because the plugins' default logo_dir values are relative and resolve only from there.
Contributor
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: 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 |
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 26 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
Down from 21 CI mismatches to 3, all of them baseball's upcoming card -- the only card in the set that draws a clock time. The config set no timezone, so the time rendered in the machine's local zone: America/New_York where the goldens were generated, UTC on the runner. The goldens encoded where they were made rather than what the plugin draws. Pinned to "Etc/UTC", not "UTC": the plugins treat a bare "UTC" as a leftover from an old config write-back bug and override it with the system zone, which would have left the same problem in place while looking fixed. Verified the way the previous attempt was not -- by rendering under other zones rather than hoping CI agrees. The goldens match under TZ=UTC and TZ=America/Los_Angeles as well as locally, and widening the centre gap by 2px still fails 24 of the 72 cards. Also merges main for #403, whose x-propertyOrder fix this branch predated; the property-order guard passes again.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Re-lands the guard I pulled from #359, rebuilt so it cannot fail on inputs that aren't the plugin's rendering.
Why the guard exists
check_plugin.pydrives every scoreboard inswitchmode, so its renders come from the full-screen scorebug insports.py.game_renderer.py— the scroll/Vegas card renderer — is imported but never called. Replacingrender_game_card,_draw_upcoming_center,_center_gap_widthand_logo_slot_widthwith functions that raise leaves all 16 of hockey's harness renders passing and byte-identical.A
harness.jsonvariant setting*_display_mode: "scroll"doesn't help either — those renders come out identical to the switch ones.That gap is not theoretical: three consolidation PRs were each verified as "byte-identical across 176 renders" while not one of those renders touched the file being changed.
Why the first attempt failed CI
It rendered with real logos loaded from the core checkout, and 21 of its 72 goldens differed in CI on the same Pillow 12.3.0. The logo files themselves vary between checkouts —
mainrecently dropped case-colliding duplicate league logos — so the goldens encoded one machine's asset set rather than the plugin's rendering.The fix
Cards are drawn without logos, leaving the repo's own fonts as the only input. The geometry is still covered:
_center_gap_widthand_logo_slot_widthare computed to lay the card out whether or not a logo is painted.Two deliberate details
identical: 24, differing: 0earlier in this work against a baseline that had never rendered, and again a0/0when a worktree failed to create.chdir()s to the core, because the plugins' defaultlogo_dirvalues are relative and resolve only from there.Picks up the existing
scripts/test_*.pyconvention, so CI discovers it with no workflow change. No plugin code changes.