Skip to content

OBJ-89 — Golden-file PDF fixture in CI - #36

Merged
objectgyan merged 1 commit into
mainfrom
objectgyan/obj-89-m64-golden-file-pdf-fixture-in-ci
May 17, 2026
Merged

objectgyan merged 1 commit into
mainfrom
objectgyan/obj-89-m64-golden-file-pdf-fixture-in-ci

Conversation

@objectgyan

Copy link
Copy Markdown
Owner

Summary

  • Adds tests/fixtures/m6-golden.json — deterministic fixture document covering every v1 control type (textbox, number, date, dropdown, checkbox×2, static table, dynamic table stub)
  • Adds tests/fixtures/m6-golden.txt — text baseline extracted from the Playwright-rendered PDF using PdfPig
  • Adds tests/pdf-extract/ — standalone .NET 9 console project using PdfPig 0.1.14 for text extraction from PDFs
  • Extends .github/workflows/ci.yml with pdf-fixture job: positive-path (golden diff must be clean) + negative-path (stale golden must fail with clear diff output)
  • Adds scripts/update-pdf-golden.ps1 — intentional refresh path for when the renderer changes
  • Adds scripts/validate-obj-89.ps1 — full validation: build, unit tests, fixture export → extract → diff cycle, negative-path assertion

Test plan

  • validate-obj-89.ps1 exits 0 (verified locally — 159 unit tests pass, golden diff clean, negative-path mismatch detected)
  • PDF fixture step in CI passes with the committed golden baseline
  • Negative-path CI step confirms stale-golden detection works
  • update-pdf-golden.ps1 runs without error and rewrites m6-golden.txt

- Add tests/fixtures/m6-golden.json covering all v1 controls (textbox, number, date, dropdown, checkbox×2, static table, dynamic table stub)
- Add tests/fixtures/m6-golden.txt — text baseline extracted from Playwright-rendered PDF via PdfPig
- Add tests/pdf-extract/ — standalone .NET 9 console project using PdfPig 0.1.14 for text extraction
- Add pdf-fixture CI job with positive-path (golden diff) and negative-path (stale golden detection) steps
- Add scripts/update-pdf-golden.ps1 — intentional refresh path
- Add scripts/validate-obj-89.ps1 — full validation cycle: build, unit tests, fixture export, text extract, diff
@linear-code

linear-code Bot commented May 17, 2026 •

Copy link
Copy Markdown
OBJ-89 M6.4 — Golden-file PDF fixture in CI

Milestone: M6 · Wave: 2

Summary

Add a deterministic fixture document and a CI step that exports it to PDF, then compares against a checked-in golden (tolerant text-extraction comparison rather than byte-exact, to absorb minor renderer noise).

Acceptance

  • Fixture committed at tests/fixtures/m6-golden.json
  • Golden text-extract committed at tests/fixtures/m6-golden.txt
  • CI step fails on mismatch
  • scripts/update-pdf-golden.ps1 updates the golden intentionally

Validation

  • DB check: N/A
  • Live API check: CI export → text extract → diff golden → exit 0
  • Script: scripts/validate-obj-NNN.ps1

Branch / PR

Branch from main; target main. No trailers/footer.

Review in Linear

@objectgyan
objectgyan merged commit f4a1363 into main May 17, 2026
2 of 4 checks passed
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