Skip to content

test: consume CreatePdf.NET 3.0.5 in-memory PDF output#51

Merged
ANcpLua merged 1 commit into
mainfrom
chore/createpdf-3.0.5
Jun 4, 2026
Merged

test: consume CreatePdf.NET 3.0.5 in-memory PDF output#51
ANcpLua merged 1 commit into
mainfrom
chore/createpdf-3.0.5

Conversation

@ANcpLua

@ANcpLua ANcpLua commented Jun 4, 2026

Copy link
Copy Markdown
Owner

What

  • Bump CreatePdfNETVersion 3.0.4 → 3.0.5.
  • Collapse TestPdf.BytesAsync onto Document.ToBytesAsync() (new in 3.0.5), removing the SaveAsync → File.ReadAllBytes → File.Delete round-trip through the project output/ dir.

Why

CreatePdf.NET's public output was disk-only, so the shared test helper had to save a uniquely-named PDF, read the path SaveAsync returned, then delete it — a workaround that could leak a stray PDF if a test aborted between save and delete. 3.0.5 adds an in-memory renderer (ToBytesAsync()), so the helper now produces bytes directly with nothing to clean up. The root fix landed in the library (CreatePdf.NET#10, released as v3.0.5) rather than as more consumer-side plumbing.

Verification (local, OrbStack)

  • Release build: 0 warnings / 0 errors (restored 3.0.5 — compiles against ToBytesAsync, which 3.0.4 lacks).
  • Unit tests: pass.
  • Integration: REST 59/59 + Services 12/12 (TMPDIR=/private/tmp). The OCR pipeline (MinIO → sips → tesseract → search) and REST multipart upload both accept the in-memory PDF bytes, so the helper change is end-to-end equivalent.

🤖 Generated with Claude Code

Bump CreatePdfNETVersion 3.0.4 -> 3.0.5 and collapse TestPdf.BytesAsync onto
Document.ToBytesAsync(), dropping the SaveAsync -> File.ReadAllBytes -> File.Delete
round-trip through the project output dir. The shared helper now renders straight
to a byte array, so neither integration suite can leak a stray PDF under output/.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 4, 2026 12:50

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the CreatePdf.NET dependency to v3.0.5 and simplifies the shared integration-test PDF helper to use the new in-memory rendering API, eliminating temporary-file writes/reads/deletes under the project output/ directory.

Changes:

  • Bump CreatePdfNETVersion from 3.0.4 to 3.0.5.
  • Refactor TestPdf.BytesAsync to call Document.ToBytesAsync() directly instead of SaveAsync + file round-trip.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
Version.props Updates the central CreatePdf.NET version property to 3.0.5.
Paperless.TestSupport/TestPdf.cs Switches the test PDF helper to in-memory byte rendering via ToBytesAsync(), removing filesystem cleanup logic.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ANcpLua ANcpLua merged commit 622d95c into main Jun 4, 2026
6 checks passed
@ANcpLua ANcpLua deleted the chore/createpdf-3.0.5 branch June 4, 2026 12:57
@codecov

codecov Bot commented Jun 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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.

2 participants