Conversation
- Fix DKNet.Svc.PdfGenerators: 3 tests were failing with Chrome download
race conditions. Added ChromeDownloadFixture with [Collection] to
pre-download Chrome once and serialize PDF generation tests.
All 175 tests now pass (was 172 pass / 3 fail).
- Improve DKNet.AspCore.Idempotency coverage (from 60.2% line / 48.2% branch):
- Added IdempotentKeyInfoTests: covers IsValid() for null/empty/whitespace
keys, key too long, invalid format, valid key, and CompositeKey property
- Added CachedResponseTests: covers IsExpired for null ExpiresAt, future,
and past expiry
- Added IdempotencyStoreEdgeCaseTests: covers expired response removal,
null ExpiresAt handling, separate keys per endpoint and method
- Added integration tests for keys that are too long or have invalid format
Total: 54 tests (was 35)
- Improve DKNet.EfCore.DataAuthorization coverage (from 77.7% line / 62.5% branch):
- Added InternalsVisibleTo for test project
- Added EmptyOwnerKeyProvider / EmptyAccessibleKeysProvider test helpers
- Added DataAuthorizationEdgeCaseTests: covers DataAuthExtensions.GetQueryFilterKey,
empty ownerKey hook early-return path, and empty AccessibleKeys query filter
branch (all entities visible when no ownership filter applied)
Total: 20 tests (was 14)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
📊 Code Coverage Report |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #294 +/- ##
==========================================
- Coverage 84.43% 83.62% -0.82%
==========================================
Files 159 159
Lines 3655 3706 +51
Branches 564 575 +11
==========================================
+ Hits 3086 3099 +13
- Misses 412 444 +32
- Partials 157 163 +6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
baoduy
added a commit
that referenced
this pull request
May 22, 2026
test: improve coverage for PR #294 gap files
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.
Summary
Fixed all 3 failing PdfGenerator tests and added new tests to improve coverage across three projects.
Changes
DKNet.Svc. Fixed 3 failing testsPdfGenerators
Root cause:
ConvertHtmlAsync,ConvertMarkdownFileAsync, andConvertMultipleMarkdownFilesAsynctests were racing to download Chrome concurrently, causing a file-lock IOException.Fix: Added
ChromeDownloadFixture(pre-downloads Chrome once via PuppeteerSharp) and[Collection("PdfGeneratorChrome")]to serialize PDF generation tests.Result: 175/175 passing (was 172/175)
DKNet.AspCore. Improved coverageIdempotency
New tests added (54 total, was 35):
covers IsValid() for null/empty/whitespace keys, key too long, invalid formatIdempotentKeyInfoTestscovers IsExpired for null ExpiresAt, future, and past expiryCachedResponseTestscovers expired response removal, separate keys per endpoint/methodIdempotencyStoreEdgeCaseTestsDKNet.EfCore. Improved coverageDataAuthorization
New tests added (20 total, was 14):
covers DataAuthExtensions.GetQueryFilterKeyDataAuthorizationEdgeCaseTestsexercises DataOwnerHook early-return branchDataAuthorizationEmptyOwnerKeyTestsexercises empty accessibility keys filter branchDataAuthorizationEmptyAccessibleKeysTests