Fix test infrastructure bugs: undefined function and missing quotes#466
Merged
Fix test infrastructure bugs: undefined function and missing quotes#466
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #456, #457
Two test infrastructure bugs:
1.
error_and_diedoes not exist in test context (#456)test/test_uninstall.shline 52 callserror_and_diewhich is not defined in the test framework. Changed toerror_and_proceedwhich 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.shline 33:[ -n ${TFENV_ROOT} ]always evaluates true even whenTFENV_ROOTis empty, because without quotes the shell sees[ -n ]which tests whether-nis 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.