Skip to content

Only run Windows PowerShell 5.1 tests on CI with powershell.exe #1881

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

Merged
merged 1 commit into from
Aug 12, 2022
Merged
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
10 changes: 6 additions & 4 deletions PowerShellEditorServices.build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ $script:IsNix = $IsLinux -or $IsMacOS
# For Apple M1, pwsh might be getting emulated, in which case we need to check
# for the proc_translated flag, otherwise we can check the architecture.
$script:IsAppleM1 = $IsMacOS -and ((sysctl -n sysctl.proc_translated) -eq 1 -or (uname -m) -eq "arm64")
$script:IsArm64 = -not $script:IsNix -and @("ARM64", "AMD64") -contains $env:PROCESSOR_ARCHITECTURE
$script:IsArm64 = -not $script:IsNix -and @("ARM64") -contains $env:PROCESSOR_ARCHITECTURE
$script:BuildInfoPath = [System.IO.Path]::Combine($PSScriptRoot, "src", "PowerShellEditorServices.Hosting", "BuildInfo.cs")
$script:PsesCommonProps = [xml](Get-Content -Raw "$PSScriptRoot/PowerShellEditorServices.Common.props")

Expand Down Expand Up @@ -176,7 +176,9 @@ Task Test TestServer, TestE2E

Task TestServer TestServerWinPS, TestServerPS7, TestServerPS72

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

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

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