Skip to content

Commit 7af048d

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

File tree

3 files changed

+31
-2
lines changed

3 files changed

+31
-2
lines changed

.github/workflows/ci-test.yml

+17-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ on:
99
paths-ignore: [ '**/*.md' ]
1010
merge_group:
1111
types: [ checks_requested ]
12+
schedule:
13+
# 6am UTC which should be after a new daily build posts
14+
- cron: "0 6 * * *"
1215

1316
jobs:
1417
ci:
@@ -37,12 +40,25 @@ jobs:
3740
3841
- name: Install PSResources
3942
shell: pwsh
40-
run: tools/installPSResources.ps1
43+
run: ./tools/installPSResources.ps1
44+
45+
- name: Download daily install script
46+
uses: actions/checkout@v4
47+
with:
48+
repository: PowerShell/PowerShell
49+
path: pwsh
50+
sparse-checkout: tools/install-powershell.ps1
51+
sparse-checkout-cone-mode: false
4152

4253
- name: Build and test
4354
shell: pwsh
4455
run: Invoke-Build ${{ github.event_name == 'merge_group' && 'TestFull' || 'Test' }}
4556

57+
- name: Test with daily
58+
if: ${{ github.event_name == 'schedule' }}
59+
shell: pwsh
60+
run: ./pwsh/tools/install-powershell.ps1 -Daily && Invoke-Build TestE2EDaily
61+
4662
- name: Upload build artifacts
4763
if: always()
4864
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)