Skip to content

feat(testing): promote visual-regression harness to public API (Track N N1, @since 1.6.9)#126

Merged
DemchaAV merged 1 commit into
developfrom
feat/visual-regression-public-api
Jun 3, 2026
Merged

feat(testing): promote visual-regression harness to public API (Track N N1, @since 1.6.9)#126
DemchaAV merged 1 commit into
developfrom
feat/visual-regression-public-api

Conversation

@DemchaAV
Copy link
Copy Markdown
Owner

@DemchaAV DemchaAV commented Jun 3, 2026

Track N / N1 — public pixel-level visual-regression API (cycle 1.6.9)

Promotes the pixel-level visual-regression harness from the test source set to a public API under com.demcha.compose.testing.visual, sibling to the existing public com.demcha.compose.testing.layout.* snapshot helpers — so library consumers can run the same render-PDF -> diff-PNG baseline gate against their own presets/templates.

What changed

  • Promoted PdfVisualRegression + ImageDiff + new package-info to src/main/java/... (@since 1.6.9).
  • Inlined the PDF -> image step on PDFBox's PDFRenderer, dropping the test-only PdfRenderBridge dependency from the public surface (PdfRenderBridge stays in test for GraphComposeDevTool).
  • Eager 0..255 guard on perPixelTolerance(int) for fail-fast symmetry with renderScale/mismatchedPixelBudget, plus a negative test (from senior review).
  • Rewired 7 in-repo callers to the new package.
  • Docs/CHANGELOG: corrected the now-public framing in docs/operations/test-your-document.md; added a ### Public API entry under ## v1.6.9 — Planned.

Verification

  • Full suite 1059/1059 green (incl. 4 visual-parity tests + PublicApiSinceTagCoverage / PublicApiNoEngineLeak guards).
  • Behavior-preserving: pixel baselines unchanged (single PDFRenderer per document = PDFBox-recommended usage, identical output).
  • javadoc:javadoc green; release-profile javadoc jar includes the new package (consistent with testing.layout).

Follow-ups (PR-2 in cycle 1.6.9)

  • N2 docs/operations/visual-regression-testing.md
  • N3 README "What can I do with this?" row
  • N4 PublicVisualApiDogfoodTest (consumer-package dogfood)
  • (optional) widen CI javadoc-validation <subpackages> to include com.demcha.compose.testing

…(Track N N1, @SInCE 1.6.9)

Move the pixel-level visual-regression harness from the test source set to com.demcha.compose.testing.visual, sibling to the public com.demcha.compose.testing.layout.* snapshot helpers, so library consumers can run the same render-PDF -> diff-PNG baseline gate against their own presets.

- PdfVisualRegression + ImageDiff + package-info public (@SInCE 1.6.9)
- inline PDFBox PDFRenderer in renderPages(), drop the test-only PdfRenderBridge dependency from the public surface
- eager 0..255 guard on perPixelTolerance(int) for fail-fast symmetry with renderScale/mismatchedPixelBudget, plus negative test
- rewire 7 in-repo callers to the new package
- sync test-your-document.md + CHANGELOG (v1.6.9 Public API)

Behavior-preserving: visual baselines unchanged. Full suite 1059/1059 green.
@DemchaAV DemchaAV merged commit 1de0cff into develop Jun 3, 2026
11 checks passed
@DemchaAV DemchaAV deleted the feat/visual-regression-public-api branch June 3, 2026 08:23
DemchaAV added a commit that referenced this pull request Jun 3, 2026
…ERTY (Track N N2-N4, @SInCE 1.6.9) (#127)

Completes the public visual-regression surface introduced in #126:

- expose PdfVisualRegression.APPROVE_PROPERTY (@SInCE 1.6.9) so consumers toggle approve mode without hard-coding the system-property string (mirrors LayoutSnapshotAssertions.UPDATE_PROPERTY)
- add docs/operations/visual-regression-testing.md (pixel vs semantic, API, approve mode, cross-platform tolerance calibration)
- README 'Which API should I use?' gains a pixel-level visual-regression row
- add PublicVisualApiDogfoodTest: composes a document and pixel-tests it end-to-end through the public testing.visual surface

Full suite 1060/1060 green.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant