aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/shell
diff options
context:
space:
mode:
authorGravatar ccalvarin <ccalvarin@google.com>2017-12-11 15:19:04 -0800
committerGravatar Copybara-Service <copybara-piper@google.com>2017-12-11 15:20:45 -0800
commit66693e77d0df7ab3ea1f4e8a3b7b66fabbc2af77 (patch)
tree3195ab0d6e7372d0f214cfa4b6065b91e6159549 /src/test/shell
parent34ba7026907cfae4abfc0be2851edb48c3ee2701 (diff)
Automated rollback of commit 9321316b34767b06c3071b2cf2a4de189874fcce.
*** Reason for rollback *** Design change, 2 boolean flags instead of 1 enum flag *** Original change description *** Add --incremental_state_retention_strategy This option is intended to replace some of the uses of --batch. It lets users specify that builds should not be incremental, and how eagerly to discard the state that is kept around for incrementality. Note that for both values discard_eargerly and keep_for_life_of_build, the build graph is kept around until the next build. This may change. Will add tests for keep_for_life_of_build in a later change, for now it will warn that that feature is experimen... *** ROLLBACK_OF=178661777 RELNOTES: None. PiperOrigin-RevId: 178681472
Diffstat (limited to 'src/test/shell')
-rw-r--r--src/test/shell/integration/discard_graph_edges_lib.sh2
-rwxr-xr-xsrc/test/shell/integration/discard_graph_edges_test.sh54
2 files changed, 27 insertions, 29 deletions
diff --git a/src/test/shell/integration/discard_graph_edges_lib.sh b/src/test/shell/integration/discard_graph_edges_lib.sh
index e7f97f9bbc..683b96b4dd 100644
--- a/src/test/shell/integration/discard_graph_edges_lib.sh
+++ b/src/test/shell/integration/discard_graph_edges_lib.sh
@@ -17,7 +17,7 @@
# discard_graph_edges_lib.sh: functions needed by discard_graph_edges_test.sh
STARTUP_FLAGS="--batch"
-BUILD_FLAGS="--discard_analysis_cache --incremental_state_retention_strategy=discard_eagerly"
+BUILD_FLAGS="--discard_analysis_cache --nokeep_incrementality_data"
function extract_histogram_count() {
local histofile="$1"
diff --git a/src/test/shell/integration/discard_graph_edges_test.sh b/src/test/shell/integration/discard_graph_edges_test.sh
index dd806725bc..4b0311c6a7 100755
--- a/src/test/shell/integration/discard_graph_edges_test.sh
+++ b/src/test/shell/integration/discard_graph_edges_test.sh
@@ -334,22 +334,21 @@ EOF
# The following tests are not expected to exercise codepath -- make sure nothing bad happens.
function test_no_batch() {
- bazel $STARTUP_FLAGS --nobatch test $BUILD_FLAGS \
- --incremental_state_retention_strategy=keep_forever //testing:mytest \
- >& "$TEST_log" || fail "Expected success"
+ bazel $STARTUP_FLAGS --nobatch test $BUILD_FLAGS --keep_incrementality_data \
+ //testing:mytest >& "$TEST_log" || fail "Expected success"
}
function test_no_discard_analysis_cache() {
bazel $STARTUP_FLAGS test $BUILD_FLAGS --nodiscard_analysis_cache \
- --incremental_state_retention_strategy=keep_forever //testing:mytest \
- >& "$TEST_log" || fail "Expected success"
+ --keep_incrementality_data //testing:mytest >& "$TEST_log" \
+ || fail "Expected success"
}
function test_packages_cleared_nobatch() {
readonly local old_startup_flags="$STARTUP_FLAGS"
STARTUP_FLAGS="--nobatch"
readonly local old_build_flags="$BUILD_FLAGS"
- BUILD_FLAGS="--incremental_state_retention_strategy=discard_eagerly --discard_analysis_cache"
+ BUILD_FLAGS="--nokeep_incrementality_data --discard_analysis_cache"
test_packages_cleared
STARTUP_FLAGS="$old_startup_flags"
BUILD_FLAGS="$old_build_flags"
@@ -357,7 +356,7 @@ function test_packages_cleared_nobatch() {
function test_packages_cleared_implicit_noincrementality_data() {
readonly local old_build_flags="$BUILD_FLAGS"
- BUILD_FLAGS="$BUILD_FLAGS --incremental_state_retention_strategy=keep_forever"
+ BUILD_FLAGS="$BUILD_FLAGS --keep_incrementality_data"
test_packages_cleared
BUILD_FLAGS="$old_build_flags"
}
@@ -366,22 +365,22 @@ function test_actions_deleted_after_execution_nobatch_keep_analysis () {
readonly local old_startup_flags="$STARTUP_FLAGS"
STARTUP_FLAGS="--nobatch"
readonly local old_build_flags="$BUILD_FLAGS"
- BUILD_FLAGS="--incremental_state_retention_strategy=discard_eagerly"
+ BUILD_FLAGS="--nokeep_incrementality_data"
test_actions_deleted_after_execution
STARTUP_FLAGS="$old_startup_flags"
BUILD_FLAGS="$old_build_flags"
}
function test_dump_after_discard_incrementality_data() {
- bazel build --incremental_state_retention_strategy=discard_eagerly \
- //testing:mytest >& "$TEST_log" || fail "Expected success"
+ bazel build --nokeep_incrementality_data //testing:mytest >& "$TEST_log" \
+ || fail "Expected success"
bazel dump --skyframe=detailed >& "$TEST_log" || fail "Expected success"
expect_log "//testing:mytest"
}
function test_query_after_discard_incrementality_data() {
- bazel build --nobuild --incremental_state_retention_strategy=discard_eagerly \
- //testing:mytest >& "$TEST_log" || fail "Expected success"
+ bazel build --nobuild --nokeep_incrementality_data //testing:mytest \
+ >& "$TEST_log" || fail "Expected success"
bazel query --noexperimental_ui --output=label_kind //testing:mytest \
>& "$TEST_log" || fail "Expected success"
expect_log "Loading package: testing"
@@ -391,8 +390,8 @@ function test_query_after_discard_incrementality_data() {
function test_shutdown_after_discard_incrementality_data() {
readonly local server_pid="$(bazel info server_pid 2> /dev/null)"
[[ -z "$server_pid" ]] && fail "Couldn't get server pid"
- bazel build --nobuild --incremental_state_retention_strategy=discard_eagerly \
- //testing:mytest >& "$TEST_log" || fail "Expected success"
+ bazel build --nobuild --nokeep_incrementality_data //testing:mytest \
+ >& "$TEST_log" || fail "Expected success"
bazel shutdown || fail "Expected success"
readonly local new_server_pid="$(bazel info server_pid 2> /dev/null)"
[[ "$server_pid" != "$new_server_pid" ]] \
@@ -400,22 +399,20 @@ function test_shutdown_after_discard_incrementality_data() {
}
function test_clean_after_discard_incrementality_data() {
- bazel build --nobuild --incremental_state_retention_strategy=discard_eagerly \
- //testing:mytest >& "$TEST_log" || fail "Expected success"
+ bazel build --nobuild --nokeep_incrementality_data //testing:mytest \
+ >& "$TEST_log" || fail "Expected success"
bazel clean >& "$TEST_log" || fail "Expected success"
}
function test_switch_back_and_forth() {
readonly local server_pid="$(bazel info \
- --incremental_state_retention_strategy=discard_eagerly server_pid 2> /dev/null)"
+ --nokeep_incrementality_data server_pid 2> /dev/null)"
[[ -z "$server_pid" ]] && fail "Couldn't get server pid"
- bazel test --noexperimental_ui \
- --incremental_state_retention_strategy=discard_eagerly //testing:mytest \
- >& "$TEST_log" || fail "Expected success"
+ bazel test --noexperimental_ui --nokeep_incrementality_data \
+ //testing:mytest >& "$TEST_log" || fail "Expected success"
expect_log "Loading package: testing"
- bazel test --noexperimental_ui \
- --incremental_state_retention_strategy=discard_eagerly //testing:mytest \
- >& "$TEST_log" || fail "Expected success"
+ bazel test --noexperimental_ui --nokeep_incrementality_data \
+ //testing:mytest >& "$TEST_log" || fail "Expected success"
expect_log "Loading package: testing"
bazel test --noexperimental_ui //testing:mytest >& "$TEST_log" \
|| fail "Expected success"
@@ -423,9 +420,8 @@ function test_switch_back_and_forth() {
bazel test --noexperimental_ui //testing:mytest >& "$TEST_log" \
|| fail "Expected success"
expect_not_log "Loading package: testing"
- bazel test --noexperimental_ui \
- --incremental_state_retention_strategy=discard_eagerly //testing:mytest \
- >& "$TEST_log" || fail "Expected success"
+ bazel test --noexperimental_ui --nokeep_incrementality_data \
+ //testing:mytest >& "$TEST_log" || fail "Expected success"
expect_log "Loading package: testing"
readonly local new_server_pid="$(bazel info server_pid 2> /dev/null)"
[[ "$server_pid" == "$new_server_pid" ]] \
@@ -435,8 +431,10 @@ function test_switch_back_and_forth() {
function test_warns_on_unexpected_combos() {
bazel --batch build --nobuild --discard_analysis_cache >& "$TEST_log" \
|| fail "Expected success"
- expect_log \
- "--batch and --discard_analysis_cache specified, but --incremental_state_retention_strategy not set to discard_eagerly"
+ expect_log "--batch and --discard_analysis_cache specified, but --nokeep_incrementality_data not specified"
+ bazel build --nobuild --discard_analysis_cache --nokeep_incrementality_data \
+ >& "$TEST_log" || fail "Expected success"
+ expect_log "--batch not specified with --nokeep_incrementality_data"
}
run_suite "test for --discard_graph_edges"