From ebfe5724e7ea915963e39c80d81ed58cbc5e4c71 Mon Sep 17 00:00:00 2001 From: Thomas Piccirello Date: Wed, 18 Oct 2023 22:46:04 -0700 Subject: [PATCH] wip: debug tests --- tests/e2e/setup.sh | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/tests/e2e/setup.sh b/tests/e2e/setup.sh index e1b18a6d..d74897e4 100755 --- a/tests/e2e/setup.sh +++ b/tests/e2e/setup.sh @@ -4,6 +4,8 @@ set -euo pipefail TEST_NAME="setup file" TEST_CONFIG_DIR="./temp-config-dir" +export DOPPLER_PROJECT="" +export DOPPLER_CONFIG="" cleanup() { exit_code=$? @@ -93,14 +95,14 @@ set timeout 2 set has_failed "1" -spawn $DOPPLER_BINARY setup --config-dir=$TEST_CONFIG_DIR 2>/dev/null - -expect "Selected only available project: cli" - -expect "Selected only available config: e2e" +spawn $DOPPLER_BINARY setup --config-dir=$TEST_CONFIG_DIR expect { "NAME" { set has_failed "0" } + eof { + # The spawn command has completed, print the output + puts \$expect_out(buffer) + } } if { \$has_failed == "1" } { @@ -269,9 +271,9 @@ flags: update-check: false EOF "$DOPPLER_BINARY" setup --config-dir=$TEST_CONFIG_DIR --no-interactive -[[ "$("$DOPPLER_BINARY" configure flags get analytics --plain)" == 'false' ]] || error "ERROR: setup not setting disabled value for analytics" -[[ "$("$DOPPLER_BINARY" configure flags get env-warning --plain)" == 'false' ]] || error "ERROR: setup not setting disabled value for env-warning" -[[ "$("$DOPPLER_BINARY" configure flags get update-check --plain)" == 'false' ]] || error "ERROR: setup not setting disabled value for update-check" +[[ "$("$DOPPLER_BINARY" configure flags get analytics --config-dir=$TEST_CONFIG_DIR --plain)" == 'false' ]] || error "ERROR: setup not setting disabled value for analytics" +[[ "$("$DOPPLER_BINARY" configure flags get env-warning --config-dir=$TEST_CONFIG_DIR --plain)" == 'false' ]] || error "ERROR: setup not setting disabled value for env-warning" +[[ "$("$DOPPLER_BINARY" configure flags get update-check --config-dir=$TEST_CONFIG_DIR --plain)" == 'false' ]] || error "ERROR: setup not setting disabled value for update-check" afterEach