New gclo.Cli.Tests project (65 tests) covers the CLI to 100% line coverage by driving injectable command cores over fake collaborators: - Commands (sync/orgs/accounts) split into a thin composition-root wrapper (excluded — it wires the real GitHub listers, LibGit2 client, and Credential Manager) and an internal core taking IRepositoryLister/ IOrganizationLister/IGitClient/account-open-func/IActivityLog. Tests capture the process Console (sequentially — the assembly disables test parallelization since Console is global) and assert output, exit codes, and error translation. - Covered: argument parsing and every usage error, token resolution (env/file/redirected-stdin/multi-source), account seeding + org subfolder, unknown/missing-token accounts, sync success/partial- failure/canceled, JSON and quiet output, path sanitization (recover/ fail/cancel), invalid-path listing + truncation, and the record-result warning path. - Excluded (auditable): Program (composition root), TokenOptions' interactive no-echo read, and each command's real-collaborator wrapper. CI now runs both test projects under coverage.runsettings and fails unless gclo.Engine, gclo.ViewModels, and gclo (the CLI) each measure 100% line coverage. Verified locally: 100.00% / 100.00% / 100.00%. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
27 lines
1.4 KiB
XML
27 lines
1.4 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- Coverage contract for the 100% gate: every hand-written line in the three
|
|
library assemblies counts. Excluded, with intent:
|
|
- GeneratedCodeAttribute: System.Text.Json source-generated serializer
|
|
contexts (AccountsJsonContext, AppSettingsJsonContext) — generated code,
|
|
regenerated on every build, not ours to test line-by-line.
|
|
- ExcludeFromCodeCoverageAttribute: thin, hand-audited adapters over
|
|
external systems that cannot run offline (each carries a justification
|
|
comment at its declaration).
|
|
The WinUI view project (gclo) is not measured here at all: XAML-generated
|
|
plumbing needs a live compositor and is exercised by the FlaUI e2e suite. -->
|
|
<RunSettings>
|
|
<DataCollectionRunSettings>
|
|
<DataCollectors>
|
|
<DataCollector friendlyName="XPlat Code Coverage">
|
|
<Configuration>
|
|
<Format>cobertura</Format>
|
|
<!-- The CLI project's assembly name is 'gclo' (it ships as gclo.exe), so it
|
|
appears as package 'gclo' — not 'gclo.Cli' — in the report. -->
|
|
<Include>[gclo.Engine]*,[gclo.ViewModels]*,[gclo]*</Include>
|
|
<ExcludeByAttribute>GeneratedCodeAttribute,ExcludeFromCodeCoverageAttribute</ExcludeByAttribute>
|
|
</Configuration>
|
|
</DataCollector>
|
|
</DataCollectors>
|
|
</DataCollectionRunSettings>
|
|
</RunSettings>
|