Fix infinite loop in universe tests

Signed-off-by: Solomon Hykes <solomon@dagger.io>
This commit is contained in:
Solomon Hykes 2021-06-10 10:28:40 +00:00 committed by Solomon Hykes
parent e5aa981c28
commit c1096fbc12

View File

@ -3,8 +3,9 @@ common_setup() {
load 'node_modules/bats-assert/load'
# Dagger Binary
DAGGER="${DAGGER_BINARY:-$(command -v dagger)}"
export DAGGER
# FIXME: `command -v` must be wrapped in a sub-bash,
# otherwise infinite recursion when DAGGER_BINARY is not set.
export DAGGER="${DAGGER_BINARY:-$(bash -c 'command -v dagger')}"
# Set the workspace to the universe directory (so tests can run from anywhere)
UNIVERSE="$( cd "$( dirname "$BATS_TEST_FILENAME" )" >/dev/null 2>&1 && pwd )"
@ -44,4 +45,4 @@ copy_to_sandbox() {
local target="$DAGGER_SANDBOX"/.dagger/env/"$name"
cp -a "$source" "$target"
}
}