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

Enable MTP #37001

Draft
wants to merge 22 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Adjust
  • Loading branch information
Youssef1313 committed Jan 28, 2025
commit d4e2c9d6f5b921b6609150499b075099184d8fb1
19 changes: 4 additions & 15 deletions .pipelines/v2/templates/job-test-project.yml
Original file line number Diff line number Diff line change
@@ -82,18 +82,7 @@ jobs:
inputs:
displaySettings: 'optimal'

- task: VSTest@3
displayName: Run UI Tests
inputs:
platform: '$(BuildPlatform)'
configuration: '$(BuildConfiguration)'
testSelector: 'testAssemblies'
searchFolder: '$(Pipeline.Workspace)\build-${{ parameters.platform }}-${{ parameters.configuration }}${{ parameters.inputArtifactStem }}'
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"
28 changes: 28 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -20,6 +20,7 @@

<!-- Enable Microsoft.Testing.Platform -->
<EnableMSTestRunner>true</EnableMSTestRunner>
<TestingPlatformCaptureOutput>false</TestingPlatformCaptureOutput>
<TestingPlatformDotNetTestSupport>true</TestingPlatformDotNetTestSupport>
</PropertyGroup>

@@ -49,6 +50,33 @@
</PackageReference>
</ItemGroup>

<!-- 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
NB 1: This means that using "/t:Test" is not supported for Arm64 builds and tests will need to be run in an alternate way,
eg running tests in VS or invoking vstest.console directly.
NB 2: <Sdk> elements do not support conditions, so this is also being worked around.
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' AND '$(Language)' == 'C++'">
<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 Condition="'$(Language)' == 'C++'">
<VSTestLogger>trx</VSTestLogger>
<!--
RunVSTest by default uses %VSINSTALLDIR%\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe,
but some of the CI scenarios don't define %VSINSTALLDIR%, so be explicit about where to look for vstest.
Note: $(VsInstallRoot) is a built-in MSBuild property, so should always be defined.
-->
<VSTestToolPath>$(VsInstallRoot)\Common7\IDE\CommonExtensions\Microsoft\TestWindow</VSTestToolPath>
<!-- No arm64 agents to run the tests. -->
<RunVSTest Condition="'$(Platform)' == 'ARM64'">false</RunVSTest>
</PropertyGroup>

<!-- MSBuildCache -->
<PropertyGroup>
<!-- Off by default -->
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
@@ -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>false</TestingPlatformDisableCustomTestTarget>
</PropertyGroup>

<PropertyGroup>