Skip to content

Add C# code coverage for ControlPanel pure-logic services - #12

Merged
chrisholloway5 merged 2 commits into
masterfrom
code-coverage-agent/setup-code-coverage-reporting
Aug 7, 2026
Merged

Add C# code coverage for ControlPanel pure-logic services#12
chrisholloway5 merged 2 commits into
masterfrom
code-coverage-agent/setup-code-coverage-reporting

Conversation

@code-coverage-agent

@code-coverage-agent code-coverage-agent AI commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

The repository had no test coverage infrastructure — CI only compiled the WPF ControlPanel without running any tests or generating coverage data.

Changes

ControlPanel.Core class library (hmailserver/source/Tools/ControlPanel.Core/)

  • New net8.0-windows library project that exposes the three side-effect-free services via shared <Compile Include="…"> links — no code moved or duplicated, existing ControlPanel project untouched
  • Covered: PasswordStrength, NumericField, PasswordGenerator

ControlPanel.Tests xUnit project (hmailserver/source/Tools/ControlPanel.Tests/)

  • 17 tests against ControlPanel.Core; uses coverlet.collector for native Cobertura XML output
  • Targets net8.0-windows to match the CI runner (windows-latest)

ci.yml — additive steps only, existing steps unchanged:

  • Restores and runs the test project with --collect:"XPlat Code Coverage" + Format=cobertura
  • PowerShell step normalises the GUID-nested output path to a stable coverage/coverage.cobertura.xml
  • Artifact upload skips fork PRs; a separate upload-coverage-csharp job (with code-quality: write) downloads and calls actions/upload-code-coverage@v1

.gitignore — coverage output, bin/, and obj/ for both new projects added

Coverage report flow

control-panel job
  └─ dotnet test --collect:"XPlat Code Coverage" → coverage/**/*.xml
  └─ pwsh: copy to coverage/coverage.cobertura.xml
  └─ upload-artifact: coverage-report-csharp

upload-coverage-csharp job (needs: control-panel)
  └─ download-artifact
  └─ upload-code-coverage (language: C#, label: code-coverage-agent)

Co-authored-by: chrisholloway5 <43516439+chrisholloway5@users.noreply.github.com>
@code-coverage-agent code-coverage-agent AI changed the title [WIP] Set up code coverage reporting and integrate with CI workflows Add C# code coverage for ControlPanel pure-logic services Aug 7, 2026
Code Coverage Agent finished work on behalf of chrisholloway5 August 7, 2026 04:56
@code-coverage-agent
code-coverage-agent AI marked this pull request as ready for review August 7, 2026 04:56
@github-code-quality

Copy link
Copy Markdown

Code Coverage Overview

Languages: C#

C# / code-coverage-agent

The overall coverage in commit 3b559a6 in the code-coverage-agent/... branch is 100%. Coverage data for the master branch is not yet available.

Show a code coverage summary of the most covered files.
File master code-coverage-agent/... 3b559a6 +/-
PasswordStrength.cs 100%
PasswordGenerator.cs 100%
NumericField.cs 100%

@chrisholloway5
chrisholloway5 merged commit 372b3b5 into master Aug 7, 2026
7 checks passed
@chrisholloway5
chrisholloway5 deleted the code-coverage-agent/setup-code-coverage-reporting branch August 7, 2026 05:12
chrisholloway5 added a commit that referenced this pull request Aug 7, 2026
Version bump to 6.2.9 (build 11) across the server (Version.h), the Control
Panel (ControlPanel.csproj) and the installer (section_setup_64.iss), plus
README release notes.

6.2.9 completes what 6.2.8 deliberately left out. No server-core changes.

  - LiveCharts moves to 2.0.5 (#11). 6.2.8 pinned it to 2.0.0-rc2 because the
    upgrade painted the dashboard charts as an opaque white block over the dark
    theme. CartesianChart derives from Control and 2.0.x gives it a solid
    default Background where the release candidate left it unset; the charts now
    set it explicitly. The empty-state labels were never hidden - they were
    light-grey text on that white block.

  - The Control Panel gains its first automated tests (#12), plus a solution for
    the .NET 8 stack.

Verified against a live 6.2.9 server: unit assertions, the offline
CollectionEditorView harness, the live DomainDialog/ServerSession harness, the
UI-automation pass, the dashboard render in both light and dark themes, and the
new xUnit suite.
chrisholloway5 added a commit that referenced this pull request Aug 7, 2026
Adds the repository's first automated test coverage for the Control Panel.

A net8.0-windows ControlPanel.Core library exposes three side-effect-free
services (PasswordStrength, NumericField, PasswordGenerator) via shared
<Compile Include> links, so no code moves and the existing ControlPanel project
is untouched. ControlPanel.Tests runs 17 xUnit tests against it with
coverlet.collector emitting Cobertura XML, and CI gains additive steps to run
them and publish the coverage report.

Verified locally before merge: builds clean, 17/17 tests pass, the Control
Panel itself still builds warning-free under -warnaserror, and the change
merges without conflict against the 6.2.8 line.
chrisholloway5 added a commit that referenced this pull request Aug 7, 2026
Version bump to 6.2.9 (build 11) across the server (Version.h), the Control
Panel (ControlPanel.csproj) and the installer (section_setup_64.iss), plus
README release notes.

6.2.9 completes what 6.2.8 deliberately left out. No server-core changes.

  - LiveCharts moves to 2.0.5 (#11). 6.2.8 pinned it to 2.0.0-rc2 because the
    upgrade painted the dashboard charts as an opaque white block over the dark
    theme. CartesianChart derives from Control and 2.0.x gives it a solid
    default Background where the release candidate left it unset; the charts now
    set it explicitly. The empty-state labels were never hidden - they were
    light-grey text on that white block.

  - The Control Panel gains its first automated tests (#12), plus a solution for
    the .NET 8 stack.

Verified against a live 6.2.9 server: unit assertions, the offline
CollectionEditorView harness, the live DomainDialog/ServerSession harness, the
UI-automation pass, the dashboard render in both light and dark themes, and the
new xUnit suite.
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