Add paparazzi-junit4-reporting for Gradle test report image attachments#2299
Draft
joshfriend wants to merge 1 commit intocashapp:masterfrom
Draft
Add paparazzi-junit4-reporting for Gradle test report image attachments#2299joshfriend wants to merge 1 commit intocashapp:masterfrom
joshfriend wants to merge 1 commit intocashapp:masterfrom
Conversation
Introduces a new `paparazzi-junit4-reporting` artifact: a JUnit Platform
engine wrapper (`paparazzi-vintage`) that intercepts `EngineExecutionListener`
to call `fileEntryPublished()` for every snapshot PNG, surfacing images in
Gradle 9.4+ test reports and build scans.
Core changes:
- `PaparazziReportingBridge`: thread-local callback bridge between `Paparazzi`
and the engine wrapper; set per-test by the engine, cleared after each test
- `Paparazzi.reportOutputFile()`: fires `PaparazziReportingBridge.publishFile()`
after every snapshot/gif write
- `PaparazziVintageTestEngine`: wraps `VintageTestEngine` with a distinct engine
ID (`"paparazzi-vintage"`); the standard `junit-vintage` engine is excluded
automatically by the Paparazzi Gradle plugin when `paparazzi-junit4-reporting`
is detected on the test classpath, so tests don't run twice
- `PaparazziPlugin`: detects `paparazzi-junit4-reporting` in declared dependencies
and auto-configures `useJUnitPlatform { excludeEngines("junit-vintage") }`
- Gradle wrapper updated to 9.4.0 (required for `fileEntryPublished` support)
TWiStErRob
reviewed
Mar 6, 2026
| // paparazzi-vintage can attach snapshot images to the Gradle HTML test report | ||
| when (val opts = test.options) { | ||
| is TestNGOptions -> { /* Don't override TestNG test runner */ } | ||
| is JUnitPlatformOptions -> opts.excludeEngines("junit-vintage") |
Contributor
There was a problem hiding this comment.
considering #2209, should jupiter be also handled?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2263
Introduces a new
paparazzi-junit4-reportingartifact: a JUnit Platform engine wrapper (paparazzi-vintage) that interceptsEngineExecutionListenerto callfileEntryPublished()for every snapshot PNG, surfacing images in Gradle 9.4+ test reports. The Paparazzi plugin auto-applies this new dependency and excludes thejunit-vintageengine.