Skip to content

Update view tests to the new pattern everywhere#1157

Merged
johnboiles merged 4 commits intomainfrom
john/view-test-wait-everywhere
Oct 13, 2025
Merged

Update view tests to the new pattern everywhere#1157
johnboiles merged 4 commits intomainfrom
john/view-test-wait-everywhere

Conversation

@johnboiles
Copy link
Copy Markdown
Contributor

Hopefully this makes view tests more reliable.

I decided to change the pattern from #1155 to instead have WAIT_FOR_DRAW take an optional parameter that determines whether the UI continues to run after. After a weekend of thinking about it I liked this better because then WAIT_FOR_DRAW is the only place that we wait for a draw to occur. It felt a little funky to me to combine WAIT_FOR_DRAW into ASSERT_VIEW_UNCHANGED but only sometimes.

I did this mostly with regexes:

  1. Find the recent new style used only in Kindle tests

    ASSERT_VIEW_UNCHANGED\(display, "([a-zA-Z0-9-_.]*)", true\);
    

    Replace with

    WAIT_FOR_DRAW(display, false);
    ASSERT_VIEW_UNCHANGED(display, "$1");
    
  2. Find WAIT_FOR_DRAW with ASSERT_VIEW_UNCHANGED afterwards

    (^[ ]*)WAIT_FOR_DRAW\(display\);([\s\n]*)ASSERT_VIEW_UNCHANGED
    

    Replace with

    $1WAIT_FOR_DRAW(display, false);$2ASSERT_VIEW_UNCHANGED
    
  3. Sanity check lines with WAIT_FOR_DRAW not followed by ASSERT_VIEW_UNCHANGED or WAIT_FOR_DRAW

    (^[ ]*)WAIT_FOR_DRAW\(display\);[\s\n]*(?!ASSERT_VIEW_UNCHANGED|\s|WAIT_FOR_DRAW)
    

    Check and cleanup manually

@johnboiles johnboiles force-pushed the john/view-test-wait-everywhere branch from 81cfb5e to 35f4445 Compare October 13, 2025 21:34
@johnboiles johnboiles merged commit 3eb9116 into main Oct 13, 2025
13 checks passed
@johnboiles johnboiles deleted the john/view-test-wait-everywhere branch October 13, 2025 22:10
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