Skip to content

fix(tests): resolve the five CodeQL findings the coverage push introduced - #69

Merged
bgard68 merged 1 commit into
mainfrom
fix/test-alerts
Aug 24, 2026
Merged

fix(tests): resolve the five CodeQL findings the coverage push introduced#69
bgard68 merged 1 commit into
mainfrom
fix/test-alerts

Conversation

@bgard68

@bgard68 bgard68 commented Aug 24, 2026

Copy link
Copy Markdown
Owner

The coverage push brought the repository to 292 tests — and five new CodeQL findings in the new test code. Zero open alerts is an invariant now, so test code holds the same bar as product code.

Alerts Finding Fix
1 MemoryCache (IDisposable) built per scanner, never disposed Test class owns one per instance, disposes it
3 Response locals inside Task.FromResult, where the analyzer loses the ownership transfer Built in methods that return them directly; the transfer (scanner usings the listing; GetStringAsync disposes internally) documented
1 catch { } in test cleanup Narrowed to IOException / UnauthorizedAccessException — the two a filesystem delete can produce

147 Infrastructure tests pass; no product code touched.

…uced

The zero-open-alerts state is an invariant now, so the new test code holds to
the same bar as the product code.

MemoryCache is IDisposable and was constructed per scanner without disposal;
the test class now owns one per instance and disposes it. The fake handler
built responses inside Task.FromResult, where the analyzer loses the ownership
transfer — they are built in methods that return them directly, with the
transfer documented. The key-directory cleanup swallowed every exception; only
the two a filesystem delete can produce are caught now.

147 tests pass.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Comment on lines +154 to +156
catch (IOException)
{
}
Comment on lines +157 to +159
catch (UnauthorizedAccessException)
{
}
@bgard68
bgard68 merged commit 48851e6 into main Aug 24, 2026
10 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.

2 participants