Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,18 @@ jobs:
check-latest: true
cache: true

# qpdf is a second, independent oracle: it reads back what we wrote and
# says whether it is well formed. Without it TestObjectStreamsQPDF skips
# and the lane is green over the one test a stranger performs.
- name: qpdf, the independent oracle for what we write
run: sudo apt-get update -qq && sudo apt-get install -y -qq qpdf

- name: go vet
run: go vet ./...

- name: Test with coverage
env:
PDFKIT_REQUIRE_QPDF: "1"
run: go test -covermode=set -coverprofile=coverage.out ./...

- name: Assert exact 100% statement coverage
Expand Down
6 changes: 6 additions & 0 deletions objstm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,12 @@ func TestObjectStreamsRichDocument(t *testing.T) {
func TestObjectStreamsQPDF(t *testing.T) {
qpdf, err := exec.LookPath("qpdf")
if err != nil {
// A skipped oracle reads exactly like a passing one. The lane that
// installs qpdf sets this, so its absence there is a broken lane and
// not a reason to go quietly green.
if os.Getenv("PDFKIT_REQUIRE_QPDF") != "" {
t.Fatalf("PDFKIT_REQUIRE_QPDF is set but qpdf is not installed: %v", err)
}
t.Skip("qpdf not installed")
}
dir := t.TempDir()
Expand Down
Loading