From 97533591b5673c3aa86c2571eecc0671df172c14 Mon Sep 17 00:00:00 2001 From: Simon Cropp Date: Sun, 11 Oct 2026 22:29:39 +1100 Subject: [PATCH 1/2] Keep the ReportTrx helper out of dotnet test A solution wide dotnet test ran EfLocalDb.ReportTrxHelper as a test project, found zero tests, and failed the whole run with exit code 8 even when every test passed. The helper already sets IsTestProject=false, but under Microsoft.Testing.Platform dotnet test goes by IsTestingPlatformApplication, which NUnit3TestAdapter's targets assign from EnableNUnitRunner unconditionally. Set it to false in a Directory.Build.targets beside the project, which is imported after package targets and so is not overwritten. The entry point and extension registration default to that property, so they are now turned on explicitly and the helper stays the same testing platform executable. --- .../Directory.Build.targets | 18 ++++++++++++++++++ .../EfLocalDb.ReportTrxHelper.csproj | 8 ++++++++ 2 files changed, 26 insertions(+) create mode 100644 src/EfLocalDb.ReportTrxHelper/Directory.Build.targets diff --git a/src/EfLocalDb.ReportTrxHelper/Directory.Build.targets b/src/EfLocalDb.ReportTrxHelper/Directory.Build.targets new file mode 100644 index 00000000..b5a2cc26 --- /dev/null +++ b/src/EfLocalDb.ReportTrxHelper/Directory.Build.targets @@ -0,0 +1,18 @@ + + + + false + + diff --git a/src/EfLocalDb.ReportTrxHelper/EfLocalDb.ReportTrxHelper.csproj b/src/EfLocalDb.ReportTrxHelper/EfLocalDb.ReportTrxHelper.csproj index f857af6e..b6a007d3 100644 --- a/src/EfLocalDb.ReportTrxHelper/EfLocalDb.ReportTrxHelper.csproj +++ b/src/EfLocalDb.ReportTrxHelper/EfLocalDb.ReportTrxHelper.csproj @@ -5,6 +5,14 @@ true false false + + true + true From 4a33f07e61e61aa267d5c4ab34ed97d2c8190194 Mon Sep 17 00:00:00 2001 From: Simon Cropp Date: Sun, 11 Oct 2026 23:09:10 +1100 Subject: [PATCH 2/2] Run the tests solution wide in CI One dotnet test over the solution replaces the loop that ran each project in turn and deleted every LocalDB instance in between. It runs the projects in parallel, picks up new test projects without a list to maintain, and is what a developer runs locally. --- .github/workflows/build.yml | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c27bd931..58920dd4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -53,34 +53,9 @@ jobs: - name: Build run: dotnet build src --configuration Release ${{ env.VERSION_ARGUMENT }} - # One project at a time, deleting the LocalDB instances in between, as each project - # creates its own and they collide when left behind. + # The whole solution in one run, with the test projects in parallel, as a developer runs it. - name: Test - shell: pwsh - run: | - $projects = @( - 'LocalDb.Tests' - 'EfClassicLocalDb.Tests' - 'EfLocalDb.Tests' - 'EfLocalDb.NUnit.Tests' - 'EfLocalDb.MSTest.Tests' - 'EfLocalDb.Xunit.V3.Tests' - 'EfLocalDb.TUnit.Tests' - ) - $failed = @() - foreach ($project in $projects) - { - dotnet test --project "src/$project" --configuration Release --no-build --no-restore - if ($LASTEXITCODE -ne 0) - { - $failed += $project - } - sqllocaldb info | ForEach-Object { sqllocaldb stop $_ ; sqllocaldb delete $_ } - } - if ($failed.Count -gt 0) - { - throw "Failed test projects: $($failed -join ', ')" - } + run: dotnet test --solution src/LocalDb.slnx --configuration Release --no-build --no-restore - name: Upload received on failure if: failure()