paparazzi icon indicating copy to clipboard operation
paparazzi copied to clipboard

`recordPaparazziDebug` and `verifyPaparazziDebug` tasks are skipped due to "UP-TO-DATE"

Open Dambakk opened this issue 2 years ago • 7 comments

Description

After using paparazzi successfully for some hours, suddenly both ./gradlew verifyPaparazziDebug and ./gradlew verifyPaparazziDebug are skipped with the following output from --info:

Task :lottery:recordPaparazziDebug UP-TO-DATE Skipping task ':lottery:recordPaparazziDebug' as it has no actions. :lottery:recordPaparazziDebug (Thread[Execution worker for ':' Thread 5,5,main]) completed. Took 0.0 secs.

and

Task :lottery:verifyPaparazziDebug UP-TO-DATE Skipping task ':lottery:verifyPaparazziDebug' as it has no actions. :lottery:verifyPaparazziDebug (Thread[Execution worker for ':' Thread 5,5,main]) completed. Took 0.0 secs.

A coworker ran the same commands successfully with the expected results so I guess it has to be some local condition.

Steps to Reproduce I don't know how to reproduce, I try to run clean but cannot get out of this state, and hence not able to figure out the steps to reproduce..

Expected behavior

The commands should record and verify the snapshots.

Additional information:

  • Paparazzi Version: 1.0.0
  • OS: MacOS
  • Compile SDK: 31
  • Gradle Version: 7.3.3
  • Android Gradle Plugin Version: 7.2.1

Dambakk avatar Jun 08 '22 09:06 Dambakk

Huh, now I notice that the same happens if I run ./gradlew :lottery:testDebugUnitTest as well:

Skipping task ':lottery:testDebugUnitTest' as it is up-to-date.
:lottery:testDebugUnitTest (Thread[Execution worker for ':',5,main]) completed. Took 0.04 secs.

So maybe it's not related to paparazzi after all, it just occurred when I was implementing snapshot testing. Any idea what might cause this?

Dambakk avatar Jun 08 '22 12:06 Dambakk

I suspect that it does not relate to the testDebugUnitTest task afterall, I think it was skipped due to no source code changes. It might still be a local issue, but I try to run the task with the --no-build-cache flag and it is still skipped. What else can I try?

Dambakk avatar Jun 14 '22 07:06 Dambakk

I think what you're seeing is just Gradle's incremental build feature

Runnning ./gradlew :lottery:verifyPaparazziDebug --rerun-tasks should force Gradle to rerun everything and show you the output your looking for.

luis-cortes avatar Jun 14 '22 16:06 luis-cortes

Thanks, I wasnt aware of the --rerun-tasks flag. However, applying that flag still gives me the same output:

> Task :lottery:verifyPaparazziDebug
Skipping task ':lottery:verifyPaparazziDebug' as it has no actions.
:lottery:verifyPaparazziDebug (Thread[Execution worker for ':' Thread 4,5,main]) completed. Took 0.0 secs.
producer locations for task group 0 (Thread[Execution worker for ':' Thread 4,5,main]) started.
producer locations for task group 0 (Thread[Execution worker for ':' Thread 4,5,main]) completed. Took 0.0 secs.

Although I can see the previous task running because the flag:

Task ':lottery:testDebugUnitTest' is not up-to-date because:
  Executed with '--rerun-tasks'.

Dambakk avatar Jun 14 '22 18:06 Dambakk

I discovered something! If I make changes to the actual source code (not the test source) the verify task does in fact run and report correctly! I've tried several times and it is consistent on my machine. Can anyone else try to do the same steps:

  • Create a snapshot test of a composable passing in e.g. a string as an argument
  • run the record task
  • run verify for sanity
  • make changes to the input argument
  • run verify again, this should report Success even though the snapshot has changed (and with the --info flag the output says the task has no actions)
  • make a change to the source composable
  • run verify once again, and this time it will fail (as expected) because the verify task is not skipped!

Anyone else experiencing the same thing? What about you, @luis-cortes?

Dambakk avatar Jun 14 '22 18:06 Dambakk

@Dambakk I have the same issue as you and following your step-by-step I experienced the same as you.

Any updates on it? Did anyone try the last SNAPSHOT? I tried but I got a different error.

theomota avatar Jul 07 '22 17:07 theomota

I havent looked more into it, but its currently blocking us from using it if we cant rely on it.

What error did you get on the snapshot version, @theomota?

Dambakk avatar Jul 08 '22 07:07 Dambakk

@Dambakk i was able to reproduce this in this commit using the recipe outlined here: https://github.com/cashapp/paparazzi/issues/453#issuecomment-1155526473

but in my use case, changing the maxPercentDifference to 0.0, allowed for this step to fail:

run verify again, this should report Success even though the snapshot has changed (and with the --info flag the output says the task has no actions)

Is it possible that the String input argument change resulted in a < 0.1 threshold diff change, whereas the source composable change resulted in a >= 0.1 threshold diff change?

The workaround for this would be explicitly set maxPercentDifference to 0.0, or at least something between 0.0 and whatever value allows your changes to land.

In case you're curious, we're trying to make this 0.0 by default, but there are cases where Android status bar or nav bar renderings result in weird pixel differences, so we added this "threshold" as a workaround albeit not perfect.

jrodbx avatar Sep 21 '22 17:09 jrodbx

I see. That might be it. I will try it out when 1.1 is released!

Dambakk avatar Sep 22 '22 06:09 Dambakk

@Dambakk mind taking a look?

jrodbx avatar Oct 12 '22 23:10 jrodbx

I'm not able to reproduce the issue anymore so let's consider it resolved! Thanks for your work on paparazzi, it's very useful to us!

Dambakk avatar Oct 14 '22 08:10 Dambakk