diff --git a/CHANGELOG.md b/CHANGELOG.md index 8aaab684..6febe295 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -67,6 +67,24 @@ follow semantic versioning; release dates are ISO 8601. other, so it catches one being corrected without the other — not a pair that was wrong together from the start. +### Tests + +- **Every rendered document is now held against a fresh render.** A third of the example + catalogue — thirty-two documents, the cover-letter presets and most of the CV gallery + among them — rendered on every run with nothing comparing the result, so a change to the + engine moved those documents and no test said so. They are committed as previews now, + which is what puts them under `CommittedAssetDriftTest`: a PDF is compared by its bytes, + and a difference names the file that moved. + + The list of deliberately unpublished documents shrinks from thirty-five entries to three, + each carrying its reason. The emoji gallery stays out on weight: its embedded glyph set + renders to nearly 4 MB against 1.4 MB for the thirty-two together, so committing it would + put another copy of that in history on every deliberate re-render. The other two hold + pixels rasterised at render time, which a CI runner antialiases differently from a + developer's machine — the measurement `AssetContent` already records — so committing them + would fail the build for a document nobody changed. Those three renders stay unguarded, + which is the price of the exceptions rather than an oversight. + ### Fixed - **DOCX keeps the styling a mixed paragraph asks for.** A `RichText` paragraph exported diff --git a/assets/readme/examples/cover-letter-blue-banner-v2.pdf b/assets/readme/examples/cover-letter-blue-banner-v2.pdf new file mode 100644 index 00000000..a1079807 Binary files /dev/null and b/assets/readme/examples/cover-letter-blue-banner-v2.pdf differ diff --git a/assets/readme/examples/cover-letter-boxed-sections-v2.pdf b/assets/readme/examples/cover-letter-boxed-sections-v2.pdf new file mode 100644 index 00000000..ff6a0bd7 Binary files /dev/null and b/assets/readme/examples/cover-letter-boxed-sections-v2.pdf differ diff --git a/assets/readme/examples/cover-letter-centered-headline-v2.pdf b/assets/readme/examples/cover-letter-centered-headline-v2.pdf new file mode 100644 index 00000000..dc2e20ba Binary files /dev/null and b/assets/readme/examples/cover-letter-centered-headline-v2.pdf differ diff --git a/assets/readme/examples/cover-letter-classic-serif-v2.pdf b/assets/readme/examples/cover-letter-classic-serif-v2.pdf new file mode 100644 index 00000000..8d14220c Binary files /dev/null and b/assets/readme/examples/cover-letter-classic-serif-v2.pdf differ diff --git a/assets/readme/examples/cover-letter-compact-mono-v2.pdf b/assets/readme/examples/cover-letter-compact-mono-v2.pdf new file mode 100644 index 00000000..f41c4d5e Binary files /dev/null and b/assets/readme/examples/cover-letter-compact-mono-v2.pdf differ diff --git a/assets/readme/examples/cover-letter-editorial-blue-v2.pdf b/assets/readme/examples/cover-letter-editorial-blue-v2.pdf new file mode 100644 index 00000000..69caa0de Binary files /dev/null and b/assets/readme/examples/cover-letter-editorial-blue-v2.pdf differ diff --git a/assets/readme/examples/cover-letter-engineering-resume-v2.pdf b/assets/readme/examples/cover-letter-engineering-resume-v2.pdf new file mode 100644 index 00000000..65e27fa0 Binary files /dev/null and b/assets/readme/examples/cover-letter-engineering-resume-v2.pdf differ diff --git a/assets/readme/examples/cover-letter-executive-v2.pdf b/assets/readme/examples/cover-letter-executive-v2.pdf new file mode 100644 index 00000000..8b7b70fa Binary files /dev/null and b/assets/readme/examples/cover-letter-executive-v2.pdf differ diff --git a/assets/readme/examples/cover-letter-mint-editorial-v2.pdf b/assets/readme/examples/cover-letter-mint-editorial-v2.pdf new file mode 100644 index 00000000..2367e5bd Binary files /dev/null and b/assets/readme/examples/cover-letter-mint-editorial-v2.pdf differ diff --git a/assets/readme/examples/cover-letter-modern-professional-v2.pdf b/assets/readme/examples/cover-letter-modern-professional-v2.pdf new file mode 100644 index 00000000..745f493e Binary files /dev/null and b/assets/readme/examples/cover-letter-modern-professional-v2.pdf differ diff --git a/assets/readme/examples/cover-letter-monogram-sidebar-v2.pdf b/assets/readme/examples/cover-letter-monogram-sidebar-v2.pdf new file mode 100644 index 00000000..ae5c964a Binary files /dev/null and b/assets/readme/examples/cover-letter-monogram-sidebar-v2.pdf differ diff --git a/assets/readme/examples/cover-letter-nordic-clean-v2.pdf b/assets/readme/examples/cover-letter-nordic-clean-v2.pdf new file mode 100644 index 00000000..13b1746b Binary files /dev/null and b/assets/readme/examples/cover-letter-nordic-clean-v2.pdf differ diff --git a/assets/readme/examples/cover-letter-panel-v2.pdf b/assets/readme/examples/cover-letter-panel-v2.pdf new file mode 100644 index 00000000..04087c24 Binary files /dev/null and b/assets/readme/examples/cover-letter-panel-v2.pdf differ diff --git a/assets/readme/examples/cover-letter-sidebar-portrait-v2.pdf b/assets/readme/examples/cover-letter-sidebar-portrait-v2.pdf new file mode 100644 index 00000000..4125e95e Binary files /dev/null and b/assets/readme/examples/cover-letter-sidebar-portrait-v2.pdf differ diff --git a/assets/readme/examples/cover-letter-timeline-minimal-v2.pdf b/assets/readme/examples/cover-letter-timeline-minimal-v2.pdf new file mode 100644 index 00000000..42b3ea44 Binary files /dev/null and b/assets/readme/examples/cover-letter-timeline-minimal-v2.pdf differ diff --git a/assets/readme/examples/cv-blue-banner-v2.pdf b/assets/readme/examples/cv-blue-banner-v2.pdf new file mode 100644 index 00000000..8705fdba Binary files /dev/null and b/assets/readme/examples/cv-blue-banner-v2.pdf differ diff --git a/assets/readme/examples/cv-boxed-sections-v2.pdf b/assets/readme/examples/cv-boxed-sections-v2.pdf new file mode 100644 index 00000000..24749da2 Binary files /dev/null and b/assets/readme/examples/cv-boxed-sections-v2.pdf differ diff --git a/assets/readme/examples/cv-centered-headline-v2.pdf b/assets/readme/examples/cv-centered-headline-v2.pdf new file mode 100644 index 00000000..88a2c182 Binary files /dev/null and b/assets/readme/examples/cv-centered-headline-v2.pdf differ diff --git a/assets/readme/examples/cv-editorial-blue-v2.pdf b/assets/readme/examples/cv-editorial-blue-v2.pdf new file mode 100644 index 00000000..def5b152 Binary files /dev/null and b/assets/readme/examples/cv-editorial-blue-v2.pdf differ diff --git a/assets/readme/examples/cv-executive-v2.pdf b/assets/readme/examples/cv-executive-v2.pdf new file mode 100644 index 00000000..05934d2b Binary files /dev/null and b/assets/readme/examples/cv-executive-v2.pdf differ diff --git a/assets/readme/examples/cv-minimal-underlined-v2.pdf b/assets/readme/examples/cv-minimal-underlined-v2.pdf new file mode 100644 index 00000000..71e7b3d6 Binary files /dev/null and b/assets/readme/examples/cv-minimal-underlined-v2.pdf differ diff --git a/assets/readme/examples/cv-mint-editorial-v2-custom.pdf b/assets/readme/examples/cv-mint-editorial-v2-custom.pdf new file mode 100644 index 00000000..4ab3dd74 Binary files /dev/null and b/assets/readme/examples/cv-mint-editorial-v2-custom.pdf differ diff --git a/assets/readme/examples/cv-mint-editorial-v2.pdf b/assets/readme/examples/cv-mint-editorial-v2.pdf new file mode 100644 index 00000000..5194993a Binary files /dev/null and b/assets/readme/examples/cv-mint-editorial-v2.pdf differ diff --git a/assets/readme/examples/cv-monogram-sidebar-v2.pdf b/assets/readme/examples/cv-monogram-sidebar-v2.pdf new file mode 100644 index 00000000..30d3ebf0 Binary files /dev/null and b/assets/readme/examples/cv-monogram-sidebar-v2.pdf differ diff --git a/assets/readme/examples/cv-sidebar-portrait-v2.pdf b/assets/readme/examples/cv-sidebar-portrait-v2.pdf new file mode 100644 index 00000000..c05ca2c9 Binary files /dev/null and b/assets/readme/examples/cv-sidebar-portrait-v2.pdf differ diff --git a/assets/readme/examples/emoji-clip-path.pdf b/assets/readme/examples/emoji-clip-path.pdf new file mode 100644 index 00000000..61e514d9 Binary files /dev/null and b/assets/readme/examples/emoji-clip-path.pdf differ diff --git a/assets/readme/examples/invoice-modern-v2.pdf b/assets/readme/examples/invoice-modern-v2.pdf new file mode 100644 index 00000000..e379dc58 Binary files /dev/null and b/assets/readme/examples/invoice-modern-v2.pdf differ diff --git a/assets/readme/examples/linkedin-carousel.pdf b/assets/readme/examples/linkedin-carousel.pdf new file mode 100644 index 00000000..fe9a24f4 Binary files /dev/null and b/assets/readme/examples/linkedin-carousel.pdf differ diff --git a/assets/readme/examples/linkedin-carousel.pptx b/assets/readme/examples/linkedin-carousel.pptx new file mode 100644 index 00000000..d3c12ef2 Binary files /dev/null and b/assets/readme/examples/linkedin-carousel.pptx differ diff --git a/assets/readme/examples/photo-clip.pdf b/assets/readme/examples/photo-clip.pdf new file mode 100644 index 00000000..cc23c3a5 Binary files /dev/null and b/assets/readme/examples/photo-clip.pdf differ diff --git a/assets/readme/examples/poetry-title.pdf b/assets/readme/examples/poetry-title.pdf new file mode 100644 index 00000000..5301891c Binary files /dev/null and b/assets/readme/examples/poetry-title.pdf differ diff --git a/assets/readme/examples/proposal-modern-v2.pdf b/assets/readme/examples/proposal-modern-v2.pdf new file mode 100644 index 00000000..e1113607 Binary files /dev/null and b/assets/readme/examples/proposal-modern-v2.pdf differ diff --git a/examples/README.md b/examples/README.md index 7b72cddc..b0565ac8 100644 --- a/examples/README.md +++ b/examples/README.md @@ -70,10 +70,18 @@ towards. `GenerateAllExamples` renders the whole catalogue in one pass — the CV and cover-letter presets plus invoices, proposals, a schedule, the feature demos, and the flagships. The showcase site publishes the whole generated -catalogue; a curated subset is committed under +catalogue, and the same catalogue is committed under [`assets/readme/examples/`](../assets/readme/examples/) so the previews linked below open straight from GitHub. +Committing them is what lets `CommittedAssetDriftTest` compare each one +against a fresh render and fail on the difference, so a change to the engine +that moves a document says so in the build rather than at the next release. +A PDF is compared by its bytes. Three documents are held back and the guard +records why for each: the emoji gallery on weight, and two whose pixels this +repository rasterises at render time, which a CI runner antialiases differently +from a developer's machine. + ## Gallery — pick by your goal Examples are categorised by **maturity / intent**, not by the GraphCompose diff --git a/examples/src/test/java/com/demcha/examples/CommittedAssetDriftTest.java b/examples/src/test/java/com/demcha/examples/CommittedAssetDriftTest.java index e47ce952..b7210d4d 100644 --- a/examples/src/test/java/com/demcha/examples/CommittedAssetDriftTest.java +++ b/examples/src/test/java/com/demcha/examples/CommittedAssetDriftTest.java @@ -62,46 +62,33 @@ class CommittedAssetDriftTest { * removes it from its own guard — README would lose a figure and every test would stay * green.

