aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/shell/bazel/bazel_test_test.sh
diff options
context:
space:
mode:
authorGravatar Yue Gan <yueg@google.com>2016-12-20 09:46:39 +0000
committerGravatar Klaus Aehlig <aehlig@google.com>2016-12-20 11:06:52 +0000
commit87532156cf3ed7b66c6db5cb1e57dff7424031ab (patch)
tree1f503682598ac7101f3c612dbcebefe03f2cdde0 /src/test/shell/bazel/bazel_test_test.sh
parentd6297fb8b924dda41111356c0c32d4a5a297a11b (diff)
Gives detailed error message when fail to re-create directories during testing. Also
fixes bazel_test_test. Fixes #2228. -- PiperOrigin-RevId: 142532524 MOS_MIGRATED_REVID=142532524
Diffstat (limited to 'src/test/shell/bazel/bazel_test_test.sh')
-rwxr-xr-xsrc/test/shell/bazel/bazel_test_test.sh14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/test/shell/bazel/bazel_test_test.sh b/src/test/shell/bazel/bazel_test_test.sh
index fbd9bc966a..ed76164f74 100755
--- a/src/test/shell/bazel/bazel_test_test.sh
+++ b/src/test/shell/bazel/bazel_test_test.sh
@@ -80,8 +80,7 @@ function test_3_local_jobs() {
--runs_per_test=10 //dir:test
}
-# TODO(#2228): Re-enable when the tmpdir creation is fixed.
-function DISABLED_test_tmpdir() {
+function test_tmpdir() {
mkdir -p foo
cat > foo/bar_test.sh <<'EOF'
#!/bin/bash
@@ -107,14 +106,9 @@ EOF
# succeed. If we run it on OS X (or in general without sandboxing enabled),
# it will fail to create /foo/bar, since obviously we don't have write
# permissions.
- if bazel test --nocache_test_results --test_output=all \
- --test_tmpdir=/foo/bar //foo:bar_test >& $TEST_log; then
- # We are in a sandbox.
- expect_log "TEST_TMPDIR=/foo/bar"
- else
- # We are not sandboxed.
- expect_log "Could not create TEST_TMPDIR"
- fi
+ bazel test --nocache_test_results --test_output=all --test_tmpdir=/foo/bar \
+ //foo:bar_test >& $TEST_log && fail "Writing to no permission path should fail"
+ expect_log "Failed to recreate temporary directory"
}
function test_env_vars() {