Skip to content

Commit 8477600

Browse files
Only run Windows PowerShell 5.1 tests on CI with powershell.exe (#1881)
1 parent 00238cd commit 8477600

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Diff for: PowerShellEditorServices.build.ps1

+6-4
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ $script:IsNix = $IsLinux -or $IsMacOS
3434
# For Apple M1, pwsh might be getting emulated, in which case we need to check
3535
# for the proc_translated flag, otherwise we can check the architecture.
3636
$script:IsAppleM1 = $IsMacOS -and ((sysctl -n sysctl.proc_translated) -eq 1 -or (uname -m) -eq "arm64")
37-
$script:IsArm64 = -not $script:IsNix -and @("ARM64", "AMD64") -contains $env:PROCESSOR_ARCHITECTURE
37+
$script:IsArm64 = -not $script:IsNix -and @("ARM64") -contains $env:PROCESSOR_ARCHITECTURE
3838
$script:BuildInfoPath = [System.IO.Path]::Combine($PSScriptRoot, "src", "PowerShellEditorServices.Hosting", "BuildInfo.cs")
3939
$script:PsesCommonProps = [xml](Get-Content -Raw "$PSScriptRoot/PowerShellEditorServices.Common.props")
4040

@@ -176,7 +176,9 @@ Task Test TestServer, TestE2E
176176

177177
Task TestServer TestServerWinPS, TestServerPS7, TestServerPS72
178178

179-
Task TestServerWinPS -If (-not $script:IsNix) Build, SetupHelpForTests, {
179+
# NOTE: While these can run under `pwsh.exe` we only want them to run under
180+
# `powershell.exe` so that the CI time isn't doubled.
181+
Task TestServerWinPS -If ($PSVersionTable.PSEdition -eq "Desktop") Build, SetupHelpForTests, {
180182
Set-Location .\test\PowerShellEditorServices.Test\
181183
# TODO: See https://github.com/dotnet/sdk/issues/18353 for x64 test host
182184
# that is debuggable! If architecture is added, the assembly path gets an
@@ -185,12 +187,12 @@ Task TestServerWinPS -If (-not $script:IsNix) Build, SetupHelpForTests, {
185187
Exec { & dotnet $script:dotnetTestArgs $script:NetRuntime.Desktop }
186188
}
187189

188-
Task TestServerPS7 -If (-not $script:IsAppleM1 -and -not $script:IsArm64) Build, SetupHelpForTests, {
190+
Task TestServerPS7 -If ($PSVersionTable.PSEdition -eq "Core" -and -not $script:IsAppleM1 -and -not $script:IsArm64) Build, SetupHelpForTests, {
189191
Set-Location .\test\PowerShellEditorServices.Test\
190192
Exec { & dotnet $script:dotnetTestArgs $script:NetRuntime.PS7 }
191193
}
192194

193-
Task TestServerPS72 Build, SetupHelpForTests, {
195+
Task TestServerPS72 -If ($PSVersionTable.PSEdition -eq "Core") Build, SetupHelpForTests, {
194196
Set-Location .\test\PowerShellEditorServices.Test\
195197
Exec { & dotnet $script:dotnetTestArgs $script:NetRuntime.PS72 }
196198
}

0 commit comments

Comments
 (0)