paparazzi icon indicating copy to clipboard operation
paparazzi copied to clipboard

./gradlew clean leaves traces

Open TWiStErRob opened this issue 2 years ago • 1 comments

Description When I do a gradlew clean I expect a clean slate. Regardless of what plugins are applied.

Steps to Reproduce

  1. Any project having Paparazzi.
  2. gradlew recordPaparazziDebug
  3. Make a change that would fail verification
  4. gradlew verifyPaparazziDebug
  5. output is in path/to/module/out/failures
  6. gradlew clean

Expected behavior Any output from the Gradle execution is cleaned at the end.

Additional information:

  • Paparazzi Version: 1.0
  • OS: any
  • Compile SDK: N/A
  • Gradle Version: Gradle 7.4 (but I observed it a few months ago on 6.9.x as well)
  • Android Gradle Plugin Version: 7.2.1

Workaround

// In every module that has app.cash.paparazzi plugin applied.
target.tasks.named<Delete>("clean") {
	delete(project.file("out/failures"))
}

Suggestion Don't use hardcoded paths like out/failures, put the failed diffs into some ${project.buildDir}/.../paparazzi folder. Try not to hardcode build/... either, because it's relocatable (see org.gradle.api.Project#setBuildDir(java.io.File)).

TWiStErRob avatar Jun 04 '22 17:06 TWiStErRob

In addition to this, I would also expect the out/failures folder to be cleared automatically before running verifyPaparazzi again. I currently have to clean this folder manually to only have a list of failed test images of the last verify run.

Suggestion: Clean up out/failure first when verifyPaparazzi is executed.

JulianEggers avatar Sep 15 '22 16:09 JulianEggers