aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Klaus Aehlig <aehlig@google.com>2017-10-16 17:37:44 +0200
committerGravatar Jakob Buchgraber <buchgr@google.com>2017-10-18 10:09:57 +0200
commit30f219bb4599630bc9efa28401cb16625907b1c7 (patch)
tree610bd03c2c2b02635e18435c3f8d54eba90cb963 /src
parentbc1cdd311da5aec80b805a4486421392cf2c999e (diff)
Make tests more independent of default values
Some tests depend on the target pattern evaluation strategy used. Make them specify the target pattern evaluator they need. Same, if the tests depend on a particular human-readable output stream. While there, also increase shard count for the bazel_repository_cache_test to speed it up. RELNOTES: None PiperOrigin-RevId: 172328801
Diffstat (limited to 'src')
-rw-r--r--src/test/shell/bazel/BUILD1
-rwxr-xr-xsrc/test/shell/bazel/bazel_repository_cache_test.sh4
-rwxr-xr-xsrc/test/shell/bazel/bazel_test_test.sh9
-rwxr-xr-xsrc/test/shell/bazel/local_repository_test.sh2
4 files changed, 12 insertions, 4 deletions
diff --git a/src/test/shell/bazel/BUILD b/src/test/shell/bazel/BUILD
index b0b963b629..10e53ef9c3 100644
--- a/src/test/shell/bazel/BUILD
+++ b/src/test/shell/bazel/BUILD
@@ -437,6 +437,7 @@ sh_test(
size = "large",
srcs = ["bazel_repository_cache_test.sh"],
data = [":test-deps"],
+ shard_count = 4,
)
sh_test(
diff --git a/src/test/shell/bazel/bazel_repository_cache_test.sh b/src/test/shell/bazel/bazel_repository_cache_test.sh
index 1427817b1b..d074cad64a 100755
--- a/src/test/shell/bazel/bazel_repository_cache_test.sh
+++ b/src/test/shell/bazel/bazel_repository_cache_test.sh
@@ -26,6 +26,10 @@ source "${CURRENT_DIR}/remote_helpers.sh" \
function set_up() {
bazel clean --expunge >& $TEST_log
repo_cache_dir=$TEST_TMPDIR/repository_cache
+ # TODO(b/37617303): make test UI-independent
+ add_to_bazelrc "fetch --noexperimental_ui"
+ add_to_bazelrc "build --noexperimental_ui"
+ add_to_bazelrc "build --noexperimental_skyframe_target_pattern_evaluator"
}
function tear_down() {
diff --git a/src/test/shell/bazel/bazel_test_test.sh b/src/test/shell/bazel/bazel_test_test.sh
index b7051798db..e89062a7d9 100755
--- a/src/test/shell/bazel/bazel_test_test.sh
+++ b/src/test/shell/bazel/bazel_test_test.sh
@@ -484,7 +484,8 @@ EOF
chmod +x true.sh flaky.sh false.sh
# We do not use sandboxing so we can trick to be deterministically flaky
- bazel --nomaster_bazelrc test --spawn_strategy=standalone //:flaky &> $TEST_log \
+ # TODO(b/37617303): make test UI-independent
+ bazel --nomaster_bazelrc test --noexperimental_ui --noexperimental_skyframe_target_pattern_evaluator --spawn_strategy=standalone //:flaky &> $TEST_log \
|| fail "//:flaky should have passed with flaky support"
[ -f "${FLAKE_FILE}" ] || fail "Flaky test should have created the flake-file!"
@@ -497,7 +498,8 @@ EOF
cat bazel-testlogs/flaky/test.log &> $TEST_log
assert_equals "pass" "$(tail -1 bazel-testlogs/flaky/test.log)"
- bazel --nomaster_bazelrc test //:pass &> $TEST_log \
+ # TODO(b/37617303): make test UI-independent
+ bazel --nomaster_bazelrc test --noexperimental_ui --noexperimental_skyframe_target_pattern_evaluator //:pass &> $TEST_log \
|| fail "//:pass should have passed"
expect_log_once "PASS: //:pass"
expect_log_once PASSED
@@ -506,7 +508,8 @@ EOF
cat bazel-testlogs/flaky/test.log &> $TEST_log
assert_equals "pass" "$(tail -1 bazel-testlogs/flaky/test.log)"
- bazel --nomaster_bazelrc test //:fail &> $TEST_log \
+ # TODO(b/37617303): make test UI-independent
+ bazel --nomaster_bazelrc test --noexperimental_ui --noexperimental_skyframe_target_pattern_evaluator //:fail &> $TEST_log \
&& fail "//:fail should have failed" \
|| true
expect_log_n "FAIL: //:fail (.*/fail/test_attempts/attempt_..log)" 2
diff --git a/src/test/shell/bazel/local_repository_test.sh b/src/test/shell/bazel/local_repository_test.sh
index 24b759e2d2..7bff2d8693 100755
--- a/src/test/shell/bazel/local_repository_test.sh
+++ b/src/test/shell/bazel/local_repository_test.sh
@@ -961,7 +961,7 @@ local_repository(
)
EOF
- bazel build @r/a//:bin &> $TEST_log && fail "expected build failure, but succeeded"
+ bazel build --noexperimental_skyframe_target_pattern_evaluator @r/a//:bin &> $TEST_log && fail "expected build failure, but succeeded"
expect_log "workspace names may contain only A-Z, a-z, 0-9, '-', '_' and '.'"
}