Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions .github/scripts/coverage.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,24 @@ $projectRoot = (Resolve-Path "$PSScriptRoot\..\..")

Push-Location $projectRoot
try {
Remove-Item -Path "SubathonManager.Tests\TestResults\*" -Recurse -Force
dotnet test --collect:"XPlat Code Coverage" `
/p:Exclude="[SubathonManager.Data.Migrations]*" `
/p:CollectCoverage=true `
/p:CoverletOutputFormat=cobertura `
/p:ExcludeByFile="**/*.g.cs"
Remove-Item -Path "SubathonManager.Tests\TestResults\*" -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item -Path "coverage-local" -Recurse -Force -ErrorAction SilentlyContinue

dotnet test SubathonManager.Tests\SubathonManager.Tests.csproj `
--results-directory coverage-local `
--coverage `
--coverage-output-format cobertura `
--coverage-output coverage.cobertura.xml

reportgenerator `
-reports:"**\coverage.cobertura.xml" `
-reports:"**\*.cobertura.xml" `
-targetdir:"coverage-report" `
-reporttypes:Html `
-classfilters:"+*;-SubathonManager.Data.Migrations.*" `
-filefilters:"-**/*.g.cs"

Invoke-Item coverage-report/index.html
}
finally {
Pop-Location
}
}
24 changes: 13 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,15 @@ jobs:
run: |
dotnet test SubathonManager.Tests/SubathonManager.Tests.csproj \
--configuration Release \
--logger "console;verbosity=detailed" \
--logger "trx;LogFileName=test-results.trx" \
--blame \
--blame-crash \
--blame-hang \
--blame-hang-timeout 5m \
--collect:"XPlat Code Coverage" \
--results-directory ./coverage \
-- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.ExcludeByFile="**/Migrations/**;**/*.g.cs;**/SubathonManager.UI/**"
-p:TestingPlatformShowTestsFailure=true \
--report-trx \
--report-trx-filename test-results.trx \
--crashdump \
--hangdump \
--hangdump-timeout 5m \
--coverage \
--coverage-output-format cobertura

- name: Show blame / crash diagnostics
if: always()
Expand Down Expand Up @@ -132,15 +132,17 @@ jobs:
- name: List raw coverage files
if: always()
shell: bash
run: ls -la coverage/**/coverage.cobertura.xml || true

run: find . -name '*.cobertura.xml' -print || true
- name: Merge coverage reports
if: always()
uses: danielpalme/ReportGenerator-GitHub-Action@5
with:
reports: coverage/**/coverage.cobertura.xml
reports: '**/*.cobertura.xml'
targetdir: coverage-merged
reporttypes: Cobertura
assemblyfilters: '-SubathonManager.UI'
filefilters: '-**/Migrations/**;-**/*.g.cs'

- name: Code Coverage Summary Report
if: always()
Expand Down
28 changes: 12 additions & 16 deletions SubathonManager.Tests/SubathonManager.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">

<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
Expand All @@ -12,29 +11,26 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="coverlet.collector" Version="10.0.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="10.0.9" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="10.0.9" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.7.0" />

<PackageReference Include="Microsoft.Testing.Extensions.CodeCoverage" Version="*" />
<PackageReference Include="Microsoft.Testing.Extensions.TrxReport" Version="*" />
<PackageReference Include="Microsoft.Testing.Extensions.CrashDump" Version="*" />
<PackageReference Include="Microsoft.Testing.Extensions.HangDump" Version="*" />

<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="10.0.11" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="10.0.11" />
<PackageReference Include="Moq" Version="4.20.72" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5" />
<PackageReference Include="xunit.v3" Version="3.2.2" />
<PackageReference Include="xunit.v3" Version="4.0.0" />
</ItemGroup>

<ItemGroup>
<Using Include="SubathonManager.Core" />
<Using Include="Xunit" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\SubathonManager.Core\SubathonManager.Core.csproj" />
<ProjectReference Include="..\SubathonManager.Data\SubathonManager.Data.csproj" />
<ProjectReference Include="..\SubathonManager.Integration\SubathonManager.Integration.csproj" />
<ProjectReference Include="..\SubathonManager.Server\SubathonManager.Server.csproj" />
<ProjectReference Include="..\SubathonManager.Services\SubathonManager.Services.csproj" />
</ItemGroup>

</Project>
</Project>
2 changes: 1 addition & 1 deletion SubathonManager.UI/SubathonManager.UI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
<PackageReference Include="Avalonia.Themes.Fluent" Version="12.1.1" />
<PackageReference Include="Avalonia.Fonts.Inter" Version="12.1.1" />

<PackageReference Include="FluentAvaloniaUI" Version="3.0.2" />
<PackageReference Include="FluentAvaloniaUI" Version="3.1.0" />

<PackageReference Include="FluentIcons.Avalonia" Version="2.1.337" />

Expand Down
5 changes: 4 additions & 1 deletion global.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,8 @@
"version": "10.0.0",
"rollForward": "latestMajor",
"allowPrerelease": true
},
"test": {
"runner": "Microsoft.Testing.Platform"
}
}
}
Loading