Skip to content

Commit ba2d2a5

Browse files
authored
ci: migrate MTP reporting (#3068)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: fdbdcaaf-cc50-4b1b-b81f-0a43a08249b0
1 parent a917c11 commit ba2d2a5

7 files changed

Lines changed: 16 additions & 15 deletions

File tree

.azure-pipelines/ci-build.yml

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -105,20 +105,12 @@ extends:
105105
--configuration $(BuildConfiguration) `
106106
--no-build `
107107
-- `
108-
--report-xunit-trx `
109-
--results-directory "$(Agent.TempDirectory)\TestResults" `
108+
--report-azdo `
109+
--publish-azdo-test-results `
110+
--results-directory="$(Agent.TempDirectory)\TestResults" `
110111
--minimum-expected-tests 1
111112
displayName: 'test'
112113
113-
- task: PublishTestResults@2
114-
displayName: 'Publish test results'
115-
condition: succeededOrFailed()
116-
inputs:
117-
testResultsFormat: VSTest
118-
testResultsFiles: '$(Agent.TempDirectory)\TestResults\*.trx'
119-
failTaskOnMissingResultsFile: true
120-
failTaskOnFailedTests: true
121-
122114
- task: EsrpCodeSigning@6
123115
displayName: 'ESRP CodeSigning binaries'
124116
inputs:

.github/dependabot.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,12 @@ updates:
2020
MicrosoftExtensions:
2121
patterns:
2222
- Microsoft.Extensions.*
23-
coverlet:
23+
testing:
2424
patterns:
2525
- coverlet.*
26+
- Microsoft.NET.Test.Sdk
27+
- Microsoft.Testing.*
28+
- xunit.*
2629
cooldown:
2730
default-days: 7
2831
- package-ecosystem: dotnet-sdk

.github/workflows/ci-cd.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
id: run_unit_tests
4646
shell: pwsh
4747
run: |
48-
dotnet test --solution Microsoft.OpenApi.slnx -c Release -v n --coverlet --coverlet-output-format cobertura
48+
dotnet test --solution Microsoft.OpenApi.slnx -c Release -v n --results-directory=./TestResults --coverlet --coverlet-output-format cobertura --report-gh
4949
5050
- name: Install report generator
5151
shell: pwsh
@@ -55,7 +55,7 @@ jobs:
5555
- name: Generate coverage report
5656
shell: pwsh
5757
run: |
58-
reportgenerator -reports:**/coverage.cobertura*.xml -targetdir:./reports/coverage -reporttypes:"Html;MarkdownSummaryGithub;Cobertura"
58+
reportgenerator -reports:./TestResults/**/coverage.cobertura.*.xml -targetdir:./reports/coverage -reporttypes:"Html;MarkdownSummaryGithub;Cobertura"
5959
6060
- name: Add coverage to job summary
6161
shell: bash

.github/workflows/sonarcloud.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,5 +66,5 @@ jobs:
6666
dotnet tool run dotnet-sonarscanner begin /k:"microsoft_OpenAPI.NET" /o:"microsoft" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.opencover.reportsPaths="**/coverage.opencover*.xml"
6767
dotnet workload restore
6868
dotnet build
69-
dotnet test --solution Microsoft.OpenApi.slnx --verbosity normal --coverlet --coverlet-output-format opencover
69+
dotnet test --solution Microsoft.OpenApi.slnx --verbosity normal --coverlet --coverlet-output-format opencover --report-gh
7070
dotnet tool run dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"

test/Microsoft.OpenApi.Hidi.Tests/Microsoft.OpenApi.Hidi.Tests.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
<ItemGroup>
1717
<PackageReference Include="coverlet.MTP" Version="10.0.1" PrivateAssets="all" />
1818
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.9.0" />
19+
<PackageReference Include="Microsoft.Testing.Extensions.AzureDevOpsReport" Version="2.4.0" />
20+
<PackageReference Include="Microsoft.Testing.Extensions.GitHubActionsReport" Version="2.4.0" />
1921
<PackageReference Include="Moq" Version="4.20.72" />
2022
<PackageReference Include="xunit.v3" Version="4.0.0" />
2123
</ItemGroup>

test/Microsoft.OpenApi.Readers.Tests/Microsoft.OpenApi.Readers.Tests.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
<ItemGroup>
1919
<PackageReference Include="coverlet.MTP" Version="10.0.1" PrivateAssets="all" />
2020
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.9.0" />
21+
<PackageReference Include="Microsoft.Testing.Extensions.AzureDevOpsReport" Version="2.4.0" />
22+
<PackageReference Include="Microsoft.Testing.Extensions.GitHubActionsReport" Version="2.4.0" />
2123
<PackageReference Include="xunit.v3" Version="4.0.0" />
2224
</ItemGroup>
2325

test/Microsoft.OpenApi.Tests/Microsoft.OpenApi.Tests.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
<ItemGroup>
1212
<PackageReference Include="coverlet.MTP" Version="10.0.1" PrivateAssets="all" />
1313
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.9.0" />
14+
<PackageReference Include="Microsoft.Testing.Extensions.AzureDevOpsReport" Version="2.4.0" />
15+
<PackageReference Include="Microsoft.Testing.Extensions.GitHubActionsReport" Version="2.4.0" />
1416
<PackageReference Include="Moq" Version="4.20.72" />
1517
<PackageReference Include="Verify.XunitV3" Version="32.0.0" />
1618
<PackageReference Include="xunit.v3" Version="4.0.0" />

0 commit comments

Comments
 (0)