Skip to content

Commit c61d78e

Browse files
authored
Merge pull request #1016 from akunzai/build/mtp-and-code-coverage
build(test): migrate to Microsoft.Testing.Platform runner and native code coverage
2 parents b178d25 + e8d017f commit c61d78e

12 files changed

Lines changed: 41 additions & 9 deletions

File tree

.codecov.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
codecov:
2+
notify:
3+
after_n_builds: 2
4+
5+
comment:
6+
after_n_builds: 2
7+
8+
flag_management:
9+
default_rules:
10+
carryforward: true

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ updates:
3131
interval: weekly
3232
cooldown:
3333
default-days: 3
34+
ignore:
35+
- dependency-name: "coverlet.collector"
36+
update-types:
37+
- version-update:semver-major
38+
- version-update:semver-minor
3439
groups:
3540
aspnetcore:
3641
patterns:
@@ -53,6 +58,7 @@ updates:
5358
test-sdk:
5459
patterns:
5560
- Microsoft.NET.Test.Sdk
61+
- Microsoft.Testing.*
5662
- Microsoft.TestPlatform.ObjectModel
5763
xunit:
5864
patterns:

.github/workflows/build-owin.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ jobs:
4949
dotnet tool restore
5050
dotnet tool run reportgenerator
5151
- uses: codecov/codecov-action@v7
52+
with:
53+
flags: owin
5254
env:
5355
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
5456
- name: Check for changes in web.config

.github/workflows/build.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,12 @@ jobs:
4040
dotnet build -c Release
4141
- name: Test
4242
run: |
43-
dotnet test --collect:"XPlat Code Coverage" --filter "FullyQualifiedName!~E2E"
43+
dotnet test --coverage --coverage-output-format cobertura --filter "FullyQualifiedName!~E2E" --ignore-exit-code 8
4444
dotnet tool restore
4545
dotnet tool run reportgenerator
4646
[[ -f "./coverage/Summary.txt" ]] && cat "./coverage/Summary.txt"
4747
- uses: codecov/codecov-action@v7
48+
with:
49+
flags: core
4850
env:
4951
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/e2e-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ jobs:
246246
247247
- name: Run E2E Tests
248248
if: steps.check.outputs.run == 'true'
249-
run: dotnet test test/GSS.Authentication.CAS.E2E.Tests --logger "trx;LogFileName=test-results-${{ matrix.name }}.trx" --filter "FullyQualifiedName~${{ matrix.filter }}"
249+
run: dotnet test test/GSS.Authentication.CAS.E2E.Tests --report-trx --report-trx-filename "test-results-${{ matrix.name }}.trx" --results-directory test/GSS.Authentication.CAS.E2E.Tests/TestResults --filter "FullyQualifiedName~${{ matrix.filter }}" --ignore-exit-code 8
250250

251251
- name: Upload test results
252252
uses: actions/upload-artifact@v7

.netconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
; https://github.com/danielpalme/ReportGenerator
22
[ReportGenerator]
3-
reports = "**/coverage.cobertura.xml"
3+
reports = "**/*.cobertura.xml"
44
targetdir = "coverage"
55
reporttypes = Cobertura,TextSummary

AGENTS.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@ CAS 1.0/2.0/3.0 authentication middleware for ASP.NET Core and OWIN/Katana. NuGe
66

77
```shell
88
dotnet build
9-
dotnet test --filter "FullyQualifiedName!~E2E"
10-
dotnet test --filter "FullyQualifiedName~Cas20ServiceTicketValidatorTests.ValidateAsync"
9+
dotnet test --filter "FullyQualifiedName!~E2E" --ignore-exit-code 8
10+
dotnet test --coverage --coverage-output-format cobertura --filter "FullyQualifiedName!~E2E" --ignore-exit-code 8
11+
dotnet tool restore && dotnet tool run reportgenerator
12+
dotnet test --filter "Cas20ServiceTicketValidationTests" --ignore-exit-code 8
1113
cd owin && msbuild -noLogo -verbosity:minimal -restore # Windows + MSBuild only
1214
aube lint && aube build # samples/AspNetCoreReactSample/ClientApp
1315
```

Directory.Packages.props

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
<PackageVersion Include="System.Text.Json" Version="$(SystemPackagesVersion)" />
3535
</ItemGroup>
3636
<ItemGroup>
37-
<PackageVersion Include="coverlet.collector" Version="10.0.1" />
37+
<PackageVersion Include="coverlet.collector" Version="6.0.4" />
3838
<PackageVersion Include="Microsoft.AspNet.Mvc" Version="5.3.0" />
3939
<PackageVersion Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="$(MicrosoftAspNetCoreVersion)" />
4040
<PackageVersion Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="$(MicrosoftAspNetCoreVersion)" />
@@ -57,6 +57,8 @@
5757
<PackageVersion Include="Microsoft.Owin.Security.Cookies" Version="$(MicrosoftOwinVersion)" />
5858
<PackageVersion Include="Microsoft.Owin.Security.OpenIdConnect" Version="$(MicrosoftOwinVersion)" />
5959
<PackageVersion Include="Microsoft.Owin.Testing" Version="$(MicrosoftOwinVersion)" />
60+
<PackageVersion Include="Microsoft.Testing.Extensions.CodeCoverage" Version="18.10.0" />
61+
<PackageVersion Include="Microsoft.Testing.Extensions.TrxReport" Version="2.3.3" />
6062
<PackageVersion Include="Microsoft.TestPlatform.ObjectModel" Version="$(MicrosoftTestSdkVersion)" />
6163
<PackageVersion Include="NSubstitute" Version="6.1.0" />
6264
<PackageVersion Include="MSBuild.Microsoft.VisualStudio.Web.targets" Version="14.0.0.3" />

global.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,8 @@
33
"version": "10.0.100",
44
"rollForward": "latestFeature",
55
"allowPrerelease": false
6+
},
7+
"test": {
8+
"runner": "Microsoft.Testing.Platform"
69
}
710
}

owin/GSS.Authentication.CAS.Owin.Tests/GSS.Authentication.CAS.Owin.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<PackageReference Include="Microsoft.Owin.Testing" />
2020
<PackageReference Include="NSubstitute" />
2121
<PackageReference Include="System.Text.Json" />
22-
<PackageReference Include="coverlet.collector" VersionOverride="6.0.4" />
22+
<PackageReference Include="coverlet.collector" />
2323
<PackageReference Include="Microsoft.NET.Test.Sdk" />
2424
<PackageReference Include="xunit.v3" VersionOverride="3.2.2" />
2525
<PackageReference Include="xunit.runner.visualstudio" VersionOverride="3.1.5" PrivateAssets="All" />

0 commit comments

Comments
 (0)