* - *

Listing what is not published rather than what is keeps the shorter list, and - * puts the decision where it is actually made: a new example ships unpublished unless somebody - * says otherwise, and saying so is adding a file to the folder and a name off this list.

+ *

The list used to carry a third of the catalogue, which meant a third of it rendered with + * nothing comparing the result. Those are committed now, so the default is published and this + * list is what has to earn an exception. Three do, for two different reasons.

+ * + *

Weight. The emoji gallery embeds a glyph set and renders to nearly 4 MB, against + * 1.4 MB for the thirty-two committed alongside it. Committing it would put another copy of + * that in history on every deliberate re-render.

+ * + *

The machine, not the document. The other two contain pixels this repository + * rasterises at render time, and the same glyphs come out with different antialiasing on + * Windows and on the Linux runner — the measurement {@link AssetContent} records, where five + * of 104 documents failed to match across the two. Three of those five are absorbed there, by + * naming the part and both machines' digests; these two are not, because a PDF is compared + * whole and has no part to name, and because the deck's difference is in content it renders + * rather than in a part it embeds. Committing them would fail the build on the runner for a + * document nobody changed.

+ * + *

So their renders are unguarded, which is the price of the exception rather than an + * oversight — and the reason is recorded per file so a later reader does not re-run the + * experiment to find out.

