Skip to content

Commit 4bc80e4

Browse files
dependabot[bot]Copilotbaywet
authored
Bump xunit.v3 from 3.2.2 to 4.0.0 (#3055)
* Bump xunit.v3 from 3.2.2 to 4.0.0 --- updated-dependencies: - dependency-name: xunit.v3 dependency-version: 4.0.0 dependency-type: direct:production update-type: version-update:semver-major - dependency-name: xunit.v3 dependency-version: 4.0.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * test(mtp): migrate xunit projects to MTP Co-authored-by: baywet <7905502+baywet@users.noreply.github.com> --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: baywet <7905502+baywet@users.noreply.github.com>
1 parent aadccaf commit 4bc80e4

7 files changed

Lines changed: 32 additions & 22 deletions

File tree

.azure-pipelines/ci-build.yml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,24 @@ extends:
100100
arguments: '--configuration $(BuildConfiguration) --no-incremental'
101101

102102
# Run the Unit test
103-
- task: DotNetCoreCLI@2
103+
- pwsh: |
104+
dotnet test "$(Build.SourcesDirectory)\Microsoft.OpenApi.slnx" `
105+
--configuration $(BuildConfiguration) `
106+
--no-build `
107+
-- `
108+
--report-xunit-trx `
109+
--results-directory "$(Agent.TempDirectory)\TestResults" `
110+
--minimum-expected-tests 1
104111
displayName: 'test'
112+
113+
- task: PublishTestResults@2
114+
displayName: 'Publish test results'
115+
condition: succeededOrFailed()
105116
inputs:
106-
command: test
107-
projects: '$(Build.SourcesDirectory)\Microsoft.OpenApi.slnx'
108-
arguments: '--configuration $(BuildConfiguration) --no-build'
117+
testResultsFormat: VSTest
118+
testResultsFiles: '$(Agent.TempDirectory)\TestResults\*.trx'
119+
failTaskOnMissingResultsFile: true
120+
failTaskOnFailedTests: true
109121

110122
- task: EsrpCodeSigning@6
111123
displayName: 'ESRP CodeSigning binaries'

.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 Microsoft.OpenApi.slnx -c Release --no-build -v n --collect:"XPlat Code Coverage"
48+
dotnet test --solution Microsoft.OpenApi.slnx -c Release -v n --coverlet --coverlet-output-format cobertura
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:**/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: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,10 @@ jobs:
6161
- name: Build and analyze
6262
env:
6363
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
64-
CollectCoverage: true
65-
CoverletOutputFormat: 'opencover' # https://github.com/microsoft/vstest/issues/4014#issuecomment-1307913682
6664
shell: pwsh
6765
run: |
68-
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="test/**/coverage.opencover.xml"
66+
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"
6967
dotnet workload restore
7068
dotnet build
71-
dotnet test Microsoft.OpenApi.slnx --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
69+
dotnet test --solution Microsoft.OpenApi.slnx --verbosity normal --coverlet --coverlet-output-format opencover
7270
dotnet tool run dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"

global.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
{
22
"sdk": {
33
"version": "10.0.400"
4+
},
5+
"test": {
6+
"runner": "Microsoft.Testing.Platform"
47
}
58
}

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,14 @@
1010
<NoWarn>CA2007</NoWarn>
1111
<SignAssembly>true</SignAssembly>
1212
<AssemblyOriginatorKeyFile>..\..\src\Microsoft.OpenApi.snk</AssemblyOriginatorKeyFile>
13+
<UseMicrosoftTestingPlatformRunner>true</UseMicrosoftTestingPlatformRunner>
1314
</PropertyGroup>
1415

1516
<ItemGroup>
16-
<PackageReference Include="coverlet.msbuild" Version="10.0.1" PrivateAssets="all" />
17+
<PackageReference Include="coverlet.MTP" Version="10.0.1" PrivateAssets="all" />
1718
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.9.0" />
1819
<PackageReference Include="Moq" Version="4.20.72" />
19-
<PackageReference Include="xunit.v3" Version="3.2.2" />
20-
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5" PrivateAssets="all" />
21-
<PackageReference Include="coverlet.collector" Version="10.0.1" PrivateAssets="all" />
20+
<PackageReference Include="xunit.v3" Version="4.0.0" />
2221
</ItemGroup>
2322

2423
<ItemGroup>

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
55
<SignAssembly>true</SignAssembly>
66
<AssemblyOriginatorKeyFile>..\..\src\Microsoft.OpenApi.snk</AssemblyOriginatorKeyFile>
7+
<UseMicrosoftTestingPlatformRunner>true</UseMicrosoftTestingPlatformRunner>
78
</PropertyGroup>
89
<ItemGroup>
910
<EmbeddedResource Include="**\*.yaml" Exclude="**\bin\**;**\obj\**">
@@ -15,12 +16,10 @@
1516
</ItemGroup>
1617

1718
<ItemGroup>
18-
<PackageReference Include="coverlet.collector" Version="10.0.1" PrivateAssets="all" />
19-
<PackageReference Include="coverlet.msbuild" Version="10.0.1" PrivateAssets="all" />
19+
<PackageReference Include="coverlet.MTP" Version="10.0.1" PrivateAssets="all" />
2020
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.9.0" />
2121
<PackageReference Include="FluentAssertions" Version="7.2.2" />
22-
<PackageReference Include="xunit.v3" Version="3.2.2" />
23-
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5" PrivateAssets="all" />
22+
<PackageReference Include="xunit.v3" Version="4.0.0" />
2423
</ItemGroup>
2524

2625
<ItemGroup>

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,16 @@
55
<SignAssembly>true</SignAssembly>
66
<OutputType>Library</OutputType>
77
<AssemblyOriginatorKeyFile>..\..\src\Microsoft.OpenApi.snk</AssemblyOriginatorKeyFile>
8+
<UseMicrosoftTestingPlatformRunner>true</UseMicrosoftTestingPlatformRunner>
89
</PropertyGroup>
910

1011
<ItemGroup>
11-
<PackageReference Include="coverlet.collector" Version="10.0.1" PrivateAssets="all" />
12-
<PackageReference Include="coverlet.msbuild" Version="10.0.1" PrivateAssets="all" />
12+
<PackageReference Include="coverlet.MTP" Version="10.0.1" PrivateAssets="all" />
1313
<PackageReference Include="FluentAssertions" Version="7.2.2" />
1414
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.9.0" />
1515
<PackageReference Include="Moq" Version="4.20.72" />
1616
<PackageReference Include="Verify.XunitV3" Version="31.28.0" />
17-
<PackageReference Include="xunit.v3" Version="3.2.2" />
18-
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5" PrivateAssets="all" />
17+
<PackageReference Include="xunit.v3" Version="4.0.0" />
1918
</ItemGroup>
2019

2120
<ItemGroup>

0 commit comments

Comments
 (0)