Skip to content

Commit ca4529f

Browse files
authored
Update MSI user scope install tests (#51)
Update MSI user scope install tests
1 parent 50628a3 commit ca4529f

File tree

5 files changed

+34
-18
lines changed

5 files changed

+34
-18
lines changed

cspell.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ words:
1010
- esep
1111
- dpkg
1212
- hkcu
13+
- hklm
1314
- maint
1415
- rsort
1516
- cnqoj

manifests/n/Nushell/Nushell/0.104.1/Nushell.Nushell.installer.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,25 @@ InstallModes:
1313
UpgradeBehavior: install
1414
Commands:
1515
- nu
16-
ReleaseDate: 2025-05-13
16+
ReleaseDate: 2025-05-15
1717
InstallationMetadata:
1818
DefaultInstallLocation: nu
1919
Installers:
2020
- Architecture: x64
2121
InstallerUrl: https://github.com/nushell/nightly/releases/download/v0.104.1/nu-0.104.1-x86_64-pc-windows-msvc.msi
22-
InstallerSha256: 588FB3156059D1363060B77C4D87E9B85DAAF93991AF53985CA611C1B6F1115E
23-
ProductCode: '{33467914-5777-4000-97AF-DB65F926EE4F}'
22+
InstallerSha256: 0A88012C109688116F9DC4E2FA172778EF590C8F05698758E9B88C4D9606618B
23+
ProductCode: '{E296D932-22B5-4B9F-918D-EB7D54EEB255}'
2424
AppsAndFeaturesEntries:
2525
- DisplayName: Nushell
26-
ProductCode: '{33467914-5777-4000-97AF-DB65F926EE4F}'
26+
ProductCode: '{E296D932-22B5-4B9F-918D-EB7D54EEB255}'
2727
UpgradeCode: '{82D756D2-19FA-4F09-B10F-64942E89F364}'
2828
- Architecture: arm64
2929
InstallerUrl: https://github.com/nushell/nightly/releases/download/v0.104.1/nu-0.104.1-aarch64-pc-windows-msvc.msi
30-
InstallerSha256: A76AE4A9CC11DD0CEF86CF011BBD195E7850444471A50F7F44209869C359A901
31-
ProductCode: '{33534361-CE47-4056-8A1F-061819E65461}'
30+
InstallerSha256: 9CDDDF2D5C50BDF38F04878F77B3397B3F7171A6F69A0C9B3FA0DF69DC8BB276
31+
ProductCode: '{D3B3EC28-2761-48A8-A2A3-0B0669BE6612}'
3232
AppsAndFeaturesEntries:
3333
- DisplayName: Nushell
34-
ProductCode: '{33534361-CE47-4056-8A1F-061819E65461}'
34+
ProductCode: '{D3B3EC28-2761-48A8-A2A3-0B0669BE6612}'
3535
UpgradeCode: '{82D756D2-19FA-4F09-B10F-64942E89F364}'
3636
ManifestType: installer
3737
ManifestVersion: 1.9.0

tests/common.nu

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export def check-user-install [install_dir = $USER_INSTALL_DIR: string] {
2626
print $"(char nl)Path Environment after install: \n"
2727
print ($environment | split row ';')
2828
assert equal ($environment | str contains $install_dir) true
29-
print $'(char nl)(ansi g)Path environment setup sucessfully...(ansi reset)'
29+
print $'(char nl)(ansi g)Path environment setup successfully...(ansi reset)'
3030
assert equal (registry query --hkcu Software\nu | where name == installed | get 0.value) 1
3131
assert equal (registry query --hkcu Software\nu | where name == WindowsTerminalProfile | get 0.value) 1
3232
check-common-install $install_dir
@@ -41,12 +41,12 @@ export def check-uninstall [install_dir = $MACHINE_INSTALL_DIR: string] {
4141
print ($environment | split row ';')
4242
assert equal ($environment | str contains $install_dir) false
4343
assert equal ($environment | str contains $USER_INSTALL_DIR) false
44-
print $'(char nl)(ansi g)Path environment uninstall sucessfully...(ansi reset)'
44+
print $'(char nl)(ansi g)Path environment uninstall successfully...(ansi reset)'
4545
assert equal ($PROFILE | path exists) false
46-
print $'(ansi g)Windows Terminal Profile uninstall sucessfully...(ansi reset)'
46+
print $'(ansi g)Windows Terminal Profile uninstall successfully...(ansi reset)'
4747
assert equal ($install_dir | path exists) false
4848
assert equal ($USER_INSTALL_DIR | path exists) false
49-
print $'(ansi g)Nu binaries uninstalled sucessfully...(ansi reset)'
49+
print $'(ansi g)Nu binaries uninstalled successfully...(ansi reset)'
5050
assert equal (try { registry query --hkcu Software\nu } catch {false}) false
5151
}
5252

@@ -58,7 +58,7 @@ export def check-local-machine-install [install_dir = $MACHINE_INSTALL_DIR: stri
5858
print $"(char nl)Path Environment after install: \n"
5959
print ($environment | split row ';')
6060
assert equal ($environment | str contains $install_dir) true
61-
print $'(char nl)(ansi g)Path environment setup sucessfully...(ansi reset)'
61+
print $'(char nl)(ansi g)Path environment setup successfully...(ansi reset)'
6262
assert equal (registry query --hklm Software\nu | where name == installed | get 0.value) 1
6363
assert equal (registry query --hkcu Software\nu | where name == WindowsTerminalProfile | get 0.value) 1
6464
check-common-install $install_dir
@@ -67,14 +67,24 @@ export def check-local-machine-install [install_dir = $MACHINE_INSTALL_DIR: stri
6767
# Run this command locally or in GitHub runners after installing nu
6868
export def check-common-install [install_dir = $USER_INSTALL_DIR: string] {
6969

70+
let profile = open $PROFILE
7071
let contents = ls -s $install_dir
7172
let bins = ls -s $'($install_dir)\bin'
7273
assert greater ($bins | length) 7
7374
assert greater ($contents | length) 3
7475
assert equal ($PROFILE | path exists) true
75-
print $'(ansi g)Windows Terminal Profile setup sucessfully...(ansi reset)'
76+
assert equal ($profile | get profiles.0.icon | path exists) true
77+
assert equal ($profile | get profiles.0.commandline | path exists) true
78+
print $'(ansi g)Windows Terminal Profile setup successfully...(ansi reset)'
7679
assert equal ($BINS | all {|it| $it in ($bins | get name) }) true
77-
print $'(ansi g)Nu binaries installed sucessfully...(ansi reset)'
80+
print $'(ansi g)Nu binaries installed successfully...(ansi reset)'
7881
assert equal ($ASSETS | all {|it| $it in ($contents | get name) }) true
7982
print (^$'($install_dir)\bin\nu.exe' -c 'version')
8083
}
84+
85+
export def check-version-match [version_expected: string, install_dir = $USER_INSTALL_DIR: string] {
86+
87+
let version = ^$'($install_dir)\bin\nu.exe' --version | str trim
88+
assert equal ($version_expected | str contains $version) true
89+
print $'(ansi g)Installed Nu of the specified version: ($version)(ansi reset)'
90+
}

tests/test-msi.nu

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
use std/assert
33
use std/testing *
4-
use common.nu [check-user-install]
4+
use common.nu [check-user-install, check-version-match]
55

66
const RELEASE_TAG = 'v0.104.1'
77

@@ -38,4 +38,5 @@ def 'msi-install:MSI should install successfully for per-user' [] {
3838
msiexec /i $pkg MSIINSTALLPERUSER=1 /quiet /qn /L*V install.txt
3939
# print (open -r install.txt)
4040
check-user-install $install_dir
41+
check-version-match $RELEASE_TAG $install_dir
4142
}

tests/winget-install.nu

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11

2-
use common.nu [check-user-install]
2+
use std/assert
3+
use common.nu [check-user-install, check-version-match]
4+
5+
const VERSION = '0.104.1'
36

47
def main [--scope: string] {
58

@@ -8,8 +11,9 @@ def main [--scope: string] {
811
print $'Using winget to test MSI (ansi g)($scope_tip)(ansi reset) installation'
912
let args = [--accept-source-agreements --accept-package-agreements --ignore-security-hash --silent]
1013
let scope_arg = if $scope in [user, machine] { [--scope $scope] } else { [] }
11-
winget settings --enable LocalManifestFiles
14+
winget settings --enable LocalManifestFiles
1215
winget settings --enable InstallerHashOverride
13-
winget install --manifest manifests\n\Nushell\Nushell\0.104.1 ...$args ...$scope_arg
16+
winget install --manifest manifests\n\Nushell\Nushell\($VERSION) ...$args ...$scope_arg
1417
check-user-install $install_dir
18+
check-version-match $VERSION $install_dir
1519
}

0 commit comments

Comments
 (0)