diff options
author | Laszlo Csomor <laszlocsomor@google.com> | 2018-07-18 01:04:01 -0700 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-07-18 01:05:38 -0700 |
commit | 405fe6791445aa497772b6d4bb906fe5a6f15708 (patch) | |
tree | 65d214ba7f99598e2ee1cccab3c5541081de121c /src/test/shell | |
parent | 38fa8507198fd0ed8579d0ced1b1349a7dc54c53 (diff) |
bazel,tests: allow empty TMPDIR in test
Allow the `$TMPDIR` to be empty in
//src/test/shell/bazel:bazel_rules_test.
This used to be the case before commit
https://github.com/bazelbuild/bazel/commit/f814454ff5477418ca44696efb5c71339368efa4
Bazel only guarantees to set TMPDIR for locally
executed tests, but not (to my knowledge) for
remote execution.
Fixes https://github.com/bazelbuild/bazel/issues/5607
Change-Id: I2e97c13d137f94c7f668b7a6c7fc5020a19e4a0b
Closes #5610.
Change-Id: I2e97c13d137f94c7f668b7a6c7fc5020a19e4a0b
PiperOrigin-RevId: 205039105
Diffstat (limited to 'src/test/shell')
-rwxr-xr-x | src/test/shell/bazel/bazel_rules_test.sh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/test/shell/bazel/bazel_rules_test.sh b/src/test/shell/bazel/bazel_rules_test.sh index 2e17ee6357..ddbf7735ba 100755 --- a/src/test/shell/bazel/bazel_rules_test.sh +++ b/src/test/shell/bazel/bazel_rules_test.sh @@ -289,10 +289,10 @@ EOF fail "Could not create new temporary directory ${new_tmpdir}" export PATH="$PATH_TO_BAZEL_WRAPPER:/bin:/usr/bin:/random/path" if is_windows; then - local old_tmpdir="$TMP" + local old_tmpdir="${TMP:-}" export TMP="${new_tmpdir}" else - local old_tmpdir="$TMPDIR" + local old_tmpdir="${TMPDIR:-}" export TMPDIR="${new_tmpdir}" fi # shut down to force reload of the environment |