From 118c3da651e3b37e566a242e3a94d0d77261e3b1 Mon Sep 17 00:00:00 2001 From: nietras Date: Sun, 16 Aug 2026 14:33:19 +0200 Subject: [PATCH 1/7] Migrate from VSTest to MTP for test run --- .github/workflows/dotnet.yml | 13 +++++++--- global.json | 3 +++ src/Sep.Test/Sep.Test.csproj | 13 +++------- src/Sep.XyzTest/Sep.XyzTest.csproj | 10 +++----- test-parsers.ps1 | 27 +++++++++++++++----- test-x64-x86.ps1 | 40 +++++++++++++++++++++++++++--- 6 files changed, 77 insertions(+), 29 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 0bc76ea6..65ec8c94 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -63,15 +63,17 @@ jobs: - name: Build run: dotnet build -c ${{ matrix.configuration }} --no-restore - name: Test - run: dotnet test -c ${{ matrix.configuration }} --no-build --no-restore --verbosity normal --collect:"XPlat Code Coverage" -p:TestTfmsInParallel=true -- /Parallel + run: dotnet test -c ${{ matrix.configuration }} --no-build --no-restore --verbosity normal --coverage --coverage-output-format cobertura --report-gh -p:TestTfmsInParallel=true - name: Upload coverage reports to Codecov uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0 with: + files: ./TestResults/*.cobertura.xml flags: ${{ matrix.os }} token: ${{ secrets.CODECOV_TOKEN }} - name: Upload coverage reports to Codecov uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0 with: + files: ./TestResults/*.cobertura.xml flags: ${{ matrix.configuration }} token: ${{ secrets.CODECOV_TOKEN }} @@ -120,12 +122,13 @@ jobs: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Setup .NET (8.0.x, 9.0.x, global.json) + - name: Setup .NET (8.0.x, 9.0.x, 10.0.x, global.json) uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0 with: dotnet-version: | 8.0.x 9.0.x + 10.0.x global-json-file: global.json - name: Restore dependencies @@ -149,10 +152,12 @@ jobs: if: ${{ github.event.inputs.version != '' && github.actor == 'nietras' }} run: | git tag v${{ github.event.inputs.version }} - - name: Setup .NET (8.0.x, global.json) + - name: Setup .NET (8.0.x, 10.0.x, global.json) uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0 with: - dotnet-version: 8.0.x + dotnet-version: | + 8.0.x + 10.0.x global-json-file: global.json # No need to define min ver version globally now since only uploading release # when version and tag is defined. diff --git a/global.json b/global.json index 3dbe0962..8e244bb3 100644 --- a/global.json +++ b/global.json @@ -3,5 +3,8 @@ "version": "10.0.400", "rollForward": "latestPatch", "allowPrerelease": false + }, + "test": { + "runner": "Microsoft.Testing.Platform" } } diff --git a/src/Sep.Test/Sep.Test.csproj b/src/Sep.Test/Sep.Test.csproj index 0d0e1dd6..baac95c3 100644 --- a/src/Sep.Test/Sep.Test.csproj +++ b/src/Sep.Test/Sep.Test.csproj @@ -1,10 +1,13 @@ - + nietras.SeparatedValues.Test true false $(NoWarn);CA2007 + + Exe + true @@ -15,12 +18,4 @@ - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - diff --git a/src/Sep.XyzTest/Sep.XyzTest.csproj b/src/Sep.XyzTest/Sep.XyzTest.csproj index 107719d9..00c8a1ca 100644 --- a/src/Sep.XyzTest/Sep.XyzTest.csproj +++ b/src/Sep.XyzTest/Sep.XyzTest.csproj @@ -1,10 +1,13 @@ - + nietras.SeparatedValues.XyzTest true false $(NoWarn);CA2007 + + Exe + true @@ -16,12 +19,7 @@ - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - diff --git a/test-parsers.ps1 b/test-parsers.ps1 index d02636d6..96f9c83a 100644 --- a/test-parsers.ps1 +++ b/test-parsers.ps1 @@ -1,7 +1,16 @@ #!/usr/bin/env pwsh -Try { +$ErrorActionPreference = "Stop" +$PSNativeCommandUseErrorActionPreference = $true + +try { dotnet build .\src\Sep.Test\Sep.Test.csproj --nologo -c Debug --no-restore + if ($LASTEXITCODE -ne 0) { + throw "Debug build failed with exit code $LASTEXITCODE." + } dotnet build .\src\Sep.Test\Sep.Test.csproj --nologo -c Release --no-restore + if ($LASTEXITCODE -ne 0) { + throw "Release build failed with exit code $LASTEXITCODE." + } $parsers = @( "SepParserAdvSimdLoad4xNrwCmpOrBulkMoveMaskTzcnt", @@ -19,12 +28,18 @@ Try { ) foreach ($parser in $parsers) { - $env:SEPFORCEPARSER=$parser + $env:SEPFORCEPARSER = $parser Write-Output "Testing $parser Debug" - dotnet test .\src\Sep.Test\Sep.Test.csproj --nologo -c Debug --no-build --no-restore -p:TestTfmsInParallel=true -- /Parallel + dotnet test --project .\src\Sep.Test\Sep.Test.csproj --nologo -c Debug --no-build --no-restore --report-gh + if ($LASTEXITCODE -ne 0) { + throw "Debug parser test failed for $parser with exit code $LASTEXITCODE." + } Write-Output "Testing $parser Release" - dotnet test .\src\Sep.Test\Sep.Test.csproj --nologo -c Release --no-build --no-restore -p:TestTfmsInParallel=true -- /Parallel + dotnet test --project .\src\Sep.Test\Sep.Test.csproj --nologo -c Release --no-build --no-restore --report-gh + if ($LASTEXITCODE -ne 0) { + throw "Release parser test failed for $parser with exit code $LASTEXITCODE." + } } -} Finally { - Remove-Item env:SEPFORCEPARSER +} finally { + Remove-Item env:SEPFORCEPARSER -ErrorAction SilentlyContinue } diff --git a/test-x64-x86.ps1 b/test-x64-x86.ps1 index 1588c4f9..5f07d8db 100644 --- a/test-x64-x86.ps1 +++ b/test-x64-x86.ps1 @@ -1,9 +1,41 @@ #!/usr/bin/env pwsh +$ErrorActionPreference = "Stop" +$PSNativeCommandUseErrorActionPreference = $true + +$testProjects = @( + ".\src\Sep.Test\Sep.Test.csproj" + ".\src\Sep.XyzTest\Sep.XyzTest.csproj" +) + +function Test-Projects { + param( + [string]$Configuration, + [string]$Architecture, + [switch]$Coverage + ) + + foreach ($project in $testProjects) { + $arguments = @( + "--project", $project, + "--nologo", + "-c", $Configuration, + "--arch", $Architecture + ) + if ($Coverage) { + $arguments += "--coverage", "--coverage-output-format", "cobertura" + } + dotnet test @arguments + if ($LASTEXITCODE -ne 0) { + throw "dotnet test failed for $project ($Configuration, $Architecture) with exit code $LASTEXITCODE." + } + } +} + Write-Output "Testing Debug X86" -dotnet test --nologo -c Debug -- RunConfiguration.TargetPlatform=x86 /Parallel +Test-Projects Debug x86 Write-Output "Testing Release X86" -dotnet test --nologo -c Release -- RunConfiguration.TargetPlatform=x86 /Parallel +Test-Projects Release x86 Write-Output "Testing Debug X64" -dotnet test --nologo -c Debug -- RunConfiguration.TargetPlatform=x64 /Parallel +Test-Projects Debug x64 Write-Output "Testing Release X64" -dotnet test --nologo -c Release --collect:"XPlat Code Coverage" -- RunConfiguration.TargetPlatform=x64 /Parallel +Test-Projects Release x64 -Coverage From 10f5910e853fc72b30088c76533138f695cf0964 Mon Sep 17 00:00:00 2001 From: nietras Date: Sun, 16 Aug 2026 14:34:11 +0200 Subject: [PATCH 2/7] remove 10.0 --- .github/workflows/dotnet.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 65ec8c94..85c6b030 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -122,13 +122,12 @@ jobs: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Setup .NET (8.0.x, 9.0.x, 10.0.x, global.json) + - name: Setup .NET (8.0.x, 9.0.x, global.json) uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0 with: dotnet-version: | 8.0.x 9.0.x - 10.0.x global-json-file: global.json - name: Restore dependencies @@ -152,12 +151,11 @@ jobs: if: ${{ github.event.inputs.version != '' && github.actor == 'nietras' }} run: | git tag v${{ github.event.inputs.version }} - - name: Setup .NET (8.0.x, 10.0.x, global.json) + - name: Setup .NET (8.0.x, global.json) uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0 with: dotnet-version: | 8.0.x - 10.0.x global-json-file: global.json # No need to define min ver version globally now since only uploading release # when version and tag is defined. From 013ea53900b3433edb3eed63372a02a94371bdae Mon Sep 17 00:00:00 2001 From: nietras Date: Sun, 16 Aug 2026 14:58:53 +0200 Subject: [PATCH 3/7] remove report-gh --- .github/workflows/dotnet.yml | 2 +- test-parsers.ps1 | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 426473d1..79f49048 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -63,7 +63,7 @@ jobs: - name: Build run: dotnet build -c ${{ matrix.configuration }} --no-restore - name: Test - run: dotnet test -c ${{ matrix.configuration }} --no-build --no-restore --verbosity normal --coverage --coverage-output-format cobertura --report-gh -p:TestTfmsInParallel=true + run: dotnet test -c ${{ matrix.configuration }} --no-build --no-restore --verbosity normal --coverage --coverage-output-format cobertura -p:TestTfmsInParallel=true - name: Upload coverage reports to Codecov uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0 with: diff --git a/test-parsers.ps1 b/test-parsers.ps1 index 96f9c83a..6c890414 100644 --- a/test-parsers.ps1 +++ b/test-parsers.ps1 @@ -30,12 +30,12 @@ try { foreach ($parser in $parsers) { $env:SEPFORCEPARSER = $parser Write-Output "Testing $parser Debug" - dotnet test --project .\src\Sep.Test\Sep.Test.csproj --nologo -c Debug --no-build --no-restore --report-gh + dotnet test --project .\src\Sep.Test\Sep.Test.csproj --nologo -c Debug --no-build --no-restore if ($LASTEXITCODE -ne 0) { throw "Debug parser test failed for $parser with exit code $LASTEXITCODE." } Write-Output "Testing $parser Release" - dotnet test --project .\src\Sep.Test\Sep.Test.csproj --nologo -c Release --no-build --no-restore --report-gh + dotnet test --project .\src\Sep.Test\Sep.Test.csproj --nologo -c Release --no-build --no-restore if ($LASTEXITCODE -ne 0) { throw "Release parser test failed for $parser with exit code $LASTEXITCODE." } From ba183eda55226c3bf4cc69b3dc57822ceb664df7 Mon Sep 17 00:00:00 2001 From: nietras Date: Sun, 16 Aug 2026 15:22:09 +0200 Subject: [PATCH 4/7] fix script --- test-x64-x86.ps1 | 41 +++++++++++++---------------------------- 1 file changed, 13 insertions(+), 28 deletions(-) diff --git a/test-x64-x86.ps1 b/test-x64-x86.ps1 index 5f07d8db..02ecd865 100644 --- a/test-x64-x86.ps1 +++ b/test-x64-x86.ps1 @@ -6,36 +6,21 @@ $testProjects = @( ".\src\Sep.Test\Sep.Test.csproj" ".\src\Sep.XyzTest\Sep.XyzTest.csproj" ) +$configurations = @( + "Debug" + "Release" +) +$architectures = @( + "x86" + "x64" +) -function Test-Projects { - param( - [string]$Configuration, - [string]$Architecture, - [switch]$Coverage - ) +foreach ($architecture in $architectures) { + foreach ($configuration in $configurations) { + Write-Output "Testing $configuration $($architecture.ToUpperInvariant())" - foreach ($project in $testProjects) { - $arguments = @( - "--project", $project, - "--nologo", - "-c", $Configuration, - "--arch", $Architecture - ) - if ($Coverage) { - $arguments += "--coverage", "--coverage-output-format", "cobertura" - } - dotnet test @arguments - if ($LASTEXITCODE -ne 0) { - throw "dotnet test failed for $project ($Configuration, $Architecture) with exit code $LASTEXITCODE." + foreach ($project in $testProjects) { + dotnet test --project $project --nologo -c $configuration --arch $architecture } } } - -Write-Output "Testing Debug X86" -Test-Projects Debug x86 -Write-Output "Testing Release X86" -Test-Projects Release x86 -Write-Output "Testing Debug X64" -Test-Projects Debug x64 -Write-Output "Testing Release X64" -Test-Projects Release x64 -Coverage From 7f4fd22b1aa59fa10efc0df0c90fea04e691783f Mon Sep 17 00:00:00 2001 From: nietras Date: Sun, 16 Aug 2026 15:38:27 +0200 Subject: [PATCH 5/7] remove nologo --- test-parsers.ps1 | 4 ++-- test-x64-x86.ps1 | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test-parsers.ps1 b/test-parsers.ps1 index 6c890414..2f798780 100644 --- a/test-parsers.ps1 +++ b/test-parsers.ps1 @@ -30,12 +30,12 @@ try { foreach ($parser in $parsers) { $env:SEPFORCEPARSER = $parser Write-Output "Testing $parser Debug" - dotnet test --project .\src\Sep.Test\Sep.Test.csproj --nologo -c Debug --no-build --no-restore + dotnet test --project .\src\Sep.Test\Sep.Test.csproj -c Debug --no-build --no-restore if ($LASTEXITCODE -ne 0) { throw "Debug parser test failed for $parser with exit code $LASTEXITCODE." } Write-Output "Testing $parser Release" - dotnet test --project .\src\Sep.Test\Sep.Test.csproj --nologo -c Release --no-build --no-restore + dotnet test --project .\src\Sep.Test\Sep.Test.csproj -c Release --no-build --no-restore if ($LASTEXITCODE -ne 0) { throw "Release parser test failed for $parser with exit code $LASTEXITCODE." } diff --git a/test-x64-x86.ps1 b/test-x64-x86.ps1 index 02ecd865..1f00a222 100644 --- a/test-x64-x86.ps1 +++ b/test-x64-x86.ps1 @@ -20,7 +20,7 @@ foreach ($architecture in $architectures) { Write-Output "Testing $configuration $($architecture.ToUpperInvariant())" foreach ($project in $testProjects) { - dotnet test --project $project --nologo -c $configuration --arch $architecture + dotnet test --project $project -c $configuration --arch $architecture } } } From beda47563e2c1f6631598076b3c477df581ae304 Mon Sep 17 00:00:00 2001 From: nietras Date: Sun, 16 Aug 2026 15:47:20 +0200 Subject: [PATCH 6/7] re-add report-gh in ci --- .github/workflows/dotnet.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 79f49048..426473d1 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -63,7 +63,7 @@ jobs: - name: Build run: dotnet build -c ${{ matrix.configuration }} --no-restore - name: Test - run: dotnet test -c ${{ matrix.configuration }} --no-build --no-restore --verbosity normal --coverage --coverage-output-format cobertura -p:TestTfmsInParallel=true + run: dotnet test -c ${{ matrix.configuration }} --no-build --no-restore --verbosity normal --coverage --coverage-output-format cobertura --report-gh -p:TestTfmsInParallel=true - name: Upload coverage reports to Codecov uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0 with: From 5d1ac89b292fb8c4e5d7ad392f839f5cc423a158 Mon Sep 17 00:00:00 2001 From: nietras Date: Mon, 17 Aug 2026 13:46:24 +0200 Subject: [PATCH 7/7] remove --report-gh --- .github/workflows/dotnet.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 426473d1..b86fdbba 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -63,7 +63,8 @@ jobs: - name: Build run: dotnet build -c ${{ matrix.configuration }} --no-restore - name: Test - run: dotnet test -c ${{ matrix.configuration }} --no-build --no-restore --verbosity normal --coverage --coverage-output-format cobertura --report-gh -p:TestTfmsInParallel=true + # --report-gh is not working + run: dotnet test -c ${{ matrix.configuration }} --no-build --no-restore --verbosity normal --coverage --coverage-output-format cobertura -p:TestTfmsInParallel=true - name: Upload coverage reports to Codecov uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0 with: