Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to MTP #37651

Open
wants to merge 24 commits into
base: main
Choose a base branch
from
Open
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
14 changes: 8 additions & 6 deletions .github/actions/spell-check/expect.txt
Original file line number Diff line number Diff line change
@@ -26,8 +26,8 @@ AGGREGATABLE
ahk
AHybrid
akv
ALIGNRIGHT
ALarger
ALIGNRIGHT
ALLAPPS
ALLCHILDREN
ALLINPUT
@@ -336,15 +336,16 @@ DISPLAYCHANGE
DISPLAYCONFIG
DISPLAYFLAGS
DISPLAYFREQUENCY
DISPLAYORIENTATION
displayname
DISPLAYORIENTATION
divyan
Dlg
DLGFRAME
DLGMODALFRAME
dlib
dllhost
dllmain
dnceng
DNLEN
DONOTROUND
DONTVALIDATEPATH
@@ -521,8 +522,8 @@ GETDESKWALLPAPER
GETDLGCODE
GETDPISCALEDSIZE
getfilesiginforedist
GETICON
GETHOTKEY
GETICON
GETMINMAXINFO
GETNONCLIENTMETRICS
GETPROPERTYSTOREFLAGS
@@ -822,10 +823,10 @@ LPTOP
lptpm
LPTR
LPTSTR
lpv
LPW
lpwcx
lpwndpl
lpv
LReader
LRESULT
LSTATUS
@@ -875,6 +876,7 @@ MERGECOPY
MERGEPAINT
Metadatas
metafile
metapackage
mfc
mfplat
Mgmt
@@ -1526,8 +1528,8 @@ STDMETHODIMP
STGC
STGM
STGMEDIUM
sticpl
STICKYKEYS
sticpl
stl
storelogo
stprintf
@@ -1714,11 +1716,11 @@ valuegenerator
variantassignment
vcamp
vcdl
VCENTER
vcgtq
VCINSTALLDIR
Vcpkg
VCRT
VCENTER
vcruntime
vcvars
VDesktop
22 changes: 4 additions & 18 deletions .pipelines/v2/templates/job-test-project.yml
Original file line number Diff line number Diff line change
@@ -70,9 +70,6 @@ jobs:
sdk: true
version: '9.0'

- task: VisualStudioTestPlatformInstaller@1
displayName: Ensure VSTest Platform

- pwsh: |-
& '$(build.sourcesdirectory)\.pipelines\InstallWinAppDriver.ps1'
displayName: Download and install WinAppDriver
@@ -82,18 +79,7 @@ jobs:
inputs:
displaySettings: 'optimal'

- task: VSTest@3
displayName: Run UI Tests
inputs:
platform: '$(BuildPlatform)'
configuration: '$(BuildConfiguration)'
testSelector: 'testAssemblies'
searchFolder: '$(Pipeline.Workspace)\$(TestArtifactsName)'
vsTestVersion: 'toolsInstaller'
uiTests: true
rerunFailedTests: true
testAssemblyVer2: |
**\UITests-FancyZones.dll
**\UITests-FancyZonesEditor.dll
!**\obj\**
!**\ref\**
- script: |
dotnet test $(Build.SourcesDirectory)\src\modules\fancyzones\UITests-FancyZones\UITests-FancyZones.csproj --no-build -c $(BuildConfiguration) -p:Platform=$(BuildPlatform)
dotnet test $(Build.SourcesDirectory)\src\modules\fancyzones\UITests-FancyZonesEditor\UITests-FancyZonesEditor.csproj --no-build -c $(BuildConfiguration) -p:Platform=$(BuildPlatform)
displayName: "Run UI Tests"
22 changes: 19 additions & 3 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -17,6 +17,14 @@
<NuGetAuditMode>direct</NuGetAuditMode>
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion> <!-- Don't add source revision hash to the product version of binaries. -->
<PlatformTarget>$(Platform)</PlatformTarget>

<!-- Enable Microsoft.Testing.Platform -->
<EnableMSTestRunner>true</EnableMSTestRunner>
<TestingPlatformShowTestsFailure>true</TestingPlatformShowTestsFailure>
<TestingPlatformDotNetTestSupport>true</TestingPlatformDotNetTestSupport>
<TestingPlatformCommandLineArguments>$(TestingPlatformCommandLineArguments) --report-trx</TestingPlatformCommandLineArguments>
<!-- No arm64 agents to run the tests. -->
<TestingPlatformDisableCustomTestTarget Condition="'$(Platform)' == 'ARM64'">true</TestingPlatformDisableCustomTestTarget>
</PropertyGroup>

