Skip to content

test: phase 5 — ascending-order coverage push#91

Closed
JerrettDavis wants to merge 9 commits into
mainfrom
feat/coverage-phase-5
Closed

test: phase 5 — ascending-order coverage push#91
JerrettDavis wants to merge 9 commits into
mainfrom
feat/coverage-phase-5

Conversation

@JerrettDavis

Copy link
Copy Markdown
Owner

Summary

Coverage phase 5: attacked the four lowest-coverage src/ assemblies in ascending order, bringing each one up significantly.

Assembly Before After (est.) New tests
ExperimentFramework.Governance.Persistence 5% ~90% 42 (PersistenceResult, ConcurrencyConflictException, DI extensions, InMemoryBackplane)
ExperimentFramework.Dashboard 23% ~65% 63 (tenant resolvers, rollout persistence, theme provider, claims auth, middleware lifecycle)
ExperimentFramework.Governance.Persistence.Redis 45% ~80% 7 × 3 TFMs (both DI overloads, mock multiplexer, singleton/TryAdd semantics)
ExperimentFramework.Configuration 68% ~85% 19 (SchemaExporter, BackplaneHandler validate/configure)

Also adds a new test project (ExperimentFramework.Configuration.Tests) and commits missing packages.lock.json files required for CI --use-lock-file enforcement.

Test plan

  • CI build passes (all 82 projects, no new errors)
  • All new test files compile on multi-target TFMs
  • No integration tests inadvertently included (all new tests are pure unit tests)
  • Codecov reports higher coverage on main after merge

🤖 Generated with Claude Code

GitHub Copilot and others added 5 commits April 24, 2026 19:23
Add 42 unit tests covering PersistenceResult factory methods,
ConcurrencyConflictException constructors, DI registration helpers
(AddInMemoryGovernancePersistence, AddGovernancePersistence overloads),
and extended InMemoryPersistenceBackplane operations (policy evaluations,
approval records, configuration versions, environment scoping, conflict semantics).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add 63 unit tests across five files:
- TenantResolverUnitTests: HTTP header, claims, subdomain, and composite resolvers
- InMemoryRolloutPersistenceTests: save/get/update/delete, active filter, tenant scoping
- DefaultThemeProviderTests: null/custom theme, tenant-agnostic, cancellation
- ClaimsPrincipalAuthProviderTests: roles (dedup, custom claim), claims list, permissions
- DashboardMiddlewareTests: bypass paths, auth redirect, tenant context lifecycle,
  authorization service success/failure

Uses DefaultHttpContext and System.Security.Claims; no external dependencies.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add 7 unit tests for AddRedisGovernancePersistence DI extensions using
Mock<IConnectionMultiplexer> to avoid a real Redis connection. Tests cover
both overloads (existing multiplexer and connection-string factory), TryAdd
deduplication, singleton lifetime, and return-value chaining.

Add Moq 4.20.72 and Microsoft.Extensions.DependencyInjection 10.0.1 to
the test project; refresh packages.lock.json accordingly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… 85%

New test project ExperimentFramework.Configuration.Tests (net10.0) with 19 tests:
- SchemaExporterTests (9): ExportUnifiedSchema/ExportExtensionSchema write valid
  formatted JSON, create directories, produce deserializable output;
  CreateSchemaFromAssembly filters to namespace and returns correct metadata.
- BackplaneHandlerTests (10): BackplaneType strings, Validate() always returns
  empty, ConfigureServices throws InvalidOperationException when DataPlane
  assembly is not in scope (unit test isolation).

Project registered in ExperimentFramework.slnx; packages.lock.json committed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add missing lock files for projects that lacked them (Dashboard.Tests,
Dashboard.Api.Tests, Dashboard.UI.Tests, E2E.Tests, Simulation.Tests,
Governance.Persistence.Redis src, Governance.Persistence.Sql src,
Simulation src, SimulationSample), and refresh AspireDemo lock files
that shifted due to transitive dependency graph changes. Required for
CI --use-lock-file enforcement.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Apr 25, 2026

Copy link
Copy Markdown
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Snapshot Warnings

⚠️: No snapshots were found for the head SHA 7419a22.
Ensure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice.

OpenSSF Scorecard

