From 5ded58b1970014c5e40a1495936d9f0f4c69f24c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 2 Dec 2025 22:28:28 +0000 Subject: [PATCH 01/17] Update actions/checkout action to v6.0.1 (449) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/build.yml | 4 ++-- .github/workflows/copilot-setup-steps.yml | 2 +- .github/workflows/docs.yml | 2 +- .github/workflows/libtemplate-update.yml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 11a8eb3b..b3aa05bc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,7 +28,7 @@ jobs: - windows-2025 steps: - - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: fetch-depth: 0 # avoid shallow clone so nbgv can do its work. - name: โš™ Install prerequisites @@ -75,7 +75,7 @@ jobs: name: ๐Ÿ“ƒ Docs runs-on: ubuntu-latest steps: - - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - name: ๐Ÿ”— Markup Link Checker (mlc) uses: becheran/mlc@18a06b3aa2901ca197de59c8b0b1f54fdba6b3fa # v1.0.0 with: diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml index 6a88e0c5..ebd53881 100644 --- a/.github/workflows/copilot-setup-steps.yml +++ b/.github/workflows/copilot-setup-steps.yml @@ -26,7 +26,7 @@ jobs: # You can define any steps you want, and they will run before the agent starts. # If you do not check out your code, Copilot will do this for you. steps: - - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: fetch-depth: 0 # avoid shallow clone so nbgv can do its work. - name: โš™ Install prerequisites diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index adeffee4..f7ed808d 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -24,7 +24,7 @@ jobs: url: ${{ steps.deployment.outputs.page_url }} runs-on: ubuntu-latest steps: - - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: fetch-depth: 0 # avoid shallow clone so nbgv can do its work. - name: โš™ Install prerequisites diff --git a/.github/workflows/libtemplate-update.yml b/.github/workflows/libtemplate-update.yml index 800279bb..0b111a60 100644 --- a/.github/workflows/libtemplate-update.yml +++ b/.github/workflows/libtemplate-update.yml @@ -17,7 +17,7 @@ jobs: contents: write pull-requests: write steps: - - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: fetch-depth: 0 # avoid shallow clone so nbgv can do its work. From 9a6d7453fe7dcf3370fff0bdb86ba5ee0bc50082 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 2 Dec 2025 22:33:00 +0000 Subject: [PATCH 02/17] Update actions/deploy-pages action to v4.0.5 (450) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index f7ed808d..b1ba5680 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -40,4 +40,4 @@ jobs: - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4 + uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5 From 89853ca1fd7e0c5839eac2071952e1770d23073f Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Tue, 2 Dec 2025 18:21:56 -0700 Subject: [PATCH 03/17] Remove stray backtick from README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b0c1a00c..aa2dfb59 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ Further customize your repo by: ### Maintaining your repo based on this template The best way to keep your repo in sync with this template's evolving features and best practices is to periodically merge the template into your repo: -` + ```ps1 git fetch git checkout origin/main From 40019588499960f7d5bc54e44bfd784f65f601bf Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 2 Dec 2025 19:57:52 -0700 Subject: [PATCH 04/17] Update NuGet/login action to v1.1.0 (451) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ee4159b8..d2495c17 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -76,7 +76,7 @@ jobs: } - name: ๐Ÿชช Authorize NuGet package push - uses: NuGet/login@d22cc5f58ff5b88bf9bd452535b4335137e24544 # v1 + uses: NuGet/login@d22cc5f58ff5b88bf9bd452535b4335137e24544 # v1.1.0 id: nuget-login with: user: ${{ secrets.NUGET_USER }} From abb8f7471146590332cde44bec5d2ce2fae7d3e0 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Fri, 5 Dec 2025 09:54:59 -0700 Subject: [PATCH 05/17] Fix template expansion --- Expand-Template.ps1 | 9 --------- 1 file changed, 9 deletions(-) diff --git a/Expand-Template.ps1 b/Expand-Template.ps1 index cebbcc9d..aee8303f 100755 --- a/Expand-Template.ps1 +++ b/Expand-Template.ps1 @@ -100,8 +100,6 @@ try { if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } git mv test/Library.Tests "test/$LibraryName.Tests" if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } - git mv src/VSInsertionMetadata/Library.VSInsertionMetadata.proj "src/VSInsertionMetadata/$LibraryName.VSInsertionMetadata.proj" - if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } # Update project reference in test project. Add before removal to keep the same ItemGroup in place. dotnet add "test/$LibraryName.Tests" reference "src/$LibraryName" @@ -172,13 +170,6 @@ try { 'LibraryName' = $LibraryName; } - Replace-Placeholders -Path "azure-pipelines/OptProf.yml" -Replacements @{ - 'LibraryName' = $LibraryName; - } - Replace-Placeholders -Path "azure-pipelines/OptProf_part2.yml" -Replacements @{ - 'LibraryName' = $LibraryName; - } - # Self destruct git rm Expand-Template.* Apply-Template.ps1 if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } From fddc013fc29090578d198f457537568994647d46 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Sun, 7 Dec 2025 14:14:43 -0700 Subject: [PATCH 06/17] Opt into Microsoft Testing Platform (MTP) (#452) --- Directory.Packages.props | 5 +++ azure-pipelines/Merge-CodeCoverage.ps1 | 1 + global.json | 3 ++ test/Directory.Build.props | 1 + test/Directory.Build.targets | 6 +++ tools/artifacts/coverageResults.ps1 | 27 ++++++------- tools/artifacts/testResults.ps1 | 3 +- tools/dotnet-test-cloud.ps1 | 53 +++++++++++++++++++------- 8 files changed, 72 insertions(+), 27 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index d4cbbbb1..56cc7c29 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -4,12 +4,17 @@ true true + 1.9.1 + + + + diff --git a/azure-pipelines/Merge-CodeCoverage.ps1 b/azure-pipelines/Merge-CodeCoverage.ps1 index 308f5754..169bb175 100644 --- a/azure-pipelines/Merge-CodeCoverage.ps1 +++ b/azure-pipelines/Merge-CodeCoverage.ps1 @@ -28,6 +28,7 @@ try { if ($reports) { $reports |% { $_.FullName } |% { # In addition to replacing {reporoot}, we also normalize on one kind of slash so that the report aggregates data for a file whether data was collected on Windows or not. + Write-Verbose "Processing $_" $xml = [xml](Get-Content -LiteralPath $_) $xml.coverage.packages.package.classes.class |? { $_.filename} |% { $_.filename = $_.filename.Replace('{reporoot}', $RepoRoot).Replace([IO.Path]::AltDirectorySeparatorChar, [IO.Path]::DirectorySeparatorChar) diff --git a/global.json b/global.json index 895d51ba..37a3146a 100644 --- a/global.json +++ b/global.json @@ -3,5 +3,8 @@ "version": "10.0.100", "rollForward": "patch", "allowPrerelease": false + }, + "test": { + "runner": "Microsoft.Testing.Platform" } } diff --git a/test/Directory.Build.props b/test/Directory.Build.props index 6c7aa71d..2b5b542d 100644 --- a/test/Directory.Build.props +++ b/test/Directory.Build.props @@ -5,6 +5,7 @@ false true + true diff --git a/test/Directory.Build.targets b/test/Directory.Build.targets index 9f32cd06..8ec617e9 100644 --- a/test/Directory.Build.targets +++ b/test/Directory.Build.targets @@ -1,5 +1,11 @@ + + + + + + diff --git a/tools/artifacts/coverageResults.ps1 b/tools/artifacts/coverageResults.ps1 index 8c68216e..1aadbb74 100644 --- a/tools/artifacts/coverageResults.ps1 +++ b/tools/artifacts/coverageResults.ps1 @@ -1,25 +1,26 @@ -$RepoRoot = [System.IO.Path]::GetFullPath("$PSScriptRoot\..\..") +$RepoRoot = Resolve-Path "$PSScriptRoot\..\.." -$coverageFiles = @(Get-ChildItem "$RepoRoot/test/*.cobertura.xml" -Recurse | Where {$_.FullName -notlike "*/In/*" -and $_.FullName -notlike "*\In\*" }) +$coverageFilesUnderRoot = @(Get-ChildItem "$RepoRoot/*.cobertura.xml" -Recurse | Where-Object {$_.FullName -notlike "*/In/*" -and $_.FullName -notlike "*\In\*" }) + +# Under MTP, coverage files are written directly to the artifacts output directory, +# so we need to look there too. +$ArtifactStagingFolder = & "$PSScriptRoot/../Get-ArtifactsStagingDirectory.ps1" +$directTestLogs = Join-Path $ArtifactStagingFolder test_logs +$coverageFilesUnderArtifacts = if (Test-Path $directTestLogs) { @(Get-ChildItem "$directTestLogs/*.cobertura.xml" -Recurse) } else { @() } # Prepare code coverage reports for merging on another machine -$repoRoot = $env:SYSTEM_DEFAULTWORKINGDIRECTORY -if (!$repoRoot) { $repoRoot = $env:GITHUB_WORKSPACE } -if ($repoRoot) { - Write-Host "Substituting $repoRoot with `"{reporoot}`"" - $coverageFiles |% { - $content = Get-Content -LiteralPath $_ |% { $_ -Replace [regex]::Escape($repoRoot), "{reporoot}" } - Set-Content -LiteralPath $_ -Value $content -Encoding UTF8 - } -} else { - Write-Warning "coverageResults: Cloud build not detected. Machine-neutral token replacement skipped." +Write-Host "Substituting $repoRoot with `"{reporoot}`"" +@($coverageFilesUnderRoot + $coverageFilesUnderArtifacts) |? { $_ }|% { + $content = Get-Content -LiteralPath $_ |% { $_ -Replace [regex]::Escape($repoRoot), "{reporoot}" } + Set-Content -LiteralPath $_ -Value $content -Encoding UTF8 } if (!((Test-Path $RepoRoot\bin) -and (Test-Path $RepoRoot\obj))) { return } @{ + $directTestLogs = $coverageFilesUnderArtifacts; $RepoRoot = ( - $coverageFiles + + $coverageFilesUnderRoot + (Get-ChildItem "$RepoRoot\obj\*.cs" -Recurse) ); } diff --git a/tools/artifacts/testResults.ps1 b/tools/artifacts/testResults.ps1 index 5310fb52..a841967e 100644 --- a/tools/artifacts/testResults.ps1 +++ b/tools/artifacts/testResults.ps1 @@ -4,7 +4,8 @@ Param( $result = @{} -$testRoot = Resolve-Path "$PSScriptRoot\..\..\test" +$RepoRoot = Resolve-Path "$PSScriptRoot\..\.." +$testRoot = Join-Path $RepoRoot test $result[$testRoot] = (Get-ChildItem "$testRoot\TestResults" -Recurse -Directory | Get-ChildItem -Recurse -File) $artifactStaging = & "$PSScriptRoot/../Get-ArtifactsStagingDirectory.ps1" diff --git a/tools/dotnet-test-cloud.ps1 b/tools/dotnet-test-cloud.ps1 index 02891d97..17fbe6c1 100644 --- a/tools/dotnet-test-cloud.ps1 +++ b/tools/dotnet-test-cloud.ps1 @@ -25,6 +25,7 @@ Param( $RepoRoot = (Resolve-Path "$PSScriptRoot/..").Path $ArtifactStagingFolder = & "$PSScriptRoot/Get-ArtifactsStagingDirectory.ps1" +$OnCI = ($env:CI -or $env:TF_BUILD) $dotnet = 'dotnet' if ($x86) { @@ -45,23 +46,49 @@ if ($x86) { } $testBinLog = Join-Path $ArtifactStagingFolder (Join-Path build_logs test.binlog) -$testDiagLog = Join-Path $ArtifactStagingFolder (Join-Path test_logs diag.log) +$testLogs = Join-Path $ArtifactStagingFolder test_logs -& $dotnet test $RepoRoot ` - --no-build ` - -c $Configuration ` - --filter "TestCategory!=FailsInCloudTest" ` - --collect "Code Coverage;Format=cobertura" ` - --settings "$PSScriptRoot/test.runsettings" ` - --blame-hang-timeout 60s ` - --blame-crash ` - -bl:"$testBinLog" ` - --diag "$testDiagLog;TraceLevel=info" ` - --logger trx ` +$globalJson = Get-Content $PSScriptRoot/../global.json | ConvertFrom-Json +$isMTP = $globalJson.test.runner -eq 'Microsoft.Testing.Platform' +if ($isMTP) { + $extraArgs = @() + if ($OnCI) { $extraArgs += '--no-progress' } + & $dotnet test --solution $RepoRoot ` + --no-build ` + -c $Configuration ` + -bl:"$testBinLog" ` + --filter-not-trait 'TestCategory=FailsInCloudTest' ` + --coverage ` + --coverage-output-format cobertura ` + --coverage-settings "$PSScriptRoot/test.runsettings" ` + --hangdump ` + --hangdump-timeout 60s ` + --crashdump ` + --diagnostic ` + --diagnostic-output-directory $testLogs ` + --diagnostic-verbosity Information ` + --results-directory $testLogs ` + --report-trx ` + @extraArgs +} else { + $testDiagLog = Join-Path $ArtifactStagingFolder (Join-Path test_logs diag.log) + & $dotnet test $RepoRoot ` + --no-build ` + -c $Configuration ` + --filter "TestCategory!=FailsInCloudTest" ` + --collect "Code Coverage;Format=cobertura" ` + --settings "$PSScriptRoot/test.runsettings" ` + --blame-hang-timeout 60s ` + --blame-crash ` + -bl:"$testBinLog" ` + --diag "$testDiagLog;TraceLevel=info" ` + --logger trx ` +} $unknownCounter = 0 Get-ChildItem -Recurse -Path $RepoRoot\test\*.trx |% { - Copy-Item $_ -Destination $ArtifactStagingFolder/test_logs/ + New-Item $testLogs -ItemType Directory -Force | Out-Null + Copy-Item $_ -Destination $testLogs if ($PublishResults) { $x = [xml](Get-Content -LiteralPath $_) From f761f0f7e50514cdb2b0b4b3b07fa3d298ff2eaf Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Sun, 7 Dec 2025 15:09:40 -0700 Subject: [PATCH 07/17] Push to nuget.org before pushing to github release This makes recovering a release from a nuget.org push failure easier. --- .github/workflows/release.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d2495c17..a4e4745a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -64,6 +64,15 @@ jobs: run-id: ${{ steps.findrunid.outputs.runid }} github-token: ${{ github.token }} + - name: ๐Ÿชช Authorize NuGet package push + uses: NuGet/login@d22cc5f58ff5b88bf9bd452535b4335137e24544 # v1.1.0 + id: nuget-login + with: + user: ${{ secrets.NUGET_USER }} + + - name: ๐Ÿš€ Push NuGet packages + run: dotnet nuget push ${{ runner.temp }}/deployables/*.nupkg --source https://api.nuget.org/v3/index.json -k '${{ steps.nuget-login.outputs.NUGET_API_KEY }}' + - name: ๐Ÿ’ฝ Upload artifacts to release shell: pwsh if: ${{ github.event_name == 'release' && github.event.release.assets_url != '' }} @@ -74,12 +83,3 @@ jobs: Write-Host "Uploading $($_.Name) to release..." gh release -R ${{ github.repository }} upload "${{ github.ref_name }}" $_.FullName } - - - name: ๐Ÿชช Authorize NuGet package push - uses: NuGet/login@d22cc5f58ff5b88bf9bd452535b4335137e24544 # v1.1.0 - id: nuget-login - with: - user: ${{ secrets.NUGET_USER }} - - - name: ๐Ÿš€ Push NuGet packages - run: dotnet nuget push ${{ runner.temp }}/deployables/*.nupkg --source https://api.nuget.org/v3/index.json -k '${{ steps.nuget-login.outputs.NUGET_API_KEY }}' From e4035601946447f2cb317003ebb600cf7df2742d Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Sun, 7 Dec 2025 15:59:57 -0700 Subject: [PATCH 08/17] Update to MTP v2 (#455) --- Directory.Packages.props | 6 +++--- test/Library.Tests/Library.Tests.csproj | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 56cc7c29..80d105cf 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -4,19 +4,19 @@ true true - 1.9.1 + 2.0.2 - + - + diff --git a/test/Library.Tests/Library.Tests.csproj b/test/Library.Tests/Library.Tests.csproj index 5cbc1e1f..14633572 100644 --- a/test/Library.Tests/Library.Tests.csproj +++ b/test/Library.Tests/Library.Tests.csproj @@ -14,7 +14,7 @@ - + From a28d54057fd4e9d86d4130b3977354bdf1754fbb Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Sun, 7 Dec 2025 16:11:51 -0700 Subject: [PATCH 09/17] Update all MTP related packages at once (457) --- .github/renovate.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/renovate.json b/.github/renovate.json index c97d9779..79dba1e5 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -11,6 +11,10 @@ "matchPackageNames": ["xunit*"], "groupName": "xunit" }, + { + "matchPackageNames": ["Microsoft.Testing.Extensions.*"], + "groupName": "Microsoft Testing Platform" + }, { "matchDatasources": ["dotnet-version", "docker"], "matchDepNames": ["dotnet-sdk", "mcr.microsoft.com/dotnet/sdk"], From f355f008b2b164d1e1fa8ca120442b0bffcf06af Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Sun, 7 Dec 2025 16:15:02 -0700 Subject: [PATCH 10/17] Fix test result publishing to AzDO (458) --- tools/dotnet-test-cloud.ps1 | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tools/dotnet-test-cloud.ps1 b/tools/dotnet-test-cloud.ps1 index 17fbe6c1..9b48178c 100644 --- a/tools/dotnet-test-cloud.ps1 +++ b/tools/dotnet-test-cloud.ps1 @@ -70,6 +70,8 @@ if ($isMTP) { --results-directory $testLogs ` --report-trx ` @extraArgs + + $trxFiles = Get-ChildItem -Recurse -Path $testLogs\*.trx } else { $testDiagLog = Join-Path $ArtifactStagingFolder (Join-Path test_logs diag.log) & $dotnet test $RepoRoot ` @@ -82,13 +84,17 @@ if ($isMTP) { --blame-crash ` -bl:"$testBinLog" ` --diag "$testDiagLog;TraceLevel=info" ` - --logger trx ` + --logger trx + + $trxFiles = Get-ChildItem -Recurse -Path $RepoRoot\test\*.trx } $unknownCounter = 0 -Get-ChildItem -Recurse -Path $RepoRoot\test\*.trx |% { +$trxFiles |% { New-Item $testLogs -ItemType Directory -Force | Out-Null - Copy-Item $_ -Destination $testLogs + if (!($_.FullName.StartsWith($testLogs))) { + Copy-Item $_ -Destination $testLogs + } if ($PublishResults) { $x = [xml](Get-Content -LiteralPath $_) From 3304d7930d87ac76dc060f80d5a89a233696e40c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 10 Dec 2025 13:50:17 +0000 Subject: [PATCH 11/17] Update .NET SDK to v10.0.101 (#459) * Update mcr.microsoft.com/dotnet/sdk Docker tag to v10.0.101 * Bump .NET SDK --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Andrew Arnott --- .devcontainer/Dockerfile | 2 +- global.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 6637ad8a..64f23a9e 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,5 +1,5 @@ # Refer to https://hub.docker.com/_/microsoft-dotnet-sdk for available versions -FROM mcr.microsoft.com/dotnet/sdk:10.0.100@sha256:c7445f141c04f1a6b454181bd098dcfa606c61ba0bd213d0a702489e5bd4cd71 +FROM mcr.microsoft.com/dotnet/sdk:10.0.101@sha256:d1823fecac3689a2eb959e02ee3bfe1c2142392808240039097ad70644566190 # Installing mono makes `dotnet test` work without errors even for net472. # But installing it takes a long time, so it's excluded by default. diff --git a/global.json b/global.json index 37a3146a..a0ec2d8d 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "10.0.100", + "version": "10.0.101", "rollForward": "patch", "allowPrerelease": false }, From 63de08696a81f2a8350910cd9c162e021f95a604 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Wed, 10 Dec 2025 08:48:27 -0700 Subject: [PATCH 12/17] Drop package dependencies that MTP does not require --- Directory.Packages.props | 2 -- test/Library.Tests/Library.Tests.csproj | 2 -- 2 files changed, 4 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 80d105cf..098c7f09 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -10,12 +10,10 @@ - - diff --git a/test/Library.Tests/Library.Tests.csproj b/test/Library.Tests/Library.Tests.csproj index 14633572..e9e12e43 100644 --- a/test/Library.Tests/Library.Tests.csproj +++ b/test/Library.Tests/Library.Tests.csproj @@ -12,8 +12,6 @@ - - From 70980c340965220736976b61c0880a1f914a3171 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Wed, 10 Dec 2025 14:22:58 -0700 Subject: [PATCH 13/17] Fix MTP test failure for MTP-incompatible projects under the test folder --- test/Directory.Build.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Directory.Build.targets b/test/Directory.Build.targets index 8ec617e9..839afb5d 100644 --- a/test/Directory.Build.targets +++ b/test/Directory.Build.targets @@ -1,6 +1,6 @@ - + From 307d5e37fbf1fff5b2ce96d7154145d4aa80e676 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Thu, 11 Dec 2025 07:16:35 -0700 Subject: [PATCH 14/17] Fix testing regression from last commit --- test/Directory.Build.props | 1 + 1 file changed, 1 insertion(+) diff --git a/test/Directory.Build.props b/test/Directory.Build.props index 2b5b542d..d7f919fb 100644 --- a/test/Directory.Build.props +++ b/test/Directory.Build.props @@ -3,6 +3,7 @@ + true false true true From 5c9d6251b1074d83db4d18416828b2ccdba07eb9 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Thu, 11 Dec 2025 07:32:43 -0700 Subject: [PATCH 15/17] Adjust how we use IsTestProject This matches how MTP uses it internally. --- test/Directory.Build.props | 1 - test/Directory.Build.targets | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/test/Directory.Build.props b/test/Directory.Build.props index d7f919fb..2b5b542d 100644 --- a/test/Directory.Build.props +++ b/test/Directory.Build.props @@ -3,7 +3,6 @@ - true false true true diff --git a/test/Directory.Build.targets b/test/Directory.Build.targets index 839afb5d..3758bb8c 100644 --- a/test/Directory.Build.targets +++ b/test/Directory.Build.targets @@ -1,6 +1,6 @@ - + From 3c7bc6fe7a5c5116bb5be1277770060cbde64e79 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Thu, 11 Dec 2025 08:19:44 -0700 Subject: [PATCH 16/17] Fix IsTestProject detection --- Directory.Packages.props | 5 ----- test/Directory.Packages.props | 10 ++++++++++ .../StreamJsonRpc.Analyzer.Tests.csproj | 1 - 3 files changed, 10 insertions(+), 6 deletions(-) create mode 100644 test/Directory.Packages.props diff --git a/Directory.Packages.props b/Directory.Packages.props index f4fd2786..3dcb3eb7 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -49,11 +49,6 @@ - - - - - diff --git a/test/Directory.Packages.props b/test/Directory.Packages.props new file mode 100644 index 00000000..069d7839 --- /dev/null +++ b/test/Directory.Packages.props @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/test/StreamJsonRpc.Analyzer.Tests/StreamJsonRpc.Analyzer.Tests.csproj b/test/StreamJsonRpc.Analyzer.Tests/StreamJsonRpc.Analyzer.Tests.csproj index e69de548..97d614d9 100644 --- a/test/StreamJsonRpc.Analyzer.Tests/StreamJsonRpc.Analyzer.Tests.csproj +++ b/test/StreamJsonRpc.Analyzer.Tests/StreamJsonRpc.Analyzer.Tests.csproj @@ -4,7 +4,6 @@ net8.0 $(TargetFrameworks);net472 Exe - true From aed3cb0220aa983dc07f121156ce3d77e8fc724d Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Thu, 11 Dec 2025 10:37:18 -0700 Subject: [PATCH 17/17] Fix EventSource test runs --- azure-pipelines/dotnet.yml | 16 ++++------------ tools/dotnet-test-cloud.ps1 | 26 ++++++++++++++++++++------ 2 files changed, 24 insertions(+), 18 deletions(-) diff --git a/azure-pipelines/dotnet.yml b/azure-pipelines/dotnet.yml index aa02c904..385aa746 100644 --- a/azure-pipelines/dotnet.yml +++ b/azure-pipelines/dotnet.yml @@ -20,25 +20,17 @@ steps: displayName: ๐Ÿงช dotnet test condition: and(succeeded(), ${{ parameters.RunTests }}) -- task: DotNetCoreCLI@2 +- powershell: tools/dotnet-test-cloud.ps1 -Configuration $(BuildConfiguration) -Agent $(Agent.JobName) -PublishResults -netfxOnly -logIsolationName EventSource-throw displayName: ๐Ÿงช dotnet test -f net472 (+EventSource throw) - inputs: - command: test - arguments: --no-build -c $(BuildConfiguration) -f net472 --filter "TestCategory!=FailsInCloudTest$(FailsOnMonoFilter)" -v n /p:CollectCoverage=true /bl:"$(Build.ArtifactStagingDirectory)/build_logs/test_net472_etw.binlog" --diag "$(Build.ArtifactStagingDirectory)/test_logs/net472_etw.txt" - testRunTitle: streamjsonrpc.tests-etw (net472, $(Agent.JobName)) env: StreamJsonRpc_TestWithEventSource: 1 # allow exceptions from EventSource to propagate - condition: and(succeeded(), ne(variables['OptProf'], 'true'), eq(variables['Agent.OS'], 'Windows_NT')) + condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT')) -- task: DotNetCoreCLI@2 +- powershell: tools/dotnet-test-cloud.ps1 -Configuration $(BuildConfiguration) -Agent $(Agent.JobName) -PublishResults -netfxOnly -logIsolationName EventSource-production displayName: ๐Ÿงช dotnet test -f net472 (+EventSource production) - inputs: - command: test - arguments: --no-build -c $(BuildConfiguration) -f net472 --filter "TestCategory!=FailsInCloudTest$(FailsOnMonoFilter)" -v n /p:CollectCoverage=true /bl:"$(Build.ArtifactStagingDirectory)/build_logs/test_net472_etw.binlog" --diag "$(Build.ArtifactStagingDirectory)/test_logs/net472_etw.txt" - testRunTitle: streamjsonrpc.tests-etw (net472, $(Agent.JobName)) env: StreamJsonRpc_TestWithEventSource: 2 # swallow exceptions from EventSource, as is done in production - condition: and(succeeded(), ne(variables['OptProf'], 'true'), eq(variables['Agent.OS'], 'Windows_NT')) + condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT')) - powershell: tools/variables/_define.ps1 failOnStderr: true diff --git a/tools/dotnet-test-cloud.ps1 b/tools/dotnet-test-cloud.ps1 index 9b48178c..df326574 100644 --- a/tools/dotnet-test-cloud.ps1 +++ b/tools/dotnet-test-cloud.ps1 @@ -20,7 +20,9 @@ Param( [string]$Agent='Local', [switch]$PublishResults, [switch]$x86, - [string]$dotnet32 + [string]$dotnet32, + [switch]$netfxOnly, + [string]$logIsolationName ) $RepoRoot = (Resolve-Path "$PSScriptRoot/..").Path @@ -45,13 +47,23 @@ if ($x86) { } } -$testBinLog = Join-Path $ArtifactStagingFolder (Join-Path build_logs test.binlog) +$binlogName = if ($logIsolationName) { "test_$logIsolationName.binlog" } else { "test.binlog" } +$testBinLog = Join-Path $ArtifactStagingFolder (Join-Path build_logs $binlogName) + $testLogs = Join-Path $ArtifactStagingFolder test_logs +if ($logIsolationName) { + $testLogs = Join-Path $testLogs $logIsolationName +} $globalJson = Get-Content $PSScriptRoot/../global.json | ConvertFrom-Json $isMTP = $globalJson.test.runner -eq 'Microsoft.Testing.Platform' +$extraArgs = @() + +if ($netfxOnly) { + $extraArgs += '--framework','net472' +} + if ($isMTP) { - $extraArgs = @() if ($OnCI) { $extraArgs += '--no-progress' } & $dotnet test --solution $RepoRoot ` --no-build ` @@ -84,7 +96,8 @@ if ($isMTP) { --blame-crash ` -bl:"$testBinLog" ` --diag "$testDiagLog;TraceLevel=info" ` - --logger trx + --logger trx ` + @extraArgs $trxFiles = Get-ChildItem -Recurse -Path $RepoRoot\test\*.trx } @@ -97,6 +110,7 @@ $trxFiles |% { } if ($PublishResults) { + $runTitleIsolationSuffix = if ($logIsolationName) { ", $logIsolationName" } else { "" } $x = [xml](Get-Content -LiteralPath $_) $runTitle = $null if ($x.TestRun.TestDefinitions -and $x.TestRun.TestDefinitions.GetElementsByTagName('UnitTest')) { @@ -105,13 +119,13 @@ $trxFiles |% { if ($matches.rid) { $runTitle = "$($matches.lib) ($($matches.tfm), $($matches.rid), $Agent)" } else { - $runTitle = "$($matches.lib) ($($matches.tfm)$x86RunTitleSuffix, $Agent)" + $runTitle = "$($matches.lib) ($($matches.tfm)$x86RunTitleSuffix$runTitleIsolationSuffix, $Agent)" } } } if (!$runTitle) { $unknownCounter += 1; - $runTitle = "unknown$unknownCounter ($Agent$x86RunTitleSuffix)"; + $runTitle = "unknown$unknownCounter ($Agent$x86RunTitleSuffix$runTitleIsolationSuffix)"; } Write-Host "##vso[results.publish type=VSTest;runTitle=$runTitle;publishRunAttachments=true;resultFiles=$_;failTaskOnFailedTests=true;testRunSystem=VSTS - PTR;]"