From c1096fbc12d6608b77ec7fa0a9d513cf1ea1c157 Mon Sep 17 00:00:00 2001 From: Solomon Hykes Date: Thu, 10 Jun 2021 10:28:40 +0000 Subject: [PATCH] Fix infinite loop in universe tests Signed-off-by: Solomon Hykes --- stdlib/helpers.bash | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/stdlib/helpers.bash b/stdlib/helpers.bash index 584e88ec..76a7f46f 100644 --- a/stdlib/helpers.bash +++ b/stdlib/helpers.bash @@ -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" -} \ No newline at end of file +}