aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/shell
diff options
context:
space:
mode:
authorGravatar buchgr <buchgr@google.com>2017-09-01 13:14:19 +0200
committerGravatar Vladimir Moskva <vladmos@google.com>2017-09-01 15:28:54 +0200
commita659135bb1dd5a3e7000a0fb0979c235a54f6190 (patch)
tree563cf2efbacf97267fbd72de9fa31d651e5ba24c /src/test/shell
parent621c096ff76b898118f2033b3ac974d73e137ede (diff)
remote: Return exit code 34 for remote caching/execution errors.
For any errors that are due to failures in the remote caching / execution layers Bazel now returns exit code 34 (ExitCode.REMOTE_ERROR). This includes errors where the remote cache / executor is unreachable or crashes. It does not include errors if the test / build failure is due to user errors i.e. compilation or test failures. PiperOrigin-RevId: 167259236
Diffstat (limited to 'src/test/shell')
-rwxr-xr-xsrc/test/shell/bazel/remote_execution_test.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/test/shell/bazel/remote_execution_test.sh b/src/test/shell/bazel/remote_execution_test.sh
index 53463777b1..5dbbc90fc7 100755
--- a/src/test/shell/bazel/remote_execution_test.sh
+++ b/src/test/shell/bazel/remote_execution_test.sh
@@ -380,6 +380,25 @@ EOF
expect_log "TIMEOUT"
}
+function test_exitcode() {
+ mkdir -p a
+ cat > a/BUILD <<'EOF'
+genrule(
+ name = "foo",
+ srcs = [],
+ outs = ["foo.txt"],
+ cmd = "echo \"hello world\" > \"$@\"",
+)
+EOF
+
+ (set +e
+ bazel --host_jvm_args=-Dbazel.DigestFunction=SHA1 build \
+ --genrule_strategy=remote \
+ --remote_executor=bazel-test-does-not-exist \
+ //a:foo >& $TEST_log
+ [ $? -eq 34 ]) || fail "Test failed due to wrong exit code"
+}
+
# TODO(alpha): Add a test that fails remote execution when remote worker
# supports sandbox.