Skip to content

tests: isolate the camera preview blit test on its own screen - #291

Merged
ThomasFarstrike merged 1 commit into
MicroPythonOS:mainfrom
bitcoin3us:fix/campreview-test-isolation
Sep 3, 2026
Merged

ThomasFarstrike merged 1 commit into
MicroPythonOS:mainfrom
bitcoin3us:fix/campreview-test-isolation

Conversation

@bitcoin3us

Copy link
Copy Markdown
Contributor

Fixes the CI failure on main (Build LVGL MicroPython on Linux for arm64 → Run unit tests, run 33729558187): tests/test_graphical_campreview_scaleblit.py, added in #285, is order-dependent — sorry about that.

Cause: the test placed its image on lv.screen_active() and sampled fixed coordinates. Run alone it starts on a bare screen and passes; in the full-suite process an earlier graphical test leaves a screen with a layout active, which repositions the child, so the sampler read background pixels (the grays in the CI assertion). The 1:1 control additionally sat centered inside the 240 px preview-sized widget box (a scaled image is placed about its pivot), so its bars read offset by exactly one bar.

Fix (test only, no runtime code touched):

  • each test loads its own bare screen and restores the previous one in tearDown,
  • samples relative to the image's actual position,
  • the 1:1 control sizes the widget to its content.

Verified: passes alone, passes after other graphical tests, and the whole tests/test_graphical_*.py set (67 files) passes in one runner invocation like CI.

🤖 Generated with Claude Code

test_graphical_campreview_scaleblit.py failed in CI (main @ a7cf4e8)
when run after other graphical tests in the same process: it placed
the image on whatever screen was active, and a leftover screen with a
layout repositioned the child, so the sampler read background pixels.
Run alone it started on a bare screen and passed.

- Load a fresh bare screen for each test and restore the previous one.
- Sample relative to the image's actual position.
- For the 1:1 control, size the widget to its content: a scaled image
  is placed about its pivot, so unscaled content sat centered (offset by
  one bar) inside the larger preview-sized box.

Verified passing both alone and after other graphical tests.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ThomasFarstrike
ThomasFarstrike merged commit d02aa7e into MicroPythonOS:main Sep 3, 2026
13 checks passed
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.

2 participants