Skip to content

Fix test infrastructure bugs: undefined function and missing quotes#466

Merged
Zordrak merged 1 commit intomasterfrom
fix/456-457-test-bugs
Apr 24, 2026
Merged

Fix test infrastructure bugs: undefined function and missing quotes#466
Zordrak merged 1 commit intomasterfrom
fix/456-457-test-bugs

Conversation

@Zordrak
Copy link
Copy Markdown
Collaborator

@Zordrak Zordrak commented Apr 24, 2026

Fixes #456, #457

Two test infrastructure bugs:

1. error_and_die does not exist in test context (#456)

test/test_uninstall.sh line 52 calls error_and_die which is not defined in the test framework. Changed to error_and_proceed which is the correct test helper (logs the failure and increments the error counter for summary reporting).

2. Missing quotes around ${TFENV_ROOT} (#457)

test/test_common.sh line 33: [ -n ${TFENV_ROOT} ] always evaluates true even when TFENV_ROOT is empty, because without quotes the shell sees [ -n ] which tests whether -n is non-empty (it is). Added quotes: [ -n "${TFENV_ROOT}" ].

Testing

  • ./test/run.sh test_uninstall.sh — all tests pass on Linux, including the previously broken cleanup path.

Fix #456: Replace error_and_die with error_and_proceed in
test_uninstall.sh. error_and_die does not exist in the test context,
causing a "command not found" error that masks the actual test result.

Fix #457: Add missing quotes around ${TFENV_ROOT} in test_common.sh
line 33. Without quotes, [ -n ${TFENV_ROOT} ] always evaluates true
even when TFENV_ROOT is empty, because the shell sees [ -n ] which
tests whether the string "-n" is non-empty.
@Zordrak Zordrak merged commit 343ed7b into master Apr 24, 2026
5 checks passed
@Zordrak Zordrak deleted the fix/456-457-test-bugs branch April 24, 2026 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: test_uninstall.sh calls undefined error_and_die function

1 participant