Add unit tests for Environments, Audit, and Webhooks namespaces (#6)
## Summary - Add missing unit test coverage for the Environments, Audit, and Webhooks namespaces (raises them from ~0-62% to 91-100%) - Exclude WebhookBackgroundService/WebhookRetryBackgroundService from coverage (require live DI/DB, disallowed by CLAUDE.md's no-InMemory/WebApplicationFactory rule) ## Test plan - [x] `dotnet test` full suite passes (646/646) - [x] Coverage report confirms Environments ~99.5%, Audit 100%, Webhooks ~91% Reviewed-on: #6
This commit was merged in pull request #6.
This commit is contained in:
@@ -8,9 +8,17 @@ cd "$CI_ROOT"
|
||||
|
||||
ensure_dotnet
|
||||
|
||||
# --results-directory doesn't clear prior runs - it adds a new GUID folder
|
||||
# alongside old ones every time. On a runner that reuses its workspace
|
||||
# (self-hosted, unlike GitHub's ephemeral ones), stale coverage from past
|
||||
# runs would otherwise get merged in by coverage.sh and silently skew the
|
||||
# combined percentage.
|
||||
rm -rf "$CI_ROOT/coverage/dotnet"
|
||||
|
||||
log "Running MicCheck.Api.Tests.Unit"
|
||||
dotnet test tests/api/MicCheck.Api.Tests.Unit/MicCheck.Api.Tests.Unit.csproj -c Release --logger trx \
|
||||
--collect:"XPlat Code Coverage" --results-directory "$CI_ROOT/coverage/dotnet"
|
||||
--collect:"XPlat Code Coverage" --results-directory "$CI_ROOT/coverage/dotnet" \
|
||||
--settings tests/api/MicCheck.Api.Tests.Unit/coverlet.runsettings
|
||||
|
||||
log "Running admin Jest tests"
|
||||
npm --prefix src/admin test -- --coverage --coverageReporters=lcov --coverageReporters=text-summary
|
||||
|
||||
Reference in New Issue
Block a user