From 4af27fe4d0668cd5906e87b3a4a839ff2f59e362 Mon Sep 17 00:00:00 2001 From: Youssef1313 Date: Wed, 22 Jan 2025 06:13:23 +0100 Subject: [PATCH 01/11] Enable MTP --- Directory.Build.props | 4 ++++ Directory.Packages.props | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 02a848c87e48..30be3ab7cd97 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -17,6 +17,10 @@ direct false $(Platform) + + + true + true diff --git a/Directory.Packages.props b/Directory.Packages.props index c04a97ec804f..88e114d7e087 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -56,7 +56,7 @@ - + From 943e38b08b3c8b871a35440ff26cdc398516a0e5 Mon Sep 17 00:00:00 2001 From: Youssef1313 Date: Wed, 22 Jan 2025 06:47:56 +0100 Subject: [PATCH 02/11] Infra --- .pipelines/v2/templates/job-build-project.yml | 16 +++--------- .pipelines/v2/templates/job-test-project.yml | 3 --- Directory.Build.props | 26 ------------------- 3 files changed, 4 insertions(+), 41 deletions(-) diff --git a/.pipelines/v2/templates/job-build-project.yml b/.pipelines/v2/templates/job-build-project.yml index 12ebe4ff9c27..56180b62fc75 100644 --- a/.pipelines/v2/templates/job-build-project.yml +++ b/.pipelines/v2/templates/job-build-project.yml @@ -106,10 +106,6 @@ jobs: JobOutputArtifactName: build-$(BuildPlatform)-$(BuildConfiguration)${{ parameters.artifactStem }} NUGET_RESTORE_MSBUILD_ARGS: /p:Platform=$(BuildPlatform) # Required for nuget to work due to self contained NODE_OPTIONS: --max_old_space_size=16384 - ${{ if eq(parameters.runTests, true) }}: - MSBuildMainBuildTargets: Build;Test - ${{ else }}: - MSBuildMainBuildTargets: Build ${{ insert }}: ${{ parameters.variables }} ${{ if eq(parameters.useLatestWinAppSDK, true) }}: RestoreAdditionalProjectSourcesArg: '/p:RestoreAdditionalProjectSources="$(Build.SourcesDirectory)\localpackages\NugetPackages"' @@ -157,10 +153,6 @@ jobs: sdk: true version: '9.0' - - ${{ if eq(parameters.runTests, true) }}: - - task: VisualStudioTestPlatformInstaller@1 - displayName: Ensure VSTest Platform - - pwsh: |- & '.pipelines/applyXamlStyling.ps1' -Passive displayName: Verify XAML formatting @@ -211,9 +203,6 @@ jobs: - ${{ parameters.beforeBuildSteps }} - task: VSBuild@1 - ${{ if eq(parameters.runTests, true) }}: - displayName: Build and Test PowerToys main project - ${{ else }}: displayName: Build PowerToys main project inputs: solution: 'PowerToys.sln' @@ -225,7 +214,6 @@ jobs: /bl:$(LogOutputDirectory)\build-0-main.binlog ${{ parameters.additionalBuildOptions }} $(MSBuildCacheParameters) - /t:$(MSBuildMainBuildTargets) $(RestoreAdditionalProjectSourcesArg) platform: $(BuildPlatform) configuration: $(BuildConfiguration) @@ -235,6 +223,10 @@ jobs: env: SYSTEM_ACCESSTOKEN: $(System.AccessToken) + - pwsh: | + dotnet test PowerToys.sln --no-build -- --report-trx + displayName: Test PowerToys main project + - task: VSBuild@1 displayName: Build BugReportTool inputs: diff --git a/.pipelines/v2/templates/job-test-project.yml b/.pipelines/v2/templates/job-test-project.yml index 0bf4641e429f..836ecda5e6a1 100644 --- a/.pipelines/v2/templates/job-test-project.yml +++ b/.pipelines/v2/templates/job-test-project.yml @@ -73,9 +73,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 diff --git a/Directory.Build.props b/Directory.Build.props index 30be3ab7cd97..a44cbf0fc549 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -49,32 +49,6 @@ - - - - - - - - trx - - $(VsInstallRoot)\Common7\IDE\CommonExtensions\Microsoft\TestWindow - - false - - From eca410ad9bed4fc399798fa956d1c2de9084194f Mon Sep 17 00:00:00 2001 From: Youssef Victor Date: Wed, 22 Jan 2025 10:01:38 +0100 Subject: [PATCH 03/11] Revert some changes --- .pipelines/v2/templates/job-build-project.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.pipelines/v2/templates/job-build-project.yml b/.pipelines/v2/templates/job-build-project.yml index 56180b62fc75..12ebe4ff9c27 100644 --- a/.pipelines/v2/templates/job-build-project.yml +++ b/.pipelines/v2/templates/job-build-project.yml @@ -106,6 +106,10 @@ jobs: JobOutputArtifactName: build-$(BuildPlatform)-$(BuildConfiguration)${{ parameters.artifactStem }} NUGET_RESTORE_MSBUILD_ARGS: /p:Platform=$(BuildPlatform) # Required for nuget to work due to self contained NODE_OPTIONS: --max_old_space_size=16384 + ${{ if eq(parameters.runTests, true) }}: + MSBuildMainBuildTargets: Build;Test + ${{ else }}: + MSBuildMainBuildTargets: Build ${{ insert }}: ${{ parameters.variables }} ${{ if eq(parameters.useLatestWinAppSDK, true) }}: RestoreAdditionalProjectSourcesArg: '/p:RestoreAdditionalProjectSources="$(Build.SourcesDirectory)\localpackages\NugetPackages"' @@ -153,6 +157,10 @@ jobs: sdk: true version: '9.0' + - ${{ if eq(parameters.runTests, true) }}: + - task: VisualStudioTestPlatformInstaller@1 + displayName: Ensure VSTest Platform + - pwsh: |- & '.pipelines/applyXamlStyling.ps1' -Passive displayName: Verify XAML formatting @@ -203,6 +211,9 @@ jobs: - ${{ parameters.beforeBuildSteps }} - task: VSBuild@1 + ${{ if eq(parameters.runTests, true) }}: + displayName: Build and Test PowerToys main project + ${{ else }}: displayName: Build PowerToys main project inputs: solution: 'PowerToys.sln' @@ -214,6 +225,7 @@ jobs: /bl:$(LogOutputDirectory)\build-0-main.binlog ${{ parameters.additionalBuildOptions }} $(MSBuildCacheParameters) + /t:$(MSBuildMainBuildTargets) $(RestoreAdditionalProjectSourcesArg) platform: $(BuildPlatform) configuration: $(BuildConfiguration) @@ -223,10 +235,6 @@ jobs: env: SYSTEM_ACCESSTOKEN: $(System.AccessToken) - - pwsh: | - dotnet test PowerToys.sln --no-build -- --report-trx - displayName: Test PowerToys main project - - task: VSBuild@1 displayName: Build BugReportTool inputs: From d4e2c9d6f5b921b6609150499b075099184d8fb1 Mon Sep 17 00:00:00 2001 From: Youssef1313 Date: Fri, 24 Jan 2025 14:51:00 +0100 Subject: [PATCH 04/11] Adjust --- .pipelines/v2/templates/job-test-project.yml | 19 +++---------- Directory.Build.props | 28 +++++++++++++++++++ .../UITests-FancyZones.csproj | 8 +++--- .../UITests-FancyZonesEditor.csproj | 6 ++-- 4 files changed, 39 insertions(+), 22 deletions(-) diff --git a/.pipelines/v2/templates/job-test-project.yml b/.pipelines/v2/templates/job-test-project.yml index 836ecda5e6a1..73806fb13638 100644 --- a/.pipelines/v2/templates/job-test-project.yml +++ b/.pipelines/v2/templates/job-test-project.yml @@ -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" diff --git a/Directory.Build.props b/Directory.Build.props index a44cbf0fc549..90a8a352346c 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -20,6 +20,7 @@ true + false true @@ -49,6 +50,33 @@ + + + + + + + + + trx + + $(VsInstallRoot)\Common7\IDE\CommonExtensions\Microsoft\TestWindow + + false + + diff --git a/src/modules/fancyzones/UITests-FancyZones/UITests-FancyZones.csproj b/src/modules/fancyzones/UITests-FancyZones/UITests-FancyZones.csproj index 1ded556e9527..92ea952d3ce7 100644 --- a/src/modules/fancyzones/UITests-FancyZones/UITests-FancyZones.csproj +++ b/src/modules/fancyzones/UITests-FancyZones/UITests-FancyZones.csproj @@ -7,10 +7,10 @@ Microsoft.FancyZones.UITests false enable - Library - - - false + Exe + + + true diff --git a/src/modules/fancyzones/UITests-FancyZonesEditor/UITests-FancyZonesEditor.csproj b/src/modules/fancyzones/UITests-FancyZonesEditor/UITests-FancyZonesEditor.csproj index 542ebb4ef126..f180b1425ea1 100644 --- a/src/modules/fancyzones/UITests-FancyZonesEditor/UITests-FancyZonesEditor.csproj +++ b/src/modules/fancyzones/UITests-FancyZonesEditor/UITests-FancyZonesEditor.csproj @@ -7,10 +7,10 @@ Microsoft.FancyZonesEditor.UITests false enable - Library + Exe - - false + + false From c0c332a526dee87319f1dece965144845b19f237 Mon Sep 17 00:00:00 2001 From: Youssef1313 Date: Mon, 27 Jan 2025 17:22:01 +0100 Subject: [PATCH 05/11] Update to 3.7.3 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 88e114d7e087..bf387b263b19 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -56,7 +56,7 @@ - + From 84abda19a88907443688136424180180ce6da23a Mon Sep 17 00:00:00 2001 From: Youssef1313 Date: Mon, 27 Jan 2025 17:25:10 +0100 Subject: [PATCH 06/11] Small fix --- .../UITests-FancyZonesEditor/UITests-FancyZonesEditor.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/fancyzones/UITests-FancyZonesEditor/UITests-FancyZonesEditor.csproj b/src/modules/fancyzones/UITests-FancyZonesEditor/UITests-FancyZonesEditor.csproj index f180b1425ea1..29fbaadacb32 100644 --- a/src/modules/fancyzones/UITests-FancyZonesEditor/UITests-FancyZonesEditor.csproj +++ b/src/modules/fancyzones/UITests-FancyZonesEditor/UITests-FancyZonesEditor.csproj @@ -10,7 +10,7 @@ Exe - false + true From 4955c007352a195042d127cf3b90b94618fbee25 Mon Sep 17 00:00:00 2001 From: Youssef1313 Date: Wed, 29 Jan 2025 13:18:02 +0100 Subject: [PATCH 07/11] Adjust for C++ --- Directory.Build.props | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 90a8a352346c..9a6d1c65612d 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -50,6 +50,13 @@ + + + + + + + - + - + trx + true From c26fbc0433fd0241ead59910d127dba2ffea3484 Mon Sep 17 00:00:00 2001 From: Youssef Victor Date: Thu, 30 Jan 2025 17:22:45 +0100 Subject: [PATCH 11/11] Revert --- .pipelines/v2/templates/steps-ensure-dotnet-version.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.pipelines/v2/templates/steps-ensure-dotnet-version.yml b/.pipelines/v2/templates/steps-ensure-dotnet-version.yml index 3cf468951d4d..b327b8004fd1 100644 --- a/.pipelines/v2/templates/steps-ensure-dotnet-version.yml +++ b/.pipelines/v2/templates/steps-ensure-dotnet-version.yml @@ -5,8 +5,6 @@ parameters: - name: sdk type: boolean default: false -- name: platform - type: string # You might be wondering, "Why didn't they use UseDotNet?" # Azure Pipelines is practically unmaintained, that's why.