diff --git a/tests/common.nu b/tests/common.nu index 9d4b42c26..8937860c1 100644 --- a/tests/common.nu +++ b/tests/common.nu @@ -90,7 +90,12 @@ export def check-version-match [version_expected: string, install_dir = $USER_IN } export def get-latest-tag [] { - http get https://api.github.com/repos/nushell/nightly/releases + let headers = if ($env.GITHUB_TOKEN? | is-not-empty) { + { Authorization: $'Bearer ($env.GITHUB_TOKEN)' } + } else { + {} + } + http get -H $headers https://api.github.com/repos/nushell/nightly/releases | sort-by -r created_at | where tag_name =~ nightly | get tag_name?.0? diff --git a/tests/test-all.nu b/tests/test-all.nu index 9a11eba0a..1af95b68f 100644 --- a/tests/test-all.nu +++ b/tests/test-all.nu @@ -33,7 +33,7 @@ def main [--msi(-m), --local] { } export def test-msi-per-user-install [] { - winget uninstall nushell | complete + try { winget uninstall nushell } catch { } print $'Using msiexec to test MSI (ansi g)per-user(ansi reset) installation' print '-------------------------------------------------------------------' msiexec /i $MSI_PKG MSIINSTALLPERUSER=1 /quiet /qn /L*V install.txt @@ -43,7 +43,7 @@ export def test-msi-per-user-install [] { } export def test-msi-per-machine-install [] { - winget uninstall nushell | complete + try { winget uninstall nushell } catch { } print $'(char nl)Using msiexec to test MSI (ansi g)machine scope(ansi reset) installation' print '-------------------------------------------------------------------' msiexec /i $MSI_PKG ALLUSERS=1 /L*V install.txt @@ -53,7 +53,7 @@ export def test-msi-per-machine-install [] { } export def test-winget-per-user-install [--local] { - winget uninstall nushell | complete + try { winget uninstall nushell } catch { } print $'(char nl)Using winget to test MSI (ansi g)user scope(ansi reset) installation' print '-------------------------------------------------------------------' if $local { @@ -83,7 +83,7 @@ export def test-winget-per-user-upgrade [--local] { } export def test-winget-per-machine-install [--local] { - winget uninstall nushell | complete + try { winget uninstall nushell } catch { } print $'(char nl)Using winget to test MSI (ansi g)machine scope(ansi reset) installation' print '-------------------------------------------------------------------' if $local { diff --git a/tests/winget-install.nu b/tests/winget-install.nu index a0658e4f2..494b453d3 100644 --- a/tests/winget-install.nu +++ b/tests/winget-install.nu @@ -43,7 +43,12 @@ export def prepare-manifest [] { } def get-download-url [] { - http get https://api.github.com/repos/nushell/nightly/releases + let headers = if ($env.GITHUB_TOKEN? | is-not-empty) { + { Authorization: $'Bearer ($env.GITHUB_TOKEN)' } + } else { + {} + } + http get -H $headers https://api.github.com/repos/nushell/nightly/releases | sort-by -r created_at | where tag_name =~ nightly | get assets.0.browser_download_url | where $it =~ 'msi'