test: Do not run Nu test if it does not exist (#1423)

Co-authored-by: Trevor Brown <Stratus3D@users.noreply.github.com>
This commit is contained in:
Edwin Kofler 2023-01-06 06:43:15 -08:00 committed by GitHub
parent b21dc46d70
commit 035e247056
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 12 deletions

View File

@ -66,4 +66,3 @@ jobs:
run: bats test
env:
GITHUB_API_TOKEN: ${{ github.token }}
SKIP_NUSHELL_TESTS: "${{ matrix.os == 'ubuntu-18.04' && 'YES' }}"

View File

@ -3,10 +3,11 @@
load test_helpers
setup() {
if [ "${SKIP_NUSHELL_TESTS}" = 'YES' ]; then
skip "skipping nushell tests"
fi
cd $(dirname "$BATS_TEST_DIRNAME")
if ! command -v nu; then
skip "Nu is not installed"
fi
}
cleaned_path() {
@ -20,7 +21,7 @@ cleaned_path() {
let-env PATH = ( '$(cleaned_path)' | split row ':' )
let-env ASDF_NU_DIR = '$PWD'
source asdf.nu
source asdf.nu
echo \$env.ASDF_DIR
")
@ -37,9 +38,9 @@ cleaned_path() {
let-env PATH = ( '$(cleaned_path)' | split row ':' )
let-env ASDF_NU_DIR = '$PWD'
source asdf.nu
source asdf.nu
\$env.PATH | to text
")
[ "$?" -eq 0 ]
@ -56,8 +57,8 @@ cleaned_path() {
let-env PATH = ( '$(cleaned_path)' | split row ':' )
let-env ASDF_NU_DIR = '$PWD'
source asdf.nu
source asdf.nu
source asdf.nu
source asdf.nu
echo \$env.PATH
")
@ -73,7 +74,7 @@ cleaned_path() {
let-env PATH = ( '$(cleaned_path)' | split row ':' )
let-env ASDF_NU_DIR = '$PWD'
source asdf.nu
source asdf.nu
echo \$env.ASDF_DIR
")
@ -89,7 +90,7 @@ cleaned_path() {
let-env PATH = ( '$(cleaned_path)' | split row ':' )
let-env ASDF_NU_DIR = '$PWD'
source asdf.nu
source asdf.nu
which asdf | get path | to text
")
[ "$?" -eq 0 ]
@ -103,7 +104,7 @@ cleaned_path() {
let-env PATH = ( '$(cleaned_path)' | split row ':' )
let-env ASDF_NU_DIR = '$PWD'
source asdf.nu
source asdf.nu
asdf info
")
[ "$?" -eq 0 ]