Skip to content

Commit a94c2a8

Browse files
committed
test(gha): add chocolatey bootstrapping and neovim installation test
1 parent 585835b commit a94c2a8

3 files changed

Lines changed: 9 additions & 1 deletion

File tree

src/Services/Bootstrappers/ChocolateyBootstrapper.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@ public void Install(bool dryRun)
3737
}
3838

3939
string command = "[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; " +
40-
"iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))";
40+
"irm https://community.chocolatey.org/install.ps1 -outfile choco_install.ps1; " +
41+
"(Get-Content choco_install.ps1).Replace('Get-ExecutionPolicy', '\"$([char]39)RemoteSigned$([char]39)\"') | Set-Content choco_install.ps1; " +
42+
".\\choco_install.ps1; " +
43+
"if (Test-Path .\\choco_install.ps1) { Remove-Item .\\choco_install.ps1 }";
4144

4245
for (int attempt = 0; attempt < MaxRetries; attempt++)
4346
{

test-data/test-config-gha.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ version: "1.0"
22
apps:
33
- id: 7zip.7zip
44
manager: winget
5+
- id: neovim
6+
manager: chocolatey
57
envVars:
68
- variable: "WINHOME_TEST_GHA"
79
value: "true"

test-data/verify-gha.ps1

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,7 @@ Assert-True (Test-Path "C:\scoop\apps\fzf"), "fzf app directory should exist und
5959
Assert-True (Test-Path "C:\scoop\apps\ripgrep"), "ripgrep app directory should exist under Scoop"
6060
Assert-True (Test-Path "C:\scoop\apps\zoxide"), "zoxide app directory should exist under Scoop"
6161

62+
# 9. Verify Chocolatey applications were auto-installed by WinHome
63+
Assert-True (Test-Path "C:\ProgramData\chocolatey\lib\neovim"), "Neovim app directory should exist under Chocolatey"
64+
6265
exit $global:exitCode

0 commit comments

Comments
 (0)