test: install qpdf so the independent oracle actually runs - #33
Merged
Merged
Conversation
TestObjectStreamsQPDF is described in its own comment as "a second,
independent oracle when it is installed": qpdf must find no syntax or
stream encoding error, and its cross-reference must list every link
annotation as compressed and every stream as not.
It had never run. The test skips when qpdf is absent and the lane
installs nothing, so the only check a stranger performs on what this
package emits skipped on every push, under a green lane and a gate
asserting exactly 100% statement coverage.
Both numbers were honest. Coverage counts lines that executed, and the
object-stream writer executes under the other tests too. What a
coverage gate cannot express is that the one test comparing our output
against another implementation did nothing.
Install qpdf in the lane, and set PDFKIT_REQUIRE_QPDF=1 so that "qpdf
not installed" is a failure there rather than a skip.
Verified both ways on this machine, which has qpdf 12.4.1:
PDFKIT_REQUIRE_QPDF=1 go test -run TestObjectStreamsQPDF --- PASS
PATH=/usr/bin:/bin, flag still set --- FAIL
Found with judgescan, which reports repositories whose tests look for a
tool their CI never installs: 29 of the 134 that name one.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
The one check a stranger performs, and it never ran
TestObjectStreamsQPDFcalls itself "a second, independent oracle when it isinstalled": qpdf must report no syntax or stream-encoding error, and its
cross-reference must list every link annotation as compressed (type 2) and every
stream as uncompressed (type 1).
It had never run. The test skips when qpdf is absent; the lane installs nothing.
So the only check performed by an implementation other than this one skipped on
every push — under a green lane, and under a gate asserting exactly 100%
statement coverage.
Both numbers were honest. Coverage counts lines that executed, and the
object-stream writer executes under the other tests too. What a coverage gate
cannot express is that the single test comparing our output against a foreign
reader did nothing at all.
The change
qpdfin the lane;PDFKIT_REQUIRE_QPDF=1, so "qpdf not installed" is a failure thererather than a skip.
Verified both ways, locally
This machine has qpdf 12.4.1, so the guard was exercised before opening this:
How this was found
judgescan, a new fleet tool reporting every repository whose tests look for anexternal tool its CI never installs. Of 901 repositories, 134 name such a tool
and 29 name one that is never installed. This is one of them.
🤖 Generated with Claude Code