ci(pdf): read rendered PDFs back in the toolchain job - #477
Merged
Merged
Conversation
Install poppler-utils in the pdf-toolchain job and let pdfText/pdfImages skip or fail through skipWithout like the converters, so the text and image assertions run in CI instead of skipping for want of pdftotext. Co-Authored-By: jason.han <hanhuijun@gmail.com>
Contributor
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
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.
What and why
The
pdf-toolchainjob provisions every converter and diagram tool but notpoppler-utils, and the integration tests read each rendered PDF back throughpdftotext/pdfimages— so in CI every text and image assertion (headings, table cells, captions, KaTeX output, "no DOT/PlantUML source or fallback notice reached the page", the stylesheet-beside-the-output image) ended int.Skip("pdftotext not installed")while the job reported green.OPENSYSML_REQUIRE_PDF_TOOLCHAIN=1did not catch it because only the converters went throughskipWithout.Two changes:
.github/workflows/pr.yml: the job's system-library step also installspoppler-utils.internal/doc/docpdf/integration_test.go:pdfTextandpdfImagesroute an absent tool throughskipWithout, exactly like a missing converter — a skip locally, a failure under the require variable. The per-testif text == "" { t.Skip(...) }/if text != "" && …guards were the only consumers of the empty-string sentinel and are gone, so the assertions are unconditional once a PDF was rendered.Plus the changelog fragment and one sentence in the PDF testing skill naming
poppler-utilsas part of the local setup.How it was verified
With the pinned toolchain (
./scripts/download-doc-pdf-toolchain.sh) andpoppler-utilsinstalled:OPENSYSML_REQUIRE_PDF_TOOLCHAIN=1 go test -count=1 -v -run 'Installed|BesideTheOutput' ./internal/doc/docpdf— 24 subtests pass, the only skips are the sevenprinceones (unprovisioned, exempt by design).PATHthat hidespdftotext/pdfimages: without the require variable,weasyprint/pandocsubtests skip withpdftotext not installed; with it, they fail withOPENSYSML_REQUIRE_PDF_TOOLCHAIN=1 but pdftotext not installed— the failure this PR wants CI to be able to produce.go test -count=1 ./internal/doc/...(no toolchain in the environment) passes: the fake-tool tests are unaffected.go build ./...,go vet,gofmt -l .empty,python3 scripts/changelog.py check,python3 scripts/check-doc-ids.py.The
pdf-toolchainjob on this PR is the end-to-end check: its log should now show the text assertions running (nopdftotext not installedlines).Checklist
make testandmake lintpass locallychanges/unreleased/<slug>.<section>.md, not as an edit toCHANGELOG.mdmake docs-countsrun if a gate count moved (compliance rows need nothing: the census is counted at docs build)F4,K5) in the body, docs, or changelog