chore(infra): configure coverlet for backend C# coverage
Add coverlet.runsettings with Cobertura format, exclusions for migrations, DI wiring, Program.cs and auto-props. Document coverage commands in README. coverlet.collector 6.0.4 was already present via Directory.Packages.props. Coverage baseline (Application.Tests + Api.Tests combined): - Application.Tests: line 80.9%, branch 65.3% - Api.Tests: line 64.9%, branch 57.8% Closes #48
This commit is contained in:
48
coverlet.runsettings
Normal file
48
coverlet.runsettings
Normal file
@@ -0,0 +1,48 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RunSettings>
|
||||
<!--
|
||||
Configuracion de coverage con coverlet.collector.
|
||||
Uso: dotnet test /collect:"XPlat Code Coverage" /settings:coverlet.runsettings /results-directory:./TestResults
|
||||
-->
|
||||
<RunConfiguration>
|
||||
<!-- Mantener ejecución secuencial (hereda política de tests.runsettings) -->
|
||||
<MaxCpuCount>1</MaxCpuCount>
|
||||
</RunConfiguration>
|
||||
|
||||
<DataCollectionRunSettings>
|
||||
<DataCollectors>
|
||||
<DataCollector friendlyName="XPlat Code Coverage">
|
||||
<Configuration>
|
||||
<!-- Formato de salida: cobertura (compatible con ReportGenerator y CI/CD) -->
|
||||
<Format>cobertura</Format>
|
||||
|
||||
<!-- Exclusiones por atributo generado -->
|
||||
<ExcludeByAttribute>GeneratedCodeAttribute,ExcludeFromCodeCoverageAttribute</ExcludeByAttribute>
|
||||
|
||||
<!-- Exclusiones por tipo/namespace -->
|
||||
<Exclude>
|
||||
<!-- Migrations embebidas (SQL scripts, no lógica de negocio) -->
|
||||
[*.Migrations]*,
|
||||
<!-- Los proyectos de test no se miden a sí mismos -->
|
||||
[*.Tests]*,
|
||||
[SIGCM2.TestSupport]*,
|
||||
<!-- Program.cs: host wiring, no testeable unitariamente -->
|
||||
[SIGCM2.Api]Program,
|
||||
<!-- Extension methods de DI: una línea por registro, ruido sin valor -->
|
||||
[*]*.Extensions.*Extensions,
|
||||
[*]*.DependencyInjection
|
||||
</Exclude>
|
||||
|
||||
<!-- No medir las propiedades auto-implementadas -->
|
||||
<SkipAutoProps>true</SkipAutoProps>
|
||||
|
||||
<!-- No incluir el assembly de tests en el reporte -->
|
||||
<IncludeTestAssembly>false</IncludeTestAssembly>
|
||||
|
||||
<!-- Permitir timestamps reales en el reporte (no forzar determinismo) -->
|
||||
<DeterministicReport>false</DeterministicReport>
|
||||
</Configuration>
|
||||
</DataCollector>
|
||||
</DataCollectors>
|
||||
</DataCollectionRunSettings>
|
||||
</RunSettings>
|
||||
Reference in New Issue
Block a user