Skip to content

Commit dd0527c

Browse files
authored
Update MSTest.Sdk to handle playwright (#2598)
1 parent ba71e63 commit dd0527c

File tree

6 files changed

+26
-6
lines changed

6 files changed

+26
-6
lines changed

eng/Versions.props

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@
2525
<MicrosoftCodeAnalysisBannedApiAnalyzersVersion>$(MicrosoftCodeAnalysisPublicApiAnalyzersVersion)</MicrosoftCodeAnalysisBannedApiAnalyzersVersion>
2626
<!-- MSBuild Sdk versions updates -->
2727
<MicrosoftDotNetBuildTasksTemplatingPackageVersion>8.0.0-beta.24165.4</MicrosoftDotNetBuildTasksTemplatingPackageVersion>
28-
<!-- Testing platform (this comment is here to avoid conflict on darc PRs) -->
28+
<MicrosoftPlaywrightVersion>1.42.0</MicrosoftPlaywrightVersion>
2929
<MicrosoftTestingFrameworkVersion>1.2.0-preview.24168.3</MicrosoftTestingFrameworkVersion>
3030
<MicrosoftTestingPlatformVersion>1.2.0-preview.24168.3</MicrosoftTestingPlatformVersion>
31-
<MSTestEngineVersion>1.0.0-alpha.24168.3</MSTestEngineVersion>
3231
<MicrosoftVisualStudioThreadingAnalyzersVersion>17.9.28</MicrosoftVisualStudioThreadingAnalyzersVersion>
32+
<MSTestEngineVersion>1.0.0-alpha.24168.3</MSTestEngineVersion>
3333
<StyleCopAnalyzersVersion>1.2.0-beta.556</StyleCopAnalyzersVersion>
3434
</PropertyGroup>
3535
<PropertyGroup Label="MSTest test dependencies">

src/Package/MSTest.Sdk/MSTest.Sdk.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
</ItemGroup>
3636
<Target Name="GenerateTemplates" AfterTargets="PrepareForBuild">
3737
<PropertyGroup>
38-
<_TemplateProperties>MSTestEngineVersion=$(MSTestEngineVersion);MSTestVersion=$(Version);MicrosoftTestingPlatformVersion=$(MicrosoftTestingPlatformVersion);MicrosoftNETTestSdkVersion=$(MicrosoftNETTestSdkVersion);MicrosoftTestingExtensionsCodeCoverageVersion=$(MicrosoftTestingExtensionsCodeCoverageVersion)</_TemplateProperties>
38+
<_TemplateProperties>MSTestEngineVersion=$(MSTestEngineVersion);MSTestVersion=$(Version);MicrosoftTestingPlatformVersion=$(MicrosoftTestingPlatformVersion);MicrosoftNETTestSdkVersion=$(MicrosoftNETTestSdkVersion);MicrosoftTestingExtensionsCodeCoverageVersion=$(MicrosoftTestingExtensionsCodeCoverageVersion);MicrosoftPlaywrightVersion=$(MicrosoftPlaywrightVersion)</_TemplateProperties>
3939
</PropertyGroup>
4040

4141
<!--

src/Package/MSTest.Sdk/Sdk/Runner/ClassicEngine.targets

+6-1
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,18 @@
2727
</PropertyGroup>
2828

2929
<!-- Core -->
30-
<ItemGroup>
30+
<ItemGroup Condition=" '$(EnablePlaywright)' == 'false' ">
3131
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(MicrosoftNETTestSdkVersion)" VersionOverride="$(MicrosoftNETTestSdkVersion)" />
3232
<PackageReference Include="MSTest.TestAdapter" Version="$(MSTestVersion)" VersionOverride="$(MSTestVersion)" />
3333
<PackageReference Include="MSTest.TestFramework" Version="$(MSTestVersion)" VersionOverride="$(MSTestVersion)" />
3434
<PackageReference Include="MSTest.Analyzers" Version="$(MSTestVersion)" VersionOverride="$(MSTestVersion)" Condition=" '$(EnableMSTestAnalyzers)' != 'false' " />
3535
</ItemGroup>
3636

37+
<ItemGroup Condition=" '$(EnablePlaywright)' == 'true' ">
38+
<PackageReference Include="Microsoft.Playwright.MSTest" Version="$(MicrosoftPlaywrightVersion)" VersionOverride="$(MicrosoftPlaywrightVersion)" />
39+
<PackageReference Include="MSTest.Analyzers" Version="$(MSTestVersion)" VersionOverride="$(MSTestVersion)" Condition=" '$(EnableMSTestAnalyzers)' != 'false' " />
40+
</ItemGroup>
41+
3742
<!-- Extensions -->
3843
<ItemGroup>
3944
<PackageReference Include="Microsoft.Testing.Extensions.TrxReport" Version="$(MicrosoftTestingExtensionsTrxReportVersion)" VersionOverride="$(MicrosoftTestingExtensionsTrxReportVersion)" Condition=" '$(EnableMicrosoftTestingExtensionsTrxReport)' == 'true' " />

src/Package/MSTest.Sdk/Sdk/Runner/NativeAOT.targets

+5
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33

44
<Import Project="$(MSBuildThisFileDirectory)Common.targets"/>
55

6+
<Target Name="_MSTestSDKValidatePlaywright" BeforeTargets="Build">
7+
<Error Condition=" '$(EnablePlaywright)' == 'true' " Text="Playwright currently doesn't support NativeAOT mode." />
8+
</Target>
9+
10+
<!-- Core -->
611
<ItemGroup>
712
<PackageReference Include="Microsoft.Testing.Platform.MSBuild" Version="$(MicrosoftTestingPlatformVersion)" VersionOverride="$(MicrosoftTestingPlatformVersion)" />
813
<PackageReference Include="MSTest.TestFramework" Version="$(MSTestVersion)" VersionOverride="$(MSTestVersion)" />

src/Package/MSTest.Sdk/Sdk/Sdk.props.template

+2
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@
55
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
66

77
<PropertyGroup>
8+
<EnablePlaywright Condition=" '$(EnablePlaywright)' == '' ">false</EnablePlaywright>
89
<UseVSTest Condition=" '$(UseVSTest)' == '' " >false</UseVSTest>
910
<MSTestVersion Condition=" '$(MSTestVersion)' == '' ">${MSTestVersion}</MSTestVersion>
1011
<MSTestEngineVersion Condition=" '$(MSTestEngineVersion)' == '' ">${MSTestEngineVersion}</MSTestEngineVersion>
1112
<MicrosoftNETTestSdkVersion Condition=" '$(MicrosoftNETTestSdkVersion)' == '' ">${MicrosoftNETTestSdkVersion}</MicrosoftNETTestSdkVersion>
13+
<MicrosoftPlaywrightVersion Condition=" '$(MicrosoftPlaywrightVersion)' == '' ">${MicrosoftPlaywrightVersion}</MicrosoftPlaywrightVersion>
1214
<MicrosoftTestingExtensionsCodeCoverageVersion Condition=" '$(MicrosoftTestingExtensionsCodeCoverageVersion)' == '' " >${MicrosoftTestingExtensionsCodeCoverageVersion}</MicrosoftTestingExtensionsCodeCoverageVersion>
1315
<MicrosoftTestingPlatformVersion Condition=" '$(MicrosoftTestingPlatformVersion)' == '' " >${MicrosoftTestingPlatformVersion}</MicrosoftTestingPlatformVersion>
1416
</PropertyGroup>
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
<?xml version="1.0" encoding="utf-8" ?>
22
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33

4-
<ItemGroup>
5-
<PackageReference Include="MSTest" Version="$(MSTestVersion)" VersionOverride="$(MSTestVersion)" />
4+
<ItemGroup Condition=" '$(EnablePlaywright)' == 'false' ">
5+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(MicrosoftNETTestSdkVersion)" VersionOverride="$(MicrosoftNETTestSdkVersion)" />
6+
<PackageReference Include="MSTest.TestAdapter" Version="$(MSTestVersion)" VersionOverride="$(MSTestVersion)" />
7+
<PackageReference Include="MSTest.TestFramework" Version="$(MSTestVersion)" VersionOverride="$(MSTestVersion)" />
8+
<PackageReference Include="MSTest.Analyzers" Version="$(MSTestVersion)" VersionOverride="$(MSTestVersion)" Condition=" '$(EnableMSTestAnalyzers)' != 'false' " />
9+
</ItemGroup>
10+
11+
<ItemGroup Condition=" '$(EnablePlaywright)' == 'true' ">
12+
<PackageReference Include="Microsoft.Playwright.MSTest" Version="$(MicrosoftPlaywrightVersion)" VersionOverride="$(MicrosoftPlaywrightVersion)" />
13+
<PackageReference Include="MSTest.Analyzers" Version="$(MSTestVersion)" VersionOverride="$(MSTestVersion)" Condition=" '$(EnableMSTestAnalyzers)' != 'false' " />
614
</ItemGroup>
715

816
</Project>

0 commit comments

Comments
 (0)