*/ private static final Set UNPUBLISHED_PREVIEWS = Set.of( - "cover-letter-blue-banner-v2.pdf", - "cover-letter-boxed-sections-v2.pdf", - "cover-letter-centered-headline-v2.pdf", - "cover-letter-classic-serif-v2.pdf", - "cover-letter-compact-mono-v2.pdf", - "cover-letter-editorial-blue-v2.pdf", - "cover-letter-engineering-resume-v2.pdf", - "cover-letter-executive-v2.pdf", - "cover-letter-mint-editorial-v2.pdf", - "cover-letter-modern-professional-v2.pdf", - "cover-letter-monogram-sidebar-v2.pdf", - "cover-letter-nordic-clean-v2.pdf", - "cover-letter-panel-v2.pdf", - "cover-letter-sidebar-portrait-v2.pdf", - "cover-letter-timeline-minimal-v2.pdf", - "cv-blue-banner-v2.pdf", - "cv-boxed-sections-v2.pdf", - "cv-centered-headline-v2.pdf", - "cv-editorial-blue-v2.pdf", - "cv-executive-v2.pdf", - "cv-minimal-underlined-v2.pdf", - "cv-mint-editorial-v2-custom.pdf", - "cv-mint-editorial-v2.pdf", - "cv-monogram-sidebar-v2.pdf", - "cv-sidebar-portrait-v2.pdf", - "emoji-clip-path.pdf", + // Weight: ~4 MB of embedded glyphs. "emoji-gallery.pdf", + // Rasterised at render time; antialiasing differs between Windows and the runner. "emoji-svg-vs-png.pdf", - "engine-deck.pptx", - "invoice-modern-v2.pdf", - "linkedin-carousel.pdf", - "linkedin-carousel.pptx", - "photo-clip.pdf", - "poetry-title.pdf", - "proposal-modern-v2.pdf"); + "engine-deck.pptx"); @BeforeAll static void generateEveryExample() throws Exception {