<PropertyGroup Condition="'$(MSBuildProjectExtension)' == '.csproj'">
@@ -45,7 +53,15 @@
</PackageReference>
</ItemGroup>

<!-- Add ability to run tests via "msbuild /t:Test" -->
<!-- In CI, we build and test with `/t:Build;Test` -->
<!-- So, for non-test projects, we want the target to be there and it's basically doing nothing -->
<!-- For C# test projects, Microsoft.Testing.Platform should inject Test target here: -->
<!-- https://github.com/microsoft/testfx/blob/5ad21909704db501f58f27d4a7ec241edd761af5/src/Platform/Microsoft.Testing.Platform.MSBuild/buildMultiTargeting/Microsoft.Testing.Platform.MSBuild.targets#L270-L273 -->
<!-- For C++ test projects, the RunVSTest SDK will do its job -->
<Target Name="Test" />

<!-- Add ability to run tests via "msbuild /t:Test" using the RunVSTest SDK -->
<!-- This is only needed for C++, as we use Microsoft.Testing.Platform for C# -->
<!--
Workaround an MSBuild bug where Microsoft.Common.Test.targets is missing from the Arm64 installation.
See: https://github.com/dotnet/msbuild/pull/9984
@@ -55,11 +71,11 @@
Once the change referenced above is fixed, the ImportGroup below can be replaced with:
<Sdk Name="Microsoft.Build.RunVSTest" Version="1.0.319" />
-->
<ImportGroup Condition="'$(PROCESSOR_ARCHITECTURE)' != 'ARM64'">
<ImportGroup Condition="'$(PROCESSOR_ARCHITECTURE)' != 'ARM64' AND ('$(Language)' == 'C++' OR '$(MSBuildProjectExtension)' == '.vcxproj')">
<Import Project="Sdk.props" Sdk="Microsoft.Build.RunVSTest" Version="1.0.319" />
<Import Project="Sdk.targets" Sdk="Microsoft.Build.RunVSTest" Version="1.0.319" />
</ImportGroup>
<PropertyGroup>
<PropertyGroup Condition="'$(Language)' == 'C++' OR '$(MSBuildProjectExtension)' == '.vcxproj'">
<VSTestLogger>trx</VSTestLogger>
<!--
RunVSTest by default uses %VSINSTALLDIR%\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe,
6 changes: 4 additions & 2 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Project>
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<MSTestVersion>3.9.0-preview.25124.5</MSTestVersion>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="Appium.WebDriver" Version="4.4.5" />
@@ -56,7 +57,8 @@
<PackageVersion Include="ModernWpfUI" Version="0.9.4" />
<!-- Moq to stay below v4.20 due to behavior change. need to be sure fixed -->
<PackageVersion Include="Moq" Version="4.18.4" />
<PackageVersion Include="MSTest" Version="3.6.3" />
<PackageVersion Include="MSTest" Version="$(MSTestVersion)" />
<PackageVersion Include="MSTest.TestFramework" Version="$(MSTestVersion)" />
<PackageVersion Include="NLog" Version="5.0.4" />
<PackageVersion Include="NLog.Extensions.Logging" Version="5.3.8" />
<PackageVersion Include="NLog.Schema" Version="5.2.8" />
3 changes: 2 additions & 1 deletion NOTICE.md
Original file line number Diff line number Diff line change
@@ -1342,7 +1342,8 @@ EXHIBIT A -Mozilla Public License.
- Microsoft.Xaml.Behaviors.Wpf 1.1.39
- ModernWpfUI 0.9.4
- Moq 4.18.4
- MSTest 3.6.3
- MSTest 3.9.0-preview.25124.5
- MSTest.TestFramework 3.9.0-preview.25124.5
- NLog.Extensions.Logging 5.3.8
- NLog.Schema 5.2.8
- OpenAI 2.0.0
7 changes: 7 additions & 0 deletions nuget.config
Original file line number Diff line number Diff line change
@@ -3,10 +3,17 @@
<packageSources>
<clear />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
<!-- TEMPORARY ONLY FOR TESTING PREVIEW IN PR - DON'T MERGE! -->
<add key="test-tools" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/test-tools/nuget/v3/index.json" />
</packageSources>
<packageSourceMapping>
<packageSource key="nuget.org">
<package pattern="*" />
</packageSource>
<packageSource key="test-tools">
<package pattern="MSTest" />
<package pattern="MSTest.*" />
<package pattern="Microsoft.Testing.*" />
</packageSource>
</packageSourceMapping>
</configuration>
3 changes: 2 additions & 1 deletion src/common/UITestAutomation/UITestAutomation.csproj
Original file line number Diff line number Diff line change
@@ -12,7 +12,8 @@

