-
Notifications
You must be signed in to change notification settings - Fork 688
Migrate Paparazzi to Compose Preview Screenshot testing #3507
Conversation
@@ -1,3 +1,3 @@ | |||
object BuildConfigConstants { | |||
const val IMAGE_DIFFERENCE_THRESHOLD = 0.1f | |||
const val IMAGE_DIFFERENCE_THRESHOLD = 1f |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't that threshold 100%?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm testing with CI/CD so it's not final yet, I'm looking for the closest deviation. Pls wait hehe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No rush^
Nice! Google have added threshold support. A few notes:
|
cae9695
to
ffd5332
Compare
@ILIYANGERMANOV - please ignore this comment for now, i need to check it again
BTW, I have updated the docs for this part. Could you check if anything else is needed? |
Nice work @isaacnguyen0809! I think 2) is a good option. The best choice would be to set 1.3% for all tests and 6% exception for the Disclaimer (e.g. support threshold customization for different tests). Or we can find what makes the Disclaimer screen flaky. Anyway, I'm happy with skipping its tests if my suggestions are too hard to impl |
0598432
to
ae9a725
Compare
6636719
to
3e0b9bc
Compare
@@ -8,7 +8,7 @@ on: | |||
|
|||
jobs: | |||
sceenshot_test: | |||
runs-on: ubuntu-latest | |||
runs-on: windows-latest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@isaacnguyen0809 can we use Linux? What's the benefit of running them Windows? My concern is that GitHub Actions Windows are more expensive => will provide less free instances for open-source projects
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ILIYANGERMANOV
I'm currently running some additional tests, but they've been temporarily paused due to my full-time job.
After multiple checks, I realized the large discrepancies are caused by the execution environment. Since I'm using a MacBook, the base screenshots were created on macOS. When I run the tests on macos-latest
on GitHub Actions, the deviation is minimal, and the tests pass smoothly. However, when running them on windows-latest
or ubuntu-latest
, a few screens have much larger discrepancies, forcing us to raise the allowable threshold.
I’m trying to figure out the maximum allowable threshold for testing across two environments besides macOS. I’m also considering having different thresholds for each module or screen, but I find that pretty inconvenient. We need to think about it some more after i have the data from those tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it, no rush^ I marked the PR with "keep" so the CI won't close it. Take your time :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The screenshot tests must work for all platforms because we have many contributors with different machines
We can re-open it when done |
Pull request (PR) checklist
Please check if your pull request fulfills the following requirements:
main
branch.Description
What's changed?
Risk factors
...
Does this PR close any GitHub issues?
Troubleshooting CI failures ❌
Pull request checks failing? Read our CI Troubleshooting guide.