test: consume CreatePdf.NET 3.0.5 in-memory PDF output#51
Merged
Conversation
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>
There was a problem hiding this comment.
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
CreatePdfNETVersionfrom 3.0.4 to 3.0.5. - Refactor
TestPdf.BytesAsyncto callDocument.ToBytesAsync()directly instead ofSaveAsync+ 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.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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
CreatePdfNETVersion3.0.4 → 3.0.5.TestPdf.BytesAsyncontoDocument.ToBytesAsync()(new in 3.0.5), removing theSaveAsync → File.ReadAllBytes → File.Deleteround-trip through the projectoutput/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
SaveAsyncreturned, 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)
ToBytesAsync, which 3.0.4 lacks).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