From db00c6677011122b250d5583766fb3315fb7996a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Aug 2026 21:30:26 +0000 Subject: [PATCH 01/17] 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] --- .../Microsoft.OpenApi.Hidi.Tests.csproj | 2 +- .../Microsoft.OpenApi.Readers.Tests.csproj | 2 +- test/Microsoft.OpenApi.Tests/Microsoft.OpenApi.Tests.csproj | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/Microsoft.OpenApi.Hidi.Tests/Microsoft.OpenApi.Hidi.Tests.csproj b/test/Microsoft.OpenApi.Hidi.Tests/Microsoft.OpenApi.Hidi.Tests.csproj index 95b457369..411a879a1 100644 --- a/test/Microsoft.OpenApi.Hidi.Tests/Microsoft.OpenApi.Hidi.Tests.csproj +++ b/test/Microsoft.OpenApi.Hidi.Tests/Microsoft.OpenApi.Hidi.Tests.csproj @@ -16,7 +16,7 @@ - + diff --git a/test/Microsoft.OpenApi.Readers.Tests/Microsoft.OpenApi.Readers.Tests.csproj b/test/Microsoft.OpenApi.Readers.Tests/Microsoft.OpenApi.Readers.Tests.csproj index 7e6e44e78..c7883d3cc 100644 --- a/test/Microsoft.OpenApi.Readers.Tests/Microsoft.OpenApi.Readers.Tests.csproj +++ b/test/Microsoft.OpenApi.Readers.Tests/Microsoft.OpenApi.Readers.Tests.csproj @@ -19,7 +19,7 @@ - + diff --git a/test/Microsoft.OpenApi.Tests/Microsoft.OpenApi.Tests.csproj b/test/Microsoft.OpenApi.Tests/Microsoft.OpenApi.Tests.csproj index 38941aae6..dbcbb3913 100644 --- a/test/Microsoft.OpenApi.Tests/Microsoft.OpenApi.Tests.csproj +++ b/test/Microsoft.OpenApi.Tests/Microsoft.OpenApi.Tests.csproj @@ -14,7 +14,7 @@ - + From 20ef98d15d0c9b702aba6809b95cbafbaa912c4f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 25 Aug 2026 11:10:45 +0000 Subject: [PATCH 02/17] test(mtp): migrate xunit projects to MTP Co-authored-by: baywet <7905502+baywet@users.noreply.github.com> --- .github/workflows/ci-cd.yml | 4 ++-- .github/workflows/sonarcloud.yml | 6 ++---- global.json | 3 +++ .../Microsoft.OpenApi.Hidi.Tests.csproj | 5 ++--- .../Microsoft.OpenApi.Readers.Tests.csproj | 5 ++--- test/Microsoft.OpenApi.Tests/Microsoft.OpenApi.Tests.csproj | 5 ++--- 6 files changed, 13 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 13136e298..08e79d22a 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -45,7 +45,7 @@ jobs: id: run_unit_tests shell: pwsh run: | - dotnet test Microsoft.OpenApi.slnx -c Release --no-build -v n --collect:"XPlat Code Coverage" + dotnet test --solution Microsoft.OpenApi.slnx -c Release -v n --coverlet --coverlet-output-format cobertura - name: Install report generator shell: pwsh @@ -55,7 +55,7 @@ jobs: - name: Generate coverage report shell: pwsh run: | - reportgenerator -reports:**/coverage.cobertura.xml -targetdir:./reports/coverage -reporttypes:"Html;MarkdownSummaryGithub;Cobertura" + reportgenerator -reports:**/coverage.cobertura*.xml -targetdir:./reports/coverage -reporttypes:"Html;MarkdownSummaryGithub;Cobertura" - name: Add coverage to job summary shell: bash diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index d0ec5d462..2da4e7d46 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -61,12 +61,10 @@ jobs: - name: Build and analyze env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any - CollectCoverage: true - CoverletOutputFormat: 'opencover' # https://github.com/microsoft/vstest/issues/4014#issuecomment-1307913682 shell: pwsh run: | - 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" + 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" dotnet workload restore dotnet build - dotnet test Microsoft.OpenApi.slnx --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover + dotnet test --solution Microsoft.OpenApi.slnx --verbosity normal --coverlet --coverlet-output-format opencover dotnet tool run dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}" \ No newline at end of file diff --git a/global.json b/global.json index 151193853..2f38dd557 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,8 @@ { "sdk": { "version": "10.0.400" + }, + "test": { + "runner": "Microsoft.Testing.Platform" } } \ No newline at end of file diff --git a/test/Microsoft.OpenApi.Hidi.Tests/Microsoft.OpenApi.Hidi.Tests.csproj b/test/Microsoft.OpenApi.Hidi.Tests/Microsoft.OpenApi.Hidi.Tests.csproj index 411a879a1..57543e05e 100644 --- a/test/Microsoft.OpenApi.Hidi.Tests/Microsoft.OpenApi.Hidi.Tests.csproj +++ b/test/Microsoft.OpenApi.Hidi.Tests/Microsoft.OpenApi.Hidi.Tests.csproj @@ -10,15 +10,14 @@ CA2007 true ..\..\src\Microsoft.OpenApi.snk + true - + - - diff --git a/test/Microsoft.OpenApi.Readers.Tests/Microsoft.OpenApi.Readers.Tests.csproj b/test/Microsoft.OpenApi.Readers.Tests/Microsoft.OpenApi.Readers.Tests.csproj index c7883d3cc..dcbb3cebd 100644 --- a/test/Microsoft.OpenApi.Readers.Tests/Microsoft.OpenApi.Readers.Tests.csproj +++ b/test/Microsoft.OpenApi.Readers.Tests/Microsoft.OpenApi.Readers.Tests.csproj @@ -4,6 +4,7 @@ false true ..\..\src\Microsoft.OpenApi.snk + true @@ -15,12 +16,10 @@ - - + - diff --git a/test/Microsoft.OpenApi.Tests/Microsoft.OpenApi.Tests.csproj b/test/Microsoft.OpenApi.Tests/Microsoft.OpenApi.Tests.csproj index dbcbb3913..a2b406061 100644 --- a/test/Microsoft.OpenApi.Tests/Microsoft.OpenApi.Tests.csproj +++ b/test/Microsoft.OpenApi.Tests/Microsoft.OpenApi.Tests.csproj @@ -5,17 +5,16 @@ true Library ..\..\src\Microsoft.OpenApi.snk + true - - + - From d44be1526fb353bed5b337e6b2fc532e92d25598 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 25 Aug 2026 11:36:56 +0000 Subject: [PATCH 03/17] ci(azure): run xunit MTP test apps directly Co-authored-by: baywet <7905502+baywet@users.noreply.github.com> --- .azure-pipelines/ci-build.yml | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/.azure-pipelines/ci-build.yml b/.azure-pipelines/ci-build.yml index d29a6192a..1ea768fea 100644 --- a/.azure-pipelines/ci-build.yml +++ b/.azure-pipelines/ci-build.yml @@ -100,12 +100,32 @@ extends: arguments: '--configuration $(BuildConfiguration) --no-incremental' # Run the Unit test - - task: DotNetCoreCLI@2 + - pwsh: | + $testResultsDirectory = "$(Agent.TempDirectory)\TestResults" + New-Item -ItemType Directory -Force -Path $testResultsDirectory | Out-Null + + $testApplications = @( + @{ Name = "Microsoft.OpenApi.Hidi.Tests"; Path = "$(Build.SourcesDirectory)\test\Microsoft.OpenApi.Hidi.Tests\bin\$(BuildConfiguration)\net10.0\Microsoft.OpenApi.Hidi.Tests.exe" }, + @{ Name = "Microsoft.OpenApi.Readers.Tests"; Path = "$(Build.SourcesDirectory)\test\Microsoft.OpenApi.Readers.Tests\bin\$(BuildConfiguration)\net10.0\Microsoft.OpenApi.Readers.Tests.exe" }, + @{ Name = "Microsoft.OpenApi.Tests"; Path = "$(Build.SourcesDirectory)\test\Microsoft.OpenApi.Tests\bin\$(BuildConfiguration)\net10.0\Microsoft.OpenApi.Tests.exe" } + ) + + foreach ($testApplication in $testApplications) { + & $testApplication.Path --report-xunit-trx --report-xunit-trx-filename "$($testApplication.Name).trx" --results-directory $testResultsDirectory --minimum-expected-tests 1 + if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE + } + } displayName: 'test' + + - task: PublishTestResults@2 + displayName: 'Publish test results' + condition: succeededOrFailed() inputs: - command: test - projects: '$(Build.SourcesDirectory)\Microsoft.OpenApi.slnx' - arguments: '--configuration $(BuildConfiguration) --no-build' + testResultsFormat: VSTest + testResultsFiles: '$(Agent.TempDirectory)\TestResults\*.trx' + failTaskOnMissingResultsFile: true + failTaskOnFailedTests: true - task: EsrpCodeSigning@6 displayName: 'ESRP CodeSigning binaries' From 5406f82e7db7e64a1c8a625d440189ac51264bb4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 25 Aug 2026 11:37:36 +0000 Subject: [PATCH 04/17] ci(azure): centralize test target framework Co-authored-by: baywet <7905502+baywet@users.noreply.github.com> --- .azure-pipelines/ci-build.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.azure-pipelines/ci-build.yml b/.azure-pipelines/ci-build.yml index 1ea768fea..32c68ee64 100644 --- a/.azure-pipelines/ci-build.yml +++ b/.azure-pipelines/ci-build.yml @@ -102,12 +102,13 @@ extends: # Run the Unit test - pwsh: | $testResultsDirectory = "$(Agent.TempDirectory)\TestResults" + $targetFramework = "net10.0" New-Item -ItemType Directory -Force -Path $testResultsDirectory | Out-Null $testApplications = @( - @{ Name = "Microsoft.OpenApi.Hidi.Tests"; Path = "$(Build.SourcesDirectory)\test\Microsoft.OpenApi.Hidi.Tests\bin\$(BuildConfiguration)\net10.0\Microsoft.OpenApi.Hidi.Tests.exe" }, - @{ Name = "Microsoft.OpenApi.Readers.Tests"; Path = "$(Build.SourcesDirectory)\test\Microsoft.OpenApi.Readers.Tests\bin\$(BuildConfiguration)\net10.0\Microsoft.OpenApi.Readers.Tests.exe" }, - @{ Name = "Microsoft.OpenApi.Tests"; Path = "$(Build.SourcesDirectory)\test\Microsoft.OpenApi.Tests\bin\$(BuildConfiguration)\net10.0\Microsoft.OpenApi.Tests.exe" } + @{ Name = "Microsoft.OpenApi.Hidi.Tests"; Path = "$(Build.SourcesDirectory)\test\Microsoft.OpenApi.Hidi.Tests\bin\$(BuildConfiguration)\$targetFramework\Microsoft.OpenApi.Hidi.Tests.exe" }, + @{ Name = "Microsoft.OpenApi.Readers.Tests"; Path = "$(Build.SourcesDirectory)\test\Microsoft.OpenApi.Readers.Tests\bin\$(BuildConfiguration)\$targetFramework\Microsoft.OpenApi.Readers.Tests.exe" }, + @{ Name = "Microsoft.OpenApi.Tests"; Path = "$(Build.SourcesDirectory)\test\Microsoft.OpenApi.Tests\bin\$(BuildConfiguration)\$targetFramework\Microsoft.OpenApi.Tests.exe" } ) foreach ($testApplication in $testApplications) { From 9d749ca76ceda282958341834d8fc389fdcf1f51 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 25 Aug 2026 11:38:10 +0000 Subject: [PATCH 05/17] ci(azure): define test target framework variable Co-authored-by: baywet <7905502+baywet@users.noreply.github.com> --- .azure-pipelines/ci-build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.azure-pipelines/ci-build.yml b/.azure-pipelines/ci-build.yml index 32c68ee64..afe324f0e 100644 --- a/.azure-pipelines/ci-build.yml +++ b/.azure-pipelines/ci-build.yml @@ -21,6 +21,7 @@ pr: variables: buildPlatform: 'Any CPU' buildConfiguration: 'Release' + testTargetFramework: 'net10.0' ProductBinPath: '$(Build.SourcesDirectory)\src\Microsoft.OpenApi\bin\$(BuildConfiguration)' REGISTRY: 'msgraphprodregistry.azurecr.io' IMAGE_NAME: 'public/openapi/hidi' @@ -102,7 +103,7 @@ extends: # Run the Unit test - pwsh: | $testResultsDirectory = "$(Agent.TempDirectory)\TestResults" - $targetFramework = "net10.0" + $targetFramework = "$(testTargetFramework)" New-Item -ItemType Directory -Force -Path $testResultsDirectory | Out-Null $testApplications = @( From a88a909426f2b5afaa08a023626481e51557e908 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 25 Aug 2026 11:38:52 +0000 Subject: [PATCH 06/17] ci(azure): collect all mtp test results Co-authored-by: baywet <7905502+baywet@users.noreply.github.com> --- .azure-pipelines/ci-build.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.azure-pipelines/ci-build.yml b/.azure-pipelines/ci-build.yml index afe324f0e..a417ea225 100644 --- a/.azure-pipelines/ci-build.yml +++ b/.azure-pipelines/ci-build.yml @@ -21,6 +21,7 @@ pr: variables: buildPlatform: 'Any CPU' buildConfiguration: 'Release' + # Keep in sync with the test project TargetFramework values. testTargetFramework: 'net10.0' ProductBinPath: '$(Build.SourcesDirectory)\src\Microsoft.OpenApi\bin\$(BuildConfiguration)' REGISTRY: 'msgraphprodregistry.azurecr.io' @@ -112,12 +113,15 @@ extends: @{ Name = "Microsoft.OpenApi.Tests"; Path = "$(Build.SourcesDirectory)\test\Microsoft.OpenApi.Tests\bin\$(BuildConfiguration)\$targetFramework\Microsoft.OpenApi.Tests.exe" } ) + $exitCode = 0 foreach ($testApplication in $testApplications) { & $testApplication.Path --report-xunit-trx --report-xunit-trx-filename "$($testApplication.Name).trx" --results-directory $testResultsDirectory --minimum-expected-tests 1 if ($LASTEXITCODE -ne 0) { - exit $LASTEXITCODE + $exitCode = $LASTEXITCODE } } + + exit $exitCode displayName: 'test' - task: PublishTestResults@2 From 1a8572feb00d06ef62d2f738d6fb372e5ce2156c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 25 Aug 2026 11:40:02 +0000 Subject: [PATCH 07/17] ci(azure): discover mtp test executables Co-authored-by: baywet <7905502+baywet@users.noreply.github.com> --- .azure-pipelines/ci-build.yml | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/.azure-pipelines/ci-build.yml b/.azure-pipelines/ci-build.yml index a417ea225..16eec6a76 100644 --- a/.azure-pipelines/ci-build.yml +++ b/.azure-pipelines/ci-build.yml @@ -21,8 +21,6 @@ pr: variables: buildPlatform: 'Any CPU' buildConfiguration: 'Release' - # Keep in sync with the test project TargetFramework values. - testTargetFramework: 'net10.0' ProductBinPath: '$(Build.SourcesDirectory)\src\Microsoft.OpenApi\bin\$(BuildConfiguration)' REGISTRY: 'msgraphprodregistry.azurecr.io' IMAGE_NAME: 'public/openapi/hidi' @@ -104,20 +102,29 @@ extends: # Run the Unit test - pwsh: | $testResultsDirectory = "$(Agent.TempDirectory)\TestResults" - $targetFramework = "$(testTargetFramework)" New-Item -ItemType Directory -Force -Path $testResultsDirectory | Out-Null $testApplications = @( - @{ Name = "Microsoft.OpenApi.Hidi.Tests"; Path = "$(Build.SourcesDirectory)\test\Microsoft.OpenApi.Hidi.Tests\bin\$(BuildConfiguration)\$targetFramework\Microsoft.OpenApi.Hidi.Tests.exe" }, - @{ Name = "Microsoft.OpenApi.Readers.Tests"; Path = "$(Build.SourcesDirectory)\test\Microsoft.OpenApi.Readers.Tests\bin\$(BuildConfiguration)\$targetFramework\Microsoft.OpenApi.Readers.Tests.exe" }, - @{ Name = "Microsoft.OpenApi.Tests"; Path = "$(Build.SourcesDirectory)\test\Microsoft.OpenApi.Tests\bin\$(BuildConfiguration)\$targetFramework\Microsoft.OpenApi.Tests.exe" } + @{ Name = "Microsoft.OpenApi.Hidi.Tests"; Pattern = "$(Build.SourcesDirectory)\test\Microsoft.OpenApi.Hidi.Tests\bin\$(BuildConfiguration)\*\Microsoft.OpenApi.Hidi.Tests.exe" }, + @{ Name = "Microsoft.OpenApi.Readers.Tests"; Pattern = "$(Build.SourcesDirectory)\test\Microsoft.OpenApi.Readers.Tests\bin\$(BuildConfiguration)\*\Microsoft.OpenApi.Readers.Tests.exe" }, + @{ Name = "Microsoft.OpenApi.Tests"; Pattern = "$(Build.SourcesDirectory)\test\Microsoft.OpenApi.Tests\bin\$(BuildConfiguration)\*\Microsoft.OpenApi.Tests.exe" } ) $exitCode = 0 foreach ($testApplication in $testApplications) { - & $testApplication.Path --report-xunit-trx --report-xunit-trx-filename "$($testApplication.Name).trx" --results-directory $testResultsDirectory --minimum-expected-tests 1 - if ($LASTEXITCODE -ne 0) { - $exitCode = $LASTEXITCODE + $testExecutables = @(Get-Item -Path $testApplication.Pattern -ErrorAction SilentlyContinue) + if ($testExecutables.Count -eq 0) { + Write-Error "No test executable found for $($testApplication.Name)" + $exitCode = 1 + continue + } + + foreach ($testExecutable in $testExecutables) { + $targetFramework = Split-Path -Path $testExecutable.DirectoryName -Leaf + & $testExecutable.FullName --report-xunit-trx --report-xunit-trx-filename "$($testApplication.Name)-$targetFramework.trx" --results-directory $testResultsDirectory --minimum-expected-tests 1 + if ($LASTEXITCODE -ne 0) { + $exitCode = 1 + } } } From 7cc75c47cf09a683fcef33dd5b1bcbd86b61aaa4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 25 Aug 2026 11:41:00 +0000 Subject: [PATCH 08/17] ci(azure): discover xunit mtp test apps Co-authored-by: baywet <7905502+baywet@users.noreply.github.com> --- .azure-pipelines/ci-build.yml | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/.azure-pipelines/ci-build.yml b/.azure-pipelines/ci-build.yml index 16eec6a76..e09d7d2f6 100644 --- a/.azure-pipelines/ci-build.yml +++ b/.azure-pipelines/ci-build.yml @@ -104,27 +104,22 @@ extends: $testResultsDirectory = "$(Agent.TempDirectory)\TestResults" New-Item -ItemType Directory -Force -Path $testResultsDirectory | Out-Null - $testApplications = @( - @{ Name = "Microsoft.OpenApi.Hidi.Tests"; Pattern = "$(Build.SourcesDirectory)\test\Microsoft.OpenApi.Hidi.Tests\bin\$(BuildConfiguration)\*\Microsoft.OpenApi.Hidi.Tests.exe" }, - @{ Name = "Microsoft.OpenApi.Readers.Tests"; Pattern = "$(Build.SourcesDirectory)\test\Microsoft.OpenApi.Readers.Tests\bin\$(BuildConfiguration)\*\Microsoft.OpenApi.Readers.Tests.exe" }, - @{ Name = "Microsoft.OpenApi.Tests"; Pattern = "$(Build.SourcesDirectory)\test\Microsoft.OpenApi.Tests\bin\$(BuildConfiguration)\*\Microsoft.OpenApi.Tests.exe" } - ) + $testExecutables = @(Get-ChildItem -Path "$(Build.SourcesDirectory)\test" -Recurse -Filter "*.Tests.exe" | Where-Object { + $_.Directory.Parent.Name -eq "$(BuildConfiguration)" -and + $_.BaseName -eq $_.Directory.Parent.Parent.Parent.Name -and + (Test-Path (Join-Path $_.DirectoryName "xunit.v3.mtp-v2.dll")) + }) + if ($testExecutables.Count -eq 0) { + Write-Error "No xUnit MTP test executable found" + exit 1 + } $exitCode = 0 - foreach ($testApplication in $testApplications) { - $testExecutables = @(Get-Item -Path $testApplication.Pattern -ErrorAction SilentlyContinue) - if ($testExecutables.Count -eq 0) { - Write-Error "No test executable found for $($testApplication.Name)" + foreach ($testExecutable in $testExecutables | Sort-Object FullName) { + $targetFramework = Split-Path -Path $testExecutable.DirectoryName -Leaf + & $testExecutable.FullName --report-xunit-trx --report-xunit-trx-filename "$($testExecutable.BaseName)-$targetFramework.trx" --results-directory $testResultsDirectory --minimum-expected-tests 1 + if ($LASTEXITCODE -ne 0) { $exitCode = 1 - continue - } - - foreach ($testExecutable in $testExecutables) { - $targetFramework = Split-Path -Path $testExecutable.DirectoryName -Leaf - & $testExecutable.FullName --report-xunit-trx --report-xunit-trx-filename "$($testApplication.Name)-$targetFramework.trx" --results-directory $testResultsDirectory --minimum-expected-tests 1 - if ($LASTEXITCODE -ne 0) { - $exitCode = 1 - } } } From 94d87e0d626cf695fa570a08497110e28d616914 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 25 Aug 2026 11:41:42 +0000 Subject: [PATCH 09/17] ci(azure): document xunit mtp marker Co-authored-by: baywet <7905502+baywet@users.noreply.github.com> --- .azure-pipelines/ci-build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.azure-pipelines/ci-build.yml b/.azure-pipelines/ci-build.yml index e09d7d2f6..ecf05bf65 100644 --- a/.azure-pipelines/ci-build.yml +++ b/.azure-pipelines/ci-build.yml @@ -107,6 +107,7 @@ extends: $testExecutables = @(Get-ChildItem -Path "$(Build.SourcesDirectory)\test" -Recurse -Filter "*.Tests.exe" | Where-Object { $_.Directory.Parent.Name -eq "$(BuildConfiguration)" -and $_.BaseName -eq $_.Directory.Parent.Parent.Parent.Name -and + # xUnit v3 MTP test apps copy this runner assembly next to the generated executable. (Test-Path (Join-Path $_.DirectoryName "xunit.v3.mtp-v2.dll")) }) if ($testExecutables.Count -eq 0) { From 399bcfd8abcca9df453947e389176923cab375d5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 25 Aug 2026 11:42:17 +0000 Subject: [PATCH 10/17] ci(azure): relax xunit mtp marker Co-authored-by: baywet <7905502+baywet@users.noreply.github.com> --- .azure-pipelines/ci-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.azure-pipelines/ci-build.yml b/.azure-pipelines/ci-build.yml index ecf05bf65..3e71a7af4 100644 --- a/.azure-pipelines/ci-build.yml +++ b/.azure-pipelines/ci-build.yml @@ -107,8 +107,8 @@ extends: $testExecutables = @(Get-ChildItem -Path "$(Build.SourcesDirectory)\test" -Recurse -Filter "*.Tests.exe" | Where-Object { $_.Directory.Parent.Name -eq "$(BuildConfiguration)" -and $_.BaseName -eq $_.Directory.Parent.Parent.Parent.Name -and - # xUnit v3 MTP test apps copy this runner assembly next to the generated executable. - (Test-Path (Join-Path $_.DirectoryName "xunit.v3.mtp-v2.dll")) + # xUnit v3 MTP test apps copy the runner assembly next to the generated executable. + (Test-Path (Join-Path $_.DirectoryName "xunit.v3.mtp*.dll")) }) if ($testExecutables.Count -eq 0) { Write-Error "No xUnit MTP test executable found" From 6719debb4da8ae235025b8e34d75a17681853c47 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 25 Aug 2026 11:42:59 +0000 Subject: [PATCH 11/17] ci(azure): format mtp test invocation Co-authored-by: baywet <7905502+baywet@users.noreply.github.com> --- .azure-pipelines/ci-build.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.azure-pipelines/ci-build.yml b/.azure-pipelines/ci-build.yml index 3e71a7af4..081d1c5c2 100644 --- a/.azure-pipelines/ci-build.yml +++ b/.azure-pipelines/ci-build.yml @@ -118,7 +118,11 @@ extends: $exitCode = 0 foreach ($testExecutable in $testExecutables | Sort-Object FullName) { $targetFramework = Split-Path -Path $testExecutable.DirectoryName -Leaf - & $testExecutable.FullName --report-xunit-trx --report-xunit-trx-filename "$($testExecutable.BaseName)-$targetFramework.trx" --results-directory $testResultsDirectory --minimum-expected-tests 1 + & $testExecutable.FullName ` + --report-xunit-trx ` + --report-xunit-trx-filename "$($testExecutable.BaseName)-$targetFramework.trx" ` + --results-directory $testResultsDirectory ` + --minimum-expected-tests 1 if ($LASTEXITCODE -ne 0) { $exitCode = 1 } From 3145024718a35cffc54a2084dcafb8877361e3a9 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 25 Aug 2026 11:43:41 +0000 Subject: [PATCH 12/17] ci(azure): preserve mtp runner exit code Co-authored-by: baywet <7905502+baywet@users.noreply.github.com> --- .azure-pipelines/ci-build.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.azure-pipelines/ci-build.yml b/.azure-pipelines/ci-build.yml index 081d1c5c2..568868e23 100644 --- a/.azure-pipelines/ci-build.yml +++ b/.azure-pipelines/ci-build.yml @@ -108,7 +108,7 @@ extends: $_.Directory.Parent.Name -eq "$(BuildConfiguration)" -and $_.BaseName -eq $_.Directory.Parent.Parent.Parent.Name -and # xUnit v3 MTP test apps copy the runner assembly next to the generated executable. - (Test-Path (Join-Path $_.DirectoryName "xunit.v3.mtp*.dll")) + @(Get-ChildItem -Path $_.DirectoryName -Filter "xunit.v3.mtp*.dll").Count -gt 0 }) if ($testExecutables.Count -eq 0) { Write-Error "No xUnit MTP test executable found" @@ -124,7 +124,9 @@ extends: --results-directory $testResultsDirectory ` --minimum-expected-tests 1 if ($LASTEXITCODE -ne 0) { - $exitCode = 1 + if ($exitCode -eq 0) { + $exitCode = $LASTEXITCODE + } } } From fb0217938350911e7580561ff11aa985658ad535 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 25 Aug 2026 11:44:26 +0000 Subject: [PATCH 13/17] ci(azure): log mtp test app failures Co-authored-by: baywet <7905502+baywet@users.noreply.github.com> --- .azure-pipelines/ci-build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.azure-pipelines/ci-build.yml b/.azure-pipelines/ci-build.yml index 568868e23..f538af4a0 100644 --- a/.azure-pipelines/ci-build.yml +++ b/.azure-pipelines/ci-build.yml @@ -124,6 +124,7 @@ extends: --results-directory $testResultsDirectory ` --minimum-expected-tests 1 if ($LASTEXITCODE -ne 0) { + Write-Error "$($testExecutable.Name) failed with exit code $LASTEXITCODE" if ($exitCode -eq 0) { $exitCode = $LASTEXITCODE } From f57d73c12401269b99320d714a521ce57772111f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 25 Aug 2026 11:45:12 +0000 Subject: [PATCH 14/17] ci(azure): document mtp output path assumption Co-authored-by: baywet <7905502+baywet@users.noreply.github.com> --- .azure-pipelines/ci-build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.azure-pipelines/ci-build.yml b/.azure-pipelines/ci-build.yml index f538af4a0..3cd005e34 100644 --- a/.azure-pipelines/ci-build.yml +++ b/.azure-pipelines/ci-build.yml @@ -105,6 +105,7 @@ extends: New-Item -ItemType Directory -Force -Path $testResultsDirectory | Out-Null $testExecutables = @(Get-ChildItem -Path "$(Build.SourcesDirectory)\test" -Recurse -Filter "*.Tests.exe" | Where-Object { + # Match the app produced by its own project output: test\\bin\\\.exe. $_.Directory.Parent.Name -eq "$(BuildConfiguration)" -and $_.BaseName -eq $_.Directory.Parent.Parent.Parent.Name -and # xUnit v3 MTP test apps copy the runner assembly next to the generated executable. From e15916ba1e020b19c40f2955b12358854e4a07c6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 25 Aug 2026 11:45:57 +0000 Subject: [PATCH 15/17] ci(azure): log mtp test candidates Co-authored-by: baywet <7905502+baywet@users.noreply.github.com> --- .azure-pipelines/ci-build.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.azure-pipelines/ci-build.yml b/.azure-pipelines/ci-build.yml index 3cd005e34..564f94399 100644 --- a/.azure-pipelines/ci-build.yml +++ b/.azure-pipelines/ci-build.yml @@ -104,7 +104,11 @@ extends: $testResultsDirectory = "$(Agent.TempDirectory)\TestResults" New-Item -ItemType Directory -Force -Path $testResultsDirectory | Out-Null - $testExecutables = @(Get-ChildItem -Path "$(Build.SourcesDirectory)\test" -Recurse -Filter "*.Tests.exe" | Where-Object { + $testExecutableCandidates = @(Get-ChildItem -Path "$(Build.SourcesDirectory)\test" -Recurse -Filter "*.Tests.exe") + Write-Host "Discovered $($testExecutableCandidates.Count) test executable candidate(s):" + $testExecutableCandidates | ForEach-Object { Write-Host " $($_.FullName)" } + + $testExecutables = @($testExecutableCandidates | Where-Object { # Match the app produced by its own project output: test\\bin\\\.exe. $_.Directory.Parent.Name -eq "$(BuildConfiguration)" -and $_.BaseName -eq $_.Directory.Parent.Parent.Parent.Name -and From dfcc2dc93d8fb5b6194c2c80a93872ba732d49d7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 25 Aug 2026 11:46:42 +0000 Subject: [PATCH 16/17] ci(azure): validate mtp output layout Co-authored-by: baywet <7905502+baywet@users.noreply.github.com> --- .azure-pipelines/ci-build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.azure-pipelines/ci-build.yml b/.azure-pipelines/ci-build.yml index 564f94399..5f986c85d 100644 --- a/.azure-pipelines/ci-build.yml +++ b/.azure-pipelines/ci-build.yml @@ -111,6 +111,7 @@ extends: $testExecutables = @($testExecutableCandidates | Where-Object { # Match the app produced by its own project output: test\\bin\\\.exe. $_.Directory.Parent.Name -eq "$(BuildConfiguration)" -and + $_.Directory.Parent.Parent.Name -eq "bin" -and $_.BaseName -eq $_.Directory.Parent.Parent.Parent.Name -and # xUnit v3 MTP test apps copy the runner assembly next to the generated executable. @(Get-ChildItem -Path $_.DirectoryName -Filter "xunit.v3.mtp*.dll").Count -gt 0 From 530e63b76dac11abe966638e33defcdefd9fb05f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 25 Aug 2026 12:42:20 +0000 Subject: [PATCH 17/17] ci(azure): simplify mtp test execution Co-authored-by: baywet <7905502+baywet@users.noreply.github.com> --- .azure-pipelines/ci-build.yml | 44 ++++++----------------------------- 1 file changed, 7 insertions(+), 37 deletions(-) diff --git a/.azure-pipelines/ci-build.yml b/.azure-pipelines/ci-build.yml index 5f986c85d..27bd0ec58 100644 --- a/.azure-pipelines/ci-build.yml +++ b/.azure-pipelines/ci-build.yml @@ -101,43 +101,13 @@ extends: # Run the Unit test - pwsh: | - $testResultsDirectory = "$(Agent.TempDirectory)\TestResults" - New-Item -ItemType Directory -Force -Path $testResultsDirectory | Out-Null - - $testExecutableCandidates = @(Get-ChildItem -Path "$(Build.SourcesDirectory)\test" -Recurse -Filter "*.Tests.exe") - Write-Host "Discovered $($testExecutableCandidates.Count) test executable candidate(s):" - $testExecutableCandidates | ForEach-Object { Write-Host " $($_.FullName)" } - - $testExecutables = @($testExecutableCandidates | Where-Object { - # Match the app produced by its own project output: test\\bin\\\.exe. - $_.Directory.Parent.Name -eq "$(BuildConfiguration)" -and - $_.Directory.Parent.Parent.Name -eq "bin" -and - $_.BaseName -eq $_.Directory.Parent.Parent.Parent.Name -and - # xUnit v3 MTP test apps copy the runner assembly next to the generated executable. - @(Get-ChildItem -Path $_.DirectoryName -Filter "xunit.v3.mtp*.dll").Count -gt 0 - }) - if ($testExecutables.Count -eq 0) { - Write-Error "No xUnit MTP test executable found" - exit 1 - } - - $exitCode = 0 - foreach ($testExecutable in $testExecutables | Sort-Object FullName) { - $targetFramework = Split-Path -Path $testExecutable.DirectoryName -Leaf - & $testExecutable.FullName ` - --report-xunit-trx ` - --report-xunit-trx-filename "$($testExecutable.BaseName)-$targetFramework.trx" ` - --results-directory $testResultsDirectory ` - --minimum-expected-tests 1 - if ($LASTEXITCODE -ne 0) { - Write-Error "$($testExecutable.Name) failed with exit code $LASTEXITCODE" - if ($exitCode -eq 0) { - $exitCode = $LASTEXITCODE - } - } - } - - exit $exitCode + dotnet test "$(Build.SourcesDirectory)\Microsoft.OpenApi.slnx" ` + --configuration $(BuildConfiguration) ` + --no-build ` + -- ` + --report-xunit-trx ` + --results-directory "$(Agent.TempDirectory)\TestResults" ` + --minimum-expected-tests 1 displayName: 'test' - task: PublishTestResults@2