Skip to content

Commit bc6477c

Browse files
committed
Test end-to-end with PowerShell Daily
1 parent bbf3dca commit bc6477c

File tree

3 files changed

+28
-2
lines changed

3 files changed

+28
-2
lines changed

.github/workflows/ci-test.yml

+14-1
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,25 @@ jobs:
3737
3838
- name: Install PSResources
3939
shell: pwsh
40-
run: tools/installPSResources.ps1
40+
run: ./tools/installPSResources.ps1
4141

4242
- name: Build and test
4343
shell: pwsh
4444
run: Invoke-Build ${{ github.event_name == 'merge_group' && 'TestFull' || 'Test' }}
4545

46+
- name: Download PowerShell install script
47+
uses: actions/checkout@v4
48+
with:
49+
repository: PowerShell/PowerShell
50+
path: pwsh
51+
sparse-checkout: tools/install-powershell.ps1
52+
sparse-checkout-cone-mode: false
53+
54+
- name: Test with PowerShell Daily
55+
continue-on-error: true
56+
shell: pwsh
57+
run: ./pwsh/tools/install-powershell.ps1 -Daily && Invoke-Build TestE2EDaily
58+
4659
- name: Upload build artifacts
4760
if: always()
4861
uses: actions/upload-artifact@v3

PowerShellEditorServices.build.ps1

+13
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,19 @@ Task TestE2EPwsh Build, SetupHelpForTests, {
221221
Invoke-BuildExec { & dotnet $script:dotnetTestArgs $script:NetFramework.PS74 }
222222
}
223223

224+
$PwshDaily = if ($script:IsNix) {
225+
"$HOME/.powershell-daily/pwsh"
226+
} else {
227+
"$env:LOCALAPPDATA\Microsoft\powershell-daily\pwsh.exe"
228+
}
229+
230+
Task TestE2EDaily -If (Test-Path $PwshDaily) Build, SetupHelpForTests, {
231+
Set-Location .\test\PowerShellEditorServices.Test.E2E\
232+
$env:PWSH_EXE_NAME = $PwshDaily
233+
Write-Host "Running end-to-end tests with: $(& $PwshDaily --version)"
234+
Invoke-BuildExec { & dotnet $script:dotnetTestArgs $script:NetFramework.PS74 }
235+
}
236+
224237
Task TestE2EPowerShell -If (-not $script:IsNix) Build, SetupHelpForTests, {
225238
Set-Location .\test\PowerShellEditorServices.Test.E2E\
226239
$env:PWSH_EXE_NAME = "powershell"

test/PowerShellEditorServices.Test.E2E/Processes/PsesStdioProcess.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public class PsesStdioProcess : StdioServerProcess
4242

4343
// NOTE: Just hard-code this to "powershell" when testing with the code lens.
4444
public static string PwshExe { get; } = Environment.GetEnvironmentVariable("PWSH_EXE_NAME") ?? "pwsh";
45-
public static bool IsWindowsPowerShell { get; } = PwshExe.Contains("powershell");
45+
public static bool IsWindowsPowerShell { get; } = PwshExe.EndsWith("powershell");
4646
public static bool RunningInConstrainedLanguageMode { get; } =
4747
Environment.GetEnvironmentVariable("__PSLockdownPolicy", EnvironmentVariableTarget.Machine) != null;
4848

0 commit comments

Comments
 (0)