Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions cspell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ words:
- esep
- dpkg
- hkcu
- hklm
- maint
- rsort
- cnqoj
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,25 @@ InstallModes:
UpgradeBehavior: install
Commands:
- nu
ReleaseDate: 2025-05-13
ReleaseDate: 2025-05-15
InstallationMetadata:
DefaultInstallLocation: nu
Installers:
- Architecture: x64
InstallerUrl: https://github.com/nushell/nightly/releases/download/v0.104.1/nu-0.104.1-x86_64-pc-windows-msvc.msi
InstallerSha256: 588FB3156059D1363060B77C4D87E9B85DAAF93991AF53985CA611C1B6F1115E
ProductCode: '{33467914-5777-4000-97AF-DB65F926EE4F}'
InstallerSha256: 0A88012C109688116F9DC4E2FA172778EF590C8F05698758E9B88C4D9606618B
ProductCode: '{E296D932-22B5-4B9F-918D-EB7D54EEB255}'
AppsAndFeaturesEntries:
- DisplayName: Nushell
ProductCode: '{33467914-5777-4000-97AF-DB65F926EE4F}'
ProductCode: '{E296D932-22B5-4B9F-918D-EB7D54EEB255}'
UpgradeCode: '{82D756D2-19FA-4F09-B10F-64942E89F364}'
- Architecture: arm64
InstallerUrl: https://github.com/nushell/nightly/releases/download/v0.104.1/nu-0.104.1-aarch64-pc-windows-msvc.msi
InstallerSha256: A76AE4A9CC11DD0CEF86CF011BBD195E7850444471A50F7F44209869C359A901
ProductCode: '{33534361-CE47-4056-8A1F-061819E65461}'
InstallerSha256: 9CDDDF2D5C50BDF38F04878F77B3397B3F7171A6F69A0C9B3FA0DF69DC8BB276
ProductCode: '{D3B3EC28-2761-48A8-A2A3-0B0669BE6612}'
AppsAndFeaturesEntries:
- DisplayName: Nushell
ProductCode: '{33534361-CE47-4056-8A1F-061819E65461}'
ProductCode: '{D3B3EC28-2761-48A8-A2A3-0B0669BE6612}'
UpgradeCode: '{82D756D2-19FA-4F09-B10F-64942E89F364}'
ManifestType: installer
ManifestVersion: 1.9.0
24 changes: 17 additions & 7 deletions tests/common.nu
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export def check-user-install [install_dir = $USER_INSTALL_DIR: string] {
print $"(char nl)Path Environment after install: \n"
print ($environment | split row ';')
assert equal ($environment | str contains $install_dir) true
print $'(char nl)(ansi g)Path environment setup sucessfully...(ansi reset)'
print $'(char nl)(ansi g)Path environment setup successfully...(ansi reset)'
assert equal (registry query --hkcu Software\nu | where name == installed | get 0.value) 1
assert equal (registry query --hkcu Software\nu | where name == WindowsTerminalProfile | get 0.value) 1
check-common-install $install_dir
Expand All @@ -41,12 +41,12 @@ export def check-uninstall [install_dir = $MACHINE_INSTALL_DIR: string] {
print ($environment | split row ';')
assert equal ($environment | str contains $install_dir) false
assert equal ($environment | str contains $USER_INSTALL_DIR) false
print $'(char nl)(ansi g)Path environment uninstall sucessfully...(ansi reset)'
print $'(char nl)(ansi g)Path environment uninstall successfully...(ansi reset)'
assert equal ($PROFILE | path exists) false
print $'(ansi g)Windows Terminal Profile uninstall sucessfully...(ansi reset)'
print $'(ansi g)Windows Terminal Profile uninstall successfully...(ansi reset)'
assert equal ($install_dir | path exists) false
assert equal ($USER_INSTALL_DIR | path exists) false
print $'(ansi g)Nu binaries uninstalled sucessfully...(ansi reset)'
print $'(ansi g)Nu binaries uninstalled successfully...(ansi reset)'
assert equal (try { registry query --hkcu Software\nu } catch {false}) false
}

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

let profile = open $PROFILE
let contents = ls -s $install_dir
let bins = ls -s $'($install_dir)\bin'
assert greater ($bins | length) 7
assert greater ($contents | length) 3
assert equal ($PROFILE | path exists) true
print $'(ansi g)Windows Terminal Profile setup sucessfully...(ansi reset)'
assert equal ($profile | get profiles.0.icon | path exists) true
assert equal ($profile | get profiles.0.commandline | path exists) true
print $'(ansi g)Windows Terminal Profile setup successfully...(ansi reset)'
assert equal ($BINS | all {|it| $it in ($bins | get name) }) true
print $'(ansi g)Nu binaries installed sucessfully...(ansi reset)'
print $'(ansi g)Nu binaries installed successfully...(ansi reset)'
assert equal ($ASSETS | all {|it| $it in ($contents | get name) }) true
print (^$'($install_dir)\bin\nu.exe' -c 'version')
}

export def check-version-match [version_expected: string, install_dir = $USER_INSTALL_DIR: string] {

let version = ^$'($install_dir)\bin\nu.exe' --version | str trim
assert equal ($version_expected | str contains $version) true
print $'(ansi g)Installed Nu of the specified version: ($version)(ansi reset)'
}
3 changes: 2 additions & 1 deletion tests/test-msi.nu
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

use std/assert
use std/testing *
use common.nu [check-user-install]
use common.nu [check-user-install, check-version-match]

const RELEASE_TAG = 'v0.104.1'

Expand Down Expand Up @@ -38,4 +38,5 @@ def 'msi-install:MSI should install successfully for per-user' [] {
msiexec /i $pkg MSIINSTALLPERUSER=1 /quiet /qn /L*V install.txt
# print (open -r install.txt)
check-user-install $install_dir
check-version-match $RELEASE_TAG $install_dir
}
10 changes: 7 additions & 3 deletions tests/winget-install.nu
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@

use common.nu [check-user-install]
use std/assert
use common.nu [check-user-install, check-version-match]

const VERSION = '0.104.1'

def main [--scope: string] {

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