Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

verifyPaparazzi false positives when running testDebug with Gradle caching enabled, becomes unreliable with Gradle Configuration Cache #388

Closed
mateuszkwiecinski opened this issue Mar 13, 2022 · 6 comments
Milestone

Comments

@mateuszkwiecinski
Copy link

Repro:

  1. Have recorded screenshots and org.gradle.caching=true enabled
  2. Modify the UI
  3. run ./gradlew testDebug - task succeeds
  4. run ./gradlew verifyPaparazziDebug - tasks succeeds despite it should fail because the UI has been modified

looking at the details, when invoking step 4) testDebug does not run with because their inputs hasn't been modified
image
which then ignores properties set by Paparazzi Gradle Plugin

systemProperties["paparazzi.test.record"]
systemProperties["paparazzi.test.verify"]

this also may lead to even more unexpected behaviour if one have --configuration-cache enabled - it seems like the system properties are cached, which means invoking recordPaparazziDebug before any other task will always pass paparazzi.test.record=true to test task, which in my case led to verifyPaparazzi recording new screenshots.

@jrodbx
Copy link
Collaborator

jrodbx commented Mar 18, 2022

Possibly related to gradle/gradle#19710?

I'm curious as to whether downgrading to 7.3.3 or 7.4.1 fixes the underlying issue.

@jrodbx
Copy link
Collaborator

jrodbx commented Mar 18, 2022

Are you using Paparazzi 0.9.3 or latest SNAPSHOT?

@mateuszkwiecinski
Copy link
Author

Thanks for reply 🙏

I'll describe the scenarios I'm testing right now:

  1. Run ./gradlew testDebug
  2. View generated report
  3. Modify string visible on the UI
  4. Run ./gradlew testDebug
  5. View updated report
  6. Revert the UI change
    and then either:
    7a. Run ./gradlew recordPaparazzi
    7b. Run ./gradlew testDebug

In scenario 7a I expect screenshots to be recorded
In scenario 7b I hoped I could save some time and leverage remote build cache to avoid running tests that weren't changed. I expect to see the task either up-to-date or fetched from-cache.

I definitely observe behaviour change between Gradle 7.3.3 and 7.4.
7.4.1 - testDebug is FROM_CACHE which means there are no screenshots recorded (build scan) - it passes scenario 7b, but fails on 7a
7.3.3 - testDebug is never fetched from cache, it always gets executed. Build scan reveals candidateClassFiles and stableClasspath inputs being changed (build scan) - it passes scenario 7a, but fails on 7b
so I should probably expect: is such behavior expected? Is the cacheability "disabled" by design, as a result of how Paparazzi integrates with testing framework? Seeing just the behaviour on 7.3.3 I'd report the task isn't cacheable 😛

Are you using Paparazzi 0.9.3 or latest SNAPSHOT?

I'm using the latest Snapshot. Which at this very moment is whatever being published from the main branch.

@dannyroa
Copy link

dannyroa commented Apr 6, 2023

Just tried on 1.3.0-SNAPSHOT and I don't get false positives anymore.

@TWiStErRob
Copy link
Contributor

Very likely fixed by #690

@jrodbx jrodbx added this to the 1.3 milestone May 3, 2023
@jrodbx
Copy link
Collaborator

jrodbx commented May 3, 2023

Fixed by #690

@jrodbx jrodbx closed this as completed May 3, 2023
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

No branches or pull requests

4 participants