diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fb1befa..5e6f7ab 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,7 +29,21 @@ jobs: dotnet-version: 10.0.x - run: dotnet build Stampeded.slnx -c Release - - run: dotnet test Stampeded.slnx -c Release --no-build + - run: dotnet test --solution Stampeded.slnx -c Release --no-build --report-trx --results-directory test-results + + - uses: actions/upload-artifact@v7 + if: success() || failure() + with: + name: test-results-${{ matrix.rid }} + path: test-results/*.trx + if-no-files-found: error + + - name: Create Test Report + uses: test-summary/action@v2 + if: always() + with: + paths: test-results/*.trx + folded: true # Framework-dependent on purpose: the app needs an installed .NET SDK at runtime # anyway (Roslyn's MSBuild workspace, dotnet build/test), so bundling a runtime diff --git a/CLAUDE.md b/CLAUDE.md index 4a9e87a..ec79fea 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -161,7 +161,12 @@ than with a tree at the wrong lines. A parser in this process answers before it Prefix `dotnet` with `OPENSSL_ENABLE_SHA1_SIGNATURES=1` (the local OpenSSL setup needs it): OPENSSL_ENABLE_SHA1_SIGNATURES=1 dotnet build Stampeded.slnx - OPENSSL_ENABLE_SHA1_SIGNATURES=1 dotnet test Stampeded.slnx + OPENSSL_ENABLE_SHA1_SIGNATURES=1 dotnet test --solution Stampeded.slnx --report-trx --results-directory test-results + +`dotnet test` runs through Microsoft.Testing.Platform (`global.json` pins the runner), so the +solution is named with `--solution` - the bare positional form is VSTest syntax and errors. +`--report-trx` leaves a TRX per test assembly under `test-results/`, which is how a failure +survives the run. Tests that exercise git create real repositories in temp directories and shell out to `git` - that is deliberate: the interesting behaviour is git's, and a mock would only assert what we diff --git a/Directory.Packages.props b/Directory.Packages.props index 7320afd..1fd816d 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -27,6 +27,6 @@ - + diff --git a/global.json b/global.json new file mode 100644 index 0000000..3140116 --- /dev/null +++ b/global.json @@ -0,0 +1,5 @@ +{ + "test": { + "runner": "Microsoft.Testing.Platform" + } +} diff --git a/tests/Stampeded.Core.Tests/Stampeded.Core.Tests.csproj b/tests/Stampeded.Core.Tests/Stampeded.Core.Tests.csproj index d87dc07..034de14 100644 --- a/tests/Stampeded.Core.Tests/Stampeded.Core.Tests.csproj +++ b/tests/Stampeded.Core.Tests/Stampeded.Core.Tests.csproj @@ -1,11 +1,13 @@ false + Exe + true - +