diff --git a/build/pipelines/ci.yml b/build/pipelines/ci.yml index 3408846be3..7b0b25c047 100644 --- a/build/pipelines/ci.yml +++ b/build/pipelines/ci.yml @@ -87,6 +87,13 @@ stages: buildConfigurations: [Release] buildEverything: true keepAllExpensiveBuildOutputs: false + ${{ if eq(parameters.runTests, true) }}: + # Copy the appx files into the bin drop because the LocalTests need them + afterBuildSteps: + - pwsh: |- + $deps = ./build/scripts/Get-DependenciesFromAppxRecipe.ps1 -Path "$(Terminal.BinDir)/TestHostApp/TestHostApp.build.appxrecipe" + $dir = New-Item -Type Directory "$(Terminal.BinDir)/_testDeps" + $deps | Copy-Item -Destination $dir -Verbose - ${{ if eq(parameters.runTests, true) }}: - stage: Test_${{ platform }} diff --git a/build/pipelines/templates-v2/job-build-project.yml b/build/pipelines/templates-v2/job-build-project.yml index 7672901763..d1a6e50569 100644 --- a/build/pipelines/templates-v2/job-build-project.yml +++ b/build/pipelines/templates-v2/job-build-project.yml @@ -71,6 +71,9 @@ parameters: - name: enableCaching type: boolean default: false + - name: afterBuildSteps + type: stepList + default: [] jobs: - job: ${{ parameters.jobName }} @@ -210,6 +213,8 @@ jobs: contents: $(Build.SourcesDirectory)/MSBuildCacheLogs/** TargetFolder: $(Terminal.BinDir)/MSBuildCacheLogs + - ${{ parameters.afterBuildSteps }} + # This saves ~2GiB per architecture. We won't need these later. # Removes: # - All .lib that do not have an associated .exp (which would indicate that they are import libs) diff --git a/build/pipelines/templates-v2/job-test-project.yml b/build/pipelines/templates-v2/job-test-project.yml index 804a004bbc..c9c3f1cad3 100644 --- a/build/pipelines/templates-v2/job-test-project.yml +++ b/build/pipelines/templates-v2/job-test-project.yml @@ -58,6 +58,24 @@ jobs: filePath: build\scripts\Run-Tests.ps1 arguments: -MatchPattern '*feature.test*.dll' -Platform '$(OutputBuildPlatform)' -Configuration '$(BuildConfiguration)' -LogPath '${{ parameters.testLogPath }}' -Root "$(Terminal.BinDir)" + # Load-bearing: This needs to be Windows PowerShell, not pwsh, due to Add-AppxPackage not working in pwsh. + - powershell: |- + $deps = Get-ChildItem -Recurse "$(Terminal.BinDir)/_testDeps" + $deps | % { + Write-Host "Installing $($_.FullName)..." + Add-AppxPackage -Path $_.FullName -ErrorAction:Ignore + } + displayName: 'Install LocalTest Dependencies' + + - task: PowerShell@2 + displayName: 'Run Local Tests' + inputs: + pwsh: true + targetType: filePath + filePath: build\scripts\Run-Tests.ps1 + arguments: -MatchPattern '*LocalTests*.dll' -Platform '$(OutputBuildPlatform)' -Configuration '$(BuildConfiguration)' -LogPath '${{ parameters.testLogPath }}' -Root "$(Terminal.BinDir)" + condition: and(succeeded(), ne(variables['PGOBuildMode'], 'Instrument')) + - task: PowerShell@2 displayName: 'Convert Test Logs from WTL to xUnit format' condition: always() diff --git a/build/scripts/Get-DependenciesFromAppxRecipe.ps1 b/build/scripts/Get-DependenciesFromAppxRecipe.ps1 new file mode 100644 index 0000000000..762a15c99b --- /dev/null +++ b/build/scripts/Get-DependenciesFromAppxRecipe.ps1 @@ -0,0 +1,17 @@ +[CmdletBinding()] +Param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true, + HelpMessage="Path to the .appxrecipe to parse")] + [string] + $Path +) + +$Recipe = [xml](Get-Content $Path) +$ResolvedSDKReferences = $Recipe.Project.ItemGroup.ResolvedSDKReference + +$ResolvedSDKReferences | + Where-Object Architecture -eq $Recipe.Project.PropertyGroup.PackageArchitecture | + ForEach-Object { + $l = [Uri]::UnescapeDataString($_.AppxLocation) + Get-Item $l + } diff --git a/src/cascadia/LocalTests_TerminalApp/TabTests.cpp b/src/cascadia/LocalTests_TerminalApp/TabTests.cpp index 8036acd594..8272be34ed 100644 --- a/src/cascadia/LocalTests_TerminalApp/TabTests.cpp +++ b/src/cascadia/LocalTests_TerminalApp/TabTests.cpp @@ -347,6 +347,10 @@ namespace TerminalAppLocalTests void TabTests::TryDuplicateBadTab() { + BEGIN_TEST_METHOD_PROPERTIES() + TEST_METHOD_PROPERTY(L"Ignore", L"True") // GH#19610 tracks re-enabling this test + END_TEST_METHOD_PROPERTIES() + // * Create a tab with a profile with GUID 1 // * Reload the settings so that GUID 1 is no longer in the list of profiles // * Try calling _DuplicateFocusedTab on tab 1 @@ -434,6 +438,10 @@ namespace TerminalAppLocalTests void TabTests::TryDuplicateBadPane() { + BEGIN_TEST_METHOD_PROPERTIES() + TEST_METHOD_PROPERTY(L"Ignore", L"True") // GH#19610 tracks re-enabling this test + END_TEST_METHOD_PROPERTIES() + // * Create a tab with a profile with GUID 1 // * Reload the settings so that GUID 1 is no longer in the list of profiles // * Try calling _SplitPane(Duplicate) on tab 1 @@ -685,6 +693,7 @@ namespace TerminalAppLocalTests { BEGIN_TEST_METHOD_PROPERTIES() TEST_METHOD_PROPERTY(L"IsolationLevel", L"Method") + TEST_METHOD_PROPERTY(L"Ignore", L"True") // GH#19610 tracks re-enabling this test END_TEST_METHOD_PROPERTIES() auto page = _commonSetup(); @@ -724,6 +733,10 @@ namespace TerminalAppLocalTests void TabTests::MoveFocusFromZoomedPane() { + BEGIN_TEST_METHOD_PROPERTIES() + TEST_METHOD_PROPERTY(L"Ignore", L"True") // GH#19610 tracks re-enabling this test + END_TEST_METHOD_PROPERTIES() + auto page = _commonSetup(); Log::Comment(L"Create a second pane"); @@ -769,6 +782,10 @@ namespace TerminalAppLocalTests void TabTests::CloseZoomedPane() { + BEGIN_TEST_METHOD_PROPERTIES() + TEST_METHOD_PROPERTY(L"Ignore", L"True") // GH#19610 tracks re-enabling this test + END_TEST_METHOD_PROPERTIES() + auto page = _commonSetup(); Log::Comment(L"Create a second pane"); @@ -824,6 +841,10 @@ namespace TerminalAppLocalTests void TabTests::SwapPanes() { + BEGIN_TEST_METHOD_PROPERTIES() + TEST_METHOD_PROPERTY(L"Ignore", L"True") // GH#19610 tracks re-enabling this test + END_TEST_METHOD_PROPERTIES() + auto page = _commonSetup(); Log::Comment(L"Setup 4 panes."); @@ -1030,6 +1051,10 @@ namespace TerminalAppLocalTests void TabTests::NextMRUTab() { + BEGIN_TEST_METHOD_PROPERTIES() + TEST_METHOD_PROPERTY(L"Ignore", L"True") // GH#19610 tracks re-enabling this test + END_TEST_METHOD_PROPERTIES() + // This is a test for GH#8025 - we want to make sure that we can do both // in-order and MRU tab traversal, using the tab switcher and with the // tab switcher disabled. @@ -1146,6 +1171,10 @@ namespace TerminalAppLocalTests void TabTests::VerifyCommandPaletteTabSwitcherOrder() { + BEGIN_TEST_METHOD_PROPERTIES() + TEST_METHOD_PROPERTY(L"Ignore", L"True") // GH#19610 tracks re-enabling this test + END_TEST_METHOD_PROPERTIES() + // This is a test for GH#8188 - we want to make sure that the order of tabs // is preserved in the CommandPalette's TabSwitcher @@ -1241,6 +1270,7 @@ namespace TerminalAppLocalTests { BEGIN_TEST_METHOD_PROPERTIES() TEST_METHOD_PROPERTY(L"IsolationLevel", L"Method") + TEST_METHOD_PROPERTY(L"Ignore", L"True") // GH#19610 tracks re-enabling this test END_TEST_METHOD_PROPERTIES() auto page = _commonSetup(); @@ -1273,6 +1303,7 @@ namespace TerminalAppLocalTests { BEGIN_TEST_METHOD_PROPERTIES() TEST_METHOD_PROPERTY(L"IsolationLevel", L"Method") + TEST_METHOD_PROPERTY(L"Ignore", L"True") // GH#19610 tracks re-enabling this test END_TEST_METHOD_PROPERTIES() auto page = _commonSetup(); @@ -1305,6 +1336,10 @@ namespace TerminalAppLocalTests void TabTests::TestPreviewCommitScheme() { + BEGIN_TEST_METHOD_PROPERTIES() + TEST_METHOD_PROPERTY(L"Ignore", L"True") // GH#19610 tracks re-enabling this test + END_TEST_METHOD_PROPERTIES() + Log::Comment(L"Preview a color scheme. Make sure it's applied, then committed accordingly"); auto page = _commonSetup(); @@ -1367,6 +1402,10 @@ namespace TerminalAppLocalTests void TabTests::TestPreviewDismissScheme() { + BEGIN_TEST_METHOD_PROPERTIES() + TEST_METHOD_PROPERTY(L"Ignore", L"True") // GH#19610 tracks re-enabling this test + END_TEST_METHOD_PROPERTIES() + Log::Comment(L"Preview a color scheme. Make sure it's applied, then dismissed accordingly"); auto page = _commonSetup(); @@ -1415,6 +1454,10 @@ namespace TerminalAppLocalTests void TabTests::TestPreviewSchemeWhilePreviewing() { + BEGIN_TEST_METHOD_PROPERTIES() + TEST_METHOD_PROPERTY(L"Ignore", L"True") // GH#19610 tracks re-enabling this test + END_TEST_METHOD_PROPERTIES() + Log::Comment(L"Preview a color scheme, then preview another scheme. "); Log::Comment(L"Preview a color scheme. Make sure it's applied, then committed accordingly"); @@ -1482,6 +1525,10 @@ namespace TerminalAppLocalTests void TabTests::TestClampSwitchToTab() { + BEGIN_TEST_METHOD_PROPERTIES() + TEST_METHOD_PROPERTY(L"Ignore", L"True") // GH#19610 tracks re-enabling this test + END_TEST_METHOD_PROPERTIES() + Log::Comment(L"Test that switching to a tab index higher than the number of tabs just clamps to the last tab."); auto page = _commonSetup();