airbnb / Showkase

🔦 Showkase is an annotation-processor based Android library that helps you organize, discover, search and visualize Jetpack Compose UI elements
https://medium.com/airbnb-engineering/introducing-showkase-a-library-to-organize-discover-and-visualize-your-jetpack-compose-elements-d5c34ef01095
Apache License 2.0
2.08k stars 106 forks source link

Multi-module project - @ShowkaseRoot per module causes tests to have @Previews from dependent modules #379

Open ss0930 opened 3 months ago

ss0930 commented 3 months ago

I am using Showkase + Paparazzi artifact (https://github.com/airbnb/Showkase/pull/294) to set up snapshot testing in a multi-module project. I am running into an issue where a module will generate snapshot tests for @Previews from modules it depends on.

Module A

Module B

When executing recordPaparazzi, Module A will execute tests for 5 previews, however, Module B executes tests for 8 previews (3 from Module B, 5 from Module A). This results in redundant snapshots being generated. This is mentioned in this comment https://github.com/airbnb/Showkase/issues/299#issuecomment-1536134814 on an existing issue as well.

Is there a workaround for this that works with showkase-screenshot-testing-paparazzi artifact?