From 93bea5b321f6d58cef2331647e4055487188070e Mon Sep 17 00:00:00 2001 From: Kurtis Rader Date: Mon, 19 Sep 2016 22:08:33 -0700 Subject: [PATCH] make unit tests more hermetic regarding env vars Specifically, the `TERM` and `ITERM_PROFILE` env vars. If we don't set them to known values the unit tests can fail in unexpected ways. Fixes #3395 --- tests/interactive.fish | 6 ++++++ tests/test.fish | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/tests/interactive.fish b/tests/interactive.fish index 8f386f8b7..cdb449c13 100644 --- a/tests/interactive.fish +++ b/tests/interactive.fish @@ -10,6 +10,12 @@ set TESTS_TO_RETRY bind.expect # Change to directory containing this script cd (dirname (status -f)) +# These env vars should not be inherited from the user environment because they can affect the +# behavior of the tests. So either remove them or set them to a known value. +# See also tests/test.fish. +set TERM xterm +set -e ITERM_PROFILE + # Test files specified on commandline, or all *.expect files if set -q argv[1] set files_to_test $argv.expect diff --git a/tests/test.fish b/tests/test.fish index 005968af3..f5741f29b 100644 --- a/tests/test.fish +++ b/tests/test.fish @@ -14,6 +14,12 @@ else set files_to_test *.in end +# These env vars should not be inherited from the user environment because they can affect the +# behavior of the tests. So either remove them or set them to a known value. +# See also tests/interactive.fish. +set TERM xterm +set -e ITERM_PROFILE + source test_util.fish (status -f) $argv; or exit say -o cyan "Testing high level script functionality"