Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 2 additions & 27 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
18 changes: 18 additions & 0 deletions src/EfLocalDb.ReportTrxHelper/Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<Project>
<!--
This executable hosts no tests. ReportTrxGuardTests launches it to prove a guard, and nothing
else should run it.

Under Microsoft.Testing.Platform, dotnet test decides what to run from
IsTestingPlatformApplication, not from IsTestProject, so IsTestProject=false in the project
file is not enough: a solution wide dotnet test runs this too, finds zero tests, and fails the
whole run with exit code 8.

It has to be set here rather than in the project file. NUnit3TestAdapter's targets assign it
from EnableNUnitRunner unconditionally, and package targets are imported after the project
file's own properties but before Directory.Build.targets.
-->
<PropertyGroup>
<IsTestingPlatformApplication>false</IsTestingPlatformApplication>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@
<EnableNUnitRunner>true</EnableNUnitRunner>
<IsTestProject>false</IsTestProject>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<!--
Directory.Build.targets turns IsTestingPlatformApplication off so that dotnet test does not
run this. These two default to that property, and are what make this a testing platform
executable that accepts report-trx in the first place: the generated Main, and the
registration of the TRX extension.
-->
<GenerateTestingPlatformEntryPoint>true</GenerateTestingPlatformEntryPoint>
<GenerateSelfRegisteredExtensions>true</GenerateSelfRegisteredExtensions>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Testing.Extensions.TrxReport" />
Expand Down
Loading