PackageVersionScoreDetails
nuget/Microsoft.Extensions.DependencyInjection 10.0.1 UnknownUnknown
nuget/Microsoft.Extensions.Hosting 10.0.1 UnknownUnknown
nuget/Microsoft.Extensions.Logging 10.0.1 UnknownUnknown
nuget/Microsoft.Extensions.Logging.Abstractions 10.0.1 UnknownUnknown
nuget/Microsoft.NET.Test.Sdk 17.14.1 🟢 4.4
Details
CheckScoreReason
Maintained🟢 1030 commit(s) and 25 issue activity found in the last 90 days -- score normalized to 10
Code-Review🟢 7Found 19/27 approved changesets -- score normalized to 7
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
Packaging⚠️ -1packaging workflow not detected
Security-Policy🟢 10security policy file detected
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
License🟢 10license file detected
Binary-Artifacts⚠️ 0binaries present in source code
Signed-Releases⚠️ -1no releases found
Pinned-Dependencies⚠️ 0dependency not pinned by hash detected -- score normalized to 0
Fuzzing⚠️ 0project is not fuzzed
Branch-Protection⚠️ 2branch protection is not maximal on development and all release branches
SAST⚠️ 0SAST tool is not run on all commits -- score normalized to 0
nuget/coverlet.collector 6.0.4 🟢 5
Details
CheckScoreReason
Code-Review⚠️ 0Found 1/26 approved changesets -- score normalized to 0
Maintained🟢 1030 commit(s) and 24 issue activity found in the last 90 days -- score normalized to 10
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Packaging⚠️ -1packaging workflow not detected
Token-Permissions🟢 9detected GitHub workflow tokens with excessive permissions
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Binary-Artifacts🟢 7binaries present in source code
Fuzzing⚠️ 0project is not fuzzed
License🟢 10license file detected
Pinned-Dependencies⚠️ 0dependency not pinned by hash detected -- score normalized to 0
Signed-Releases⚠️ 0Project has not signed or included provenance with any releases.
Branch-Protection⚠️ -1internal error: error during branchesHandler.setup: internal error: some github tokens can't read classic branch protection rules: https://github.com/ossf/scorecard-action/blob/main/docs/authentication/fine-grained-auth-token.md
Security-Policy⚠️ 0security policy file not detected
SAST🟢 9SAST tool detected but not run on all commits
nuget/xunit 2.9.3 🟢 4.3
Details
CheckScoreReason
Code-Review⚠️ 1Found 4/30 approved changesets -- score normalized to 1
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Packaging⚠️ -1packaging workflow not detected
Maintained🟢 1011 commit(s) and 27 issue activity found in the last 90 days -- score normalized to 10
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Binary-Artifacts🟢 10no binaries found in the repo
Pinned-Dependencies⚠️ 0dependency not pinned by hash detected -- score normalized to 0
License🟢 9license file detected
Fuzzing⚠️ 0project is not fuzzed
Signed-Releases⚠️ -1no releases found
Branch-Protection⚠️ -1internal error: error during branchesHandler.setup: internal error: some github tokens can't read classic branch protection rules: https://github.com/ossf/scorecard-action/blob/main/docs/authentication/fine-grained-auth-token.md
Security-Policy⚠️ 0security policy file not detected
SAST⚠️ 0SAST tool is not run on all commits -- score normalized to 0
nuget/xunit.runner.visualstudio 3.1.5 UnknownUnknown

Scanned Files

  • tests/ExperimentFramework.Configuration.Tests/ExperimentFramework.Configuration.Tests.csproj

GitHub Copilot and others added 2 commits April 24, 2026 21:06
The Phase 5 PR added ServiceCollectionExtensionsTests.cs to
ExperimentFramework.Governance.Persistence.Redis.Tests — an assembly
that already contained RedisGovernancePersistenceBackplaneTests
(marked [Trait("Category","integration")]). This mixed-trait assembly
triggered a VSTest/xUnit filter edge case on Ubuntu CI: the
Category!=integration filter stopped properly excluding the
Testcontainers-based integration tests, causing Docker Redis container
startup to hang indefinitely. CI timed out after 54 minutes.

Root cause: When an xUnit assembly contains both trait-annotated
(Category=integration) and no-trait tests, the VSTest `!=` filter
on Ubuntu/Linux includes ALL tests including the Testcontainers ones,
which require Docker and can hang waiting for container startup.

Fix: remove ServiceCollectionExtensionsTests.cs, revert the Moq/MEDi
package additions, and delete the Windows-generated packages.lock.json
from the Redis tests project. The 7 DI service-collection tests will
be tracked for re-addition in a separate project or with proper CI
infrastructure in a follow-up.

Local validation: all other Phase 5 tests pass (79 Dashboard, 46
Governance.Persistence, 19 Configuration, 2094 core, etc.).

Tracking follow-up: move Redis ServiceCollection unit tests to a
standalone no-Testcontainers project so they run cleanly in CI.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The dotnet test step was re-building multi-target source projects (e.g.
ExperimentFramework.Audit targets net8/9/10) immediately before launching
the net10.0 test host, which caused the Audit.Tests host to hang
indefinitely during coverlet data-collector initialisation.

Adding --no-build skips the redundant rebuild (the Build (Release) step
already produced all required binaries) and removes the timing window
that triggered the hang.

Also adds missing packages.lock.json for Governance.Persistence.Tests
and Governance.Persistence.Redis.Tests so the NuGet cache key covers
all test projects and the --use-lock-file restore does not regenerate
lock files during the test step.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions github-actions Bot added the ci/cd label Apr 25, 2026
GitHub Copilot and others added 2 commits April 24, 2026 23:22
… hang

When dotnet test runs the full solution with --collect:'XPlat Code Coverage',
the test host process for ExperimentFramework.Tests (2094 tests, many project
refs) crashes during AfterTestRunEnd coverage data collection. On Linux CI
this manifests as a 55-minute silent hang (socket doesn't RST on crash),
consuming the entire 60-minute job timeout.

Fix: split the combined 'Test with coverage' step into two steps:
1. 'Test (verify correctness)' - full solution run, no coverage, no hang
2. 'Collect coverage (per-project)' - each project tested individually;
   isolated test hosts avoid the multi-session crash. The resulting
   coverage.cobertura.xml files are picked up by the existing reportgenerator
   step unchanged.

Applied the same split to the release job's test step.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The three Distributed.Redis test classes start real Docker containers via
Testcontainers but had no [Trait("Category","integration")] marker, so
they ran in the standard CI filter and blocked the test host waiting for
Docker — causing the hang that appeared after Dashboard.UI.Tests.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@JerrettDavis

Copy link
Copy Markdown
Owner Author

Closing — Phase 5 test additions cause repeated CI hangs/failures we couldn't resolve in budget. Coverage gains documented in commits 983368c (Governance.Persistence 5%→90%), 76d1ba0 (Dashboard 23%→65%), c04780c (Governance.Persistence.Redis 45%→80%), d5c549e (Configuration) for future cherry-pick. Main remains at ~87% coverage post-Phase-4.

@JerrettDavis JerrettDavis deleted the feat/coverage-phase-5 branch April 25, 2026 05:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant