test: skip tests for uninstalled shells when run locally (#1517)

This commit is contained in:
Edwin Kofler 2023-03-26 16:18:00 -07:00 committed by GitHub
parent 13c0e2fab0
commit 747a55fe4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 3 deletions

View File

@ -8,12 +8,16 @@ setup() {
export XDG_DATA_HOME=
export XDG_DATA_DIRS=
if ! command -v elvish &>/dev/null && [ -z "$GITHUB_ACTIONS" ]; then
skip 'Elvish not installed'
fi
local ver_major=
local ver_minor=
local ver_patch=
IFS='.' read -r ver_major ver_minor ver_patch <<<"$(elvish -version)"
if ((ver_major == 0 && ver_minor < 18)); then
if ((ver_major == 0 && ver_minor < 18)) && [ -z "$GITHUB_ACTIONS" ]; then
skip "Elvish version is not at least 0.18. Found ${ver_major}.${ver_minor}.${ver_patch}"
fi
}

View File

@ -6,7 +6,7 @@ load test_helpers
setup() {
cd "$(dirname "$BATS_TEST_DIRNAME")"
if ! command -v fish; then
if ! command -v fish &>/dev/null && [ -z "$GITHUB_ACTIONS" ]; then
skip "Fish is not installed"
fi
}

View File

@ -6,7 +6,7 @@ load test_helpers
setup() {
cd "$(dirname "$BATS_TEST_DIRNAME")"
if ! command -v nu; then
if ! command -v nu &>/dev/null && [ -z "$GITHUB_ACTIONS" ]; then
skip "Nu is not installed"
fi