cashapp / paparazzi

Render your Android screens without a physical device or emulator
https://cashapp.github.io/paparazzi/
Apache License 2.0
2.32k stars 216 forks source link

Generate separate report for including snapshots #1563

Closed geoff-powell closed 2 months ago

geoff-powell commented 2 months ago

https://github.com/cashapp/paparazzi/issues/1446

This borrows a bunch of classes from Gradle reporting to generate a junit html report with diff images included. It will add snapshots to the existing junit report. This was mainly in inspiration of the Google team's compose preview snapshot gradle plugin. Kudos!

Sample html report: sample-html-report.zip

Screenshot 2024-08-29 at 11 34 59 AM

eygraber commented 1 month ago

I'n not seeing the TestReport reporter being used with 1.3.5-SNAPSHOT. There are delta images being generated under build/paparazzi/failures/ but the HTML under build/reports/tests/test<variant>UnitTest doesn't reference them in any way.

I used reflection to read the reporter field and it is null.

geoff-powell commented 1 month ago

It will only be used if verifyPaparazzi[Debug] task is run. Otherwise it uses the default TestReporter

eygraber commented 1 month ago

I ran the verify task.

geoff-powell commented 1 month ago

hmm, interesting let me take a look

eygraber commented 1 month ago

If it helps the following is printed when running verifyPaparazziDevDebug (I have a dev/prod build flavor):

See the Paparazzi report at: file:///home/eli/workspace/my_project/build/reports/paparazzi/devDebug/index.html

There is a build/reports/paparazzi/devDebug directory, but it is empty. There is typical test result content under build/reports/tests/testDevDebugUnitTest.

jrodbx commented 1 month ago

Thanks for flagging @eygraber. Reminder to please file a new issue for tracking, vs commenting on closed PRs and issues.

Tracking in https://github.com/cashapp/paparazzi/issues/1651 and assigning to myself, as this is (hopefully) the last release blocker for 1.3.5.

geoff-powell commented 4 weeks ago

@eygraber Can you provide a sample project for this? I created a test project using build flavors and it seems like its working as expected. https://github.com/cashapp/paparazzi/compare/gpowell/flavor-snapshot-report?expand=1

image
eygraber commented 4 weeks ago

I don't have a sample project, but I'll try making one.