<ItemGroup>
<PackageReference Include="Appium.WebDriver" />
<PackageReference Include="MSTest" />
<!-- Test libraries/utilities should not use the metapackage. -->
<PackageReference Include="MSTest.TestFramework" />
<PackageReference Include="System.IO.Abstractions" />
</ItemGroup>

Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@

<PropertyGroup>
<IsPackable>false</IsPackable>
<OutputType>Library</OutputType>
<OutputType>Exe</OutputType>
<RootNamespace>Microsoft.Interop.Tests</RootNamespace>
<AssemblyName>Microsoft.Interop.Tests</AssemblyName>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
Original file line number Diff line number Diff line change
@@ -4,6 +4,12 @@
<LangVersion>latest</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<OutputType>Exe</OutputType>

<!-- exit code 8 means no tests ran. -->
<!-- Doc: https://learn.microsoft.com/dotnet/core/testing/unit-testing-platform-exit-codes -->
<!-- This test project doesn't seem to contain any tests. -->
<TestingPlatformCommandLineArguments>$(TestingPlatformCommandLineArguments) --ignore-exit-code 8</TestingPlatformCommandLineArguments>
</PropertyGroup>
<PropertyGroup>
<OutputPath>..\..\..\..\$(Platform)\$(Configuration)\tests\AdvancedPaste.FuzzTests\</OutputPath>
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
<OutputPath>$(SolutionDir)$(Platform)\$(Configuration)\tests\AdvancedPaste.UnitTests\</OutputPath>
<IsTestProject>true</IsTestProject>
<OutputType>Exe</OutputType>
</PropertyGroup>

<ItemGroup>
5 changes: 5 additions & 0 deletions src/modules/Hosts/Hosts.FuzzTests/Hosts.FuzzTests.csproj
Original file line number Diff line number Diff line change
@@ -3,6 +3,11 @@
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
<LangVersion>latest</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>

<!-- exit code 8 means no tests ran. -->
<!-- Doc: https://learn.microsoft.com/dotnet/core/testing/unit-testing-platform-exit-codes -->
<!-- This test project doesn't seem to contain any tests. -->
<TestingPlatformCommandLineArguments>$(TestingPlatformCommandLineArguments) --ignore-exit-code 8</TestingPlatformCommandLineArguments>
</PropertyGroup>

<PropertyGroup>
1 change: 1 addition & 0 deletions src/modules/Hosts/Hosts.Tests/Hosts.Tests.csproj
Original file line number Diff line number Diff line change
@@ -9,6 +9,7 @@
<OutputPath>$(SolutionDir)$(Platform)\$(Configuration)\tests\Hosts.Tests\</OutputPath>
<RootNamespace>Hosts.Tests</RootNamespace>
<AssemblyName>PowerToys.Hosts.Tests</AssemblyName>
<OutputType>Exe</OutputType>
</PropertyGroup>

<ItemGroup>
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@
<AssemblyName>PowerToys.MouseJump.Common.UnitTests</AssemblyName>
<AssemblyTitle>PowerToys.MouseJump.Common.UnitTests</AssemblyTitle>
<AssemblyDescription>PowerToys MouseJump.Common.UnitTests</AssemblyDescription>
<OutputType>Library</OutputType>
<OutputType>Exe</OutputType>
<OutputPath>..\..\..\..\$(Platform)\$(Configuration)\tests\MouseJump.Common.UnitTests\</OutputPath>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
Original file line number Diff line number Diff line change
@@ -6,7 +6,13 @@
<PropertyGroup>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<OutputType>Library</OutputType>
<OutputType>Exe</OutputType>

<!-- exit code 8 means no tests ran. -->
<!-- Doc: https://learn.microsoft.com/dotnet/core/testing/unit-testing-platform-exit-codes -->
<!-- This test project contains a single test but it's ignored. -->
<!-- Remove this line if more tests are added or if the test is un-ignored -->
<TestingPlatformCommandLineArguments>$(TestingPlatformCommandLineArguments) --ignore-exit-code 8</TestingPlatformCommandLineArguments>
</PropertyGroup>

<ItemGroup>
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@
<RootNamespace>Microsoft.ColorPicker.UnitTests</RootNamespace>
<IsPackable>false</IsPackable>
<Nullable>enable</Nullable>
<OutputType>Library</OutputType>
<OutputType>Exe</OutputType>
</PropertyGroup>

<PropertyGroup>
Original file line number Diff line number Diff line change
@@ -7,10 +7,10 @@
<RootNamespace>Microsoft.FancyZones.UITests</RootNamespace>
<IsPackable>false</IsPackable>
<Nullable>enable</Nullable>
<OutputType>Library</OutputType>
<!-- This is a UI test, so don't run as part of MSBuild -->
<RunVSTest>false</RunVSTest>
<OutputType>Exe</OutputType>

<!-- This is a UI test, so don't run as part of the Test target -->
<TestingPlatformDisableCustomTestTarget>true</TestingPlatformDisableCustomTestTarget>
</PropertyGroup>

<PropertyGroup>
Original file line number Diff line number Diff line change
@@ -15,13 +15,14 @@ namespace UITests_FancyZonesEditor
public class RunFancyZonesEditorTest
{
private static FancyZonesEditorSession? _session;
private static TestContext? _context;
private readonly TestContext _context;

public RunFancyZonesEditorTest(TestContext context)
=> _context = context;

[ClassInitialize]
public static void ClassInitialize(TestContext testContext)
{
_context = testContext;

// prepare files to launch Editor without errors
EditorParameters editorParameters = new EditorParameters();
EditorParameters.ParamsWrapper parameters = new EditorParameters.ParamsWrapper
@@ -133,19 +134,18 @@ public static void ClassInitialize(TestContext testContext)
public static void ClassCleanup()
{
FancyZonesEditorSession.Files.Restore();
_context = null;
}

[TestInitialize]
public void TestInitialize()
{
_session = new FancyZonesEditorSession(_context!);
_session = new FancyZonesEditorSession(_context);
}

[TestCleanup]
public void TestCleanup()
{
_session?.Close(_context!);
_session?.Close(_context);
}

[TestMethod]
Original file line number Diff line number Diff line change
@@ -7,10 +7,10 @@
<RootNamespace>Microsoft.FancyZonesEditor.UITests</RootNamespace>
<IsPackable>false</IsPackable>
<Nullable>enable</Nullable>
<OutputType>Library</OutputType>
<OutputType>Exe</OutputType>

<!-- This is a UI test, so don't run as part of MSBuild -->
<RunVSTest>false</RunVSTest>
<!-- This is a UI test, so don't run as part of the Test target -->
<TestingPlatformDisableCustomTestTarget>true</TestingPlatformDisableCustomTestTarget>
</PropertyGroup>

<PropertyGroup>
Original file line number Diff line number Diff line change
@@ -7,8 +7,7 @@
<IsPackable>false</IsPackable>
<Nullable>enable</Nullable>

<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
<OutputType>Exe</OutputType>
<OutputPath>..\..\..\..\$(Platform)\$(Configuration)\tests\UnitTest-FancyZonesEditor\</OutputPath>
</PropertyGroup>

2 changes: 1 addition & 1 deletion src/modules/imageresizer/tests/ImageResizerUITest.csproj
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@

<PropertyGroup>
<ProjectGuid>{E0CC7526-D85E-43AC-844F-D5DF0D2F5AB8}</ProjectGuid>
<OutputType>Library</OutputType>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ImageResizer</RootNamespace>
<AssemblyName>ImageResizer.Test</AssemblyName>
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@

<PropertyGroup>
<IsPackable>false</IsPackable>
<OutputType>Exe</OutputType>
</PropertyGroup>

<ItemGroup>
Loading
Oops, something went wrong.
Loading
Oops, something went wrong.