Skip to content

Commit 81a245f

Browse files
EvangelinkCopilot
andauthored
deps: update mstest monorepo to v2 and run platform tests in MTP mode (#290)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 12e8c25 commit 81a245f

4 files changed

Lines changed: 28 additions & 6 deletions

File tree

.justfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ clean:
1515
dotnet clean
1616

1717
test-platform: pack
18-
dotnet clean ./test/Sample.Test/Sample.Test.fsproj -v:quiet
19-
dotnet test ./test/Sample.Test/Sample.Test.fsproj -p:EnableExpectoTestingPlatformIntegration=true -p:IncludeFailingTests=false
18+
cd test/mtp && dotnet clean ../Sample.Test/Sample.Test.fsproj -v:quiet
19+
cd test/mtp && dotnet test ../Sample.Test/Sample.Test.fsproj -p:EnableExpectoTestingPlatformIntegration=true -p:IncludeFailingTests=false
2020

2121
test-platform-failing: pack
22-
dotnet clean ./test/Sample.Test/Sample.Test.fsproj -v:quiet
23-
dotnet test ./test/Sample.Test/Sample.Test.fsproj -p:EnableExpectoTestingPlatformIntegration=true -p:IncludeFailingTests=true
22+
cd test/mtp && dotnet clean ../Sample.Test/Sample.Test.fsproj -v:quiet
23+
cd test/mtp && dotnet test ../Sample.Test/Sample.Test.fsproj -p:EnableExpectoTestingPlatformIntegration=true -p:IncludeFailingTests=true
2424

2525
test-legacy: pack
2626
dotnet clean ./test/Sample.Test/Sample.Test.fsproj -v:quiet

Directory.Packages.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
<PackageVersion Include="Expecto" Version="[10.2.2,11.1.0]" />
44
<PackageVersion Include="FSharp.Core" Version="[7.0.200,)" />
55
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.7.0" />
6-
<PackageVersion Include="Microsoft.Testing.Extensions.VSTestBridge" Version="1.9.1" />
7-
<PackageVersion Include="Microsoft.Testing.Platform.MSBuild" Version="1.9.1" />
6+
<PackageVersion Include="Microsoft.Testing.Extensions.VSTestBridge" Version="2.2.3" />
7+
<PackageVersion Include="Microsoft.Testing.Platform.MSBuild" Version="2.2.3" />
88
<PackageVersion Include="Microsoft.TestPlatform.ObjectModel" Version="18.7.0" />
99
</ItemGroup>
1010
</Project>

test/mtp/README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# `test/mtp` runner launcher
2+
3+
This directory exists only to provide a `global.json` that opts into the
4+
**Microsoft.Testing.Platform (MTP) mode** of `dotnet test`
5+
(`"test": { "runner": "Microsoft.Testing.Platform" }`).
6+
7+
Starting with `Microsoft.Testing.Platform` v2 on the .NET 10+ SDK, the legacy
8+
"VSTest mode" path for running MTP test apps via `dotnet test` was removed, so
9+
the platform integration test must run through MTP mode instead.
10+
11+
`dotnet test` resolves the test `runner` from the **current working directory's**
12+
`global.json`, while `YoloDev.Sdk` resolves the repository root (and therefore
13+
`version.txt`) from the **test project's** directory. The `test-platform`
14+
recipes in `.justfile` `cd` into this folder and point at
15+
`../Sample.Test/Sample.Test.fsproj`, so the platform tests run under the MTP
16+
runner while the legacy (VSTest) recipes keep running from the repo root under
17+
the default VSTest runner.

test/mtp/global.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"test": {
3+
"runner": "Microsoft.Testing.Platform"
4+
}
5+
}

0 commit comments

Comments
 (0)