This message was deleted.
# community-support
s
This message was deleted.
ł
If not, the alternative will be to just do it manually — first run both
assemble
tasks, grep the output to determine if they've changed, and only if they did then run the tests. But I'd like to do that as last resort only
v
outputs.upToDateWhen { false }
That's probably not the right thing to do, but more annotating with
@UntrackedTask
or using
doNotTrackState()
. Using
upToDateWhen { false }
was a work-around for not having that facility in older Gradle versions. Just a general advice, that doesn't change the actual behavior in your case.
So, what I could say is
verifyScreenshots
and
connectedDebugAndroidTest
are always up to date if
assembleDebug
and
assembleDebugAndroidTest
are up-to-date.
Actually, you cannot say that, because you do not know whether the last time
verifyScreenshots
was run is the same time
assembleDebug
and
assembeeDebugAndroidTest
were run, or whether maybe the outputs of
verifyScreenshots
were changed and thus it needs to rerun. What you could maybe do if you really want to do this is to register a shared build service as
OperationCompletionListener
that then records the outcome of the
assemble...
tasks and use that build service in the
onlyIf
of the
verifyScreenshots
task to skip it if the other two tasks were up-to-date.
👀 1
ł
or whether maybe the outputs of
verifyScreenshots
were changed and thus it needs to rerun.
That's exactly right, but I accept these shortcomings, as I only want to optimize CI 🙂 But I understand there might be false-positives 👍 I'll definitely try the
OperationCompletionListener
, thanks!
👌 1
j
There are some issues in the paparazzi repo about it breaking the cache, and some of them were closed recently.
ł
I'm using Facebook's screenshot tests 🙂 haven't adopted paparazzi yet
j
Can you share the repo here? I didn’t know about it
ł
https://github.com/facebook/screenshot-tests-for-android but I'm using the fork https://github.com/usefulness/screenshot-tests-for-android/. I'm not sure I can recommend it though, it took us a long time to get rid of all the flakiness issues, and the original doesn't seem maintained. Fork does a good job updating to new Gradle apis but the core is still facebook's code and a library in python. I know there's Shot plugin that adds a lot on top of the original plugin, but also requires an emulator to run
👍 1