aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/shell
diff options
context:
space:
mode:
authorGravatar ccalvarin <ccalvarin@google.com>2017-12-11 13:11:42 -0800
committerGravatar Copybara-Service <copybara-piper@google.com>2017-12-11 13:13:02 -0800
commit9321316b34767b06c3071b2cf2a4de189874fcce (patch)
tree07c08416848b33941d65b2bdbacbb3320a968534 /src/test/shell
parent5a3c7ab1ea9adcdf93b2cb5018a48cc5538c7368 (diff)
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 experimental. RELNOTES: --[no]keep_incrementality_data is gone, replaced by the enum-valued --incremental_state_retention_strategy PiperOrigin-RevId: 178661777
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, 29 insertions, 27 deletions
diff --git a/src/test/shell/integration/discard_graph_edges_lib.sh b/src/test/shell/integration/discard_graph_edges_lib.sh
index 683b96b4dd..e7f97f9bbc 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 --nokeep_incrementality_data"
+BUILD_FLAGS="--discard_analysis_cache --incremental_state_retention_strategy=discard_eagerly"
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 4b0311c6a7..dd806725bc 100755
--- a/src/test/shell/integration/discard_graph_edges_test.sh
+++ b/src/test/shell/integration/discard_graph_edges_test.sh
@@ -334,21 +334,22 @@ 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 --keep_incrementality_data \
- //testing:mytest >& "$TEST_log" || fail "Expected success"
+ bazel $STARTUP_FLAGS --nobatch test $BUILD_FLAGS \
+ --incremental_state_retention_strategy=keep_forever //testing:mytest \
+ >& "$TEST_log" || fail "Expected success"
}
function test_no_discard_analysis_cache() {
bazel $STARTUP_FLAGS test $BUILD_FLAGS --nodiscard_analysis_cache \
- --keep_incrementality_data //testing:mytest >& "$TEST_log" \
- || fail "Expected success"
+ --incremental_state_retention_strategy=keep_forever //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="--nokeep_incrementality_data --discard_analysis_cache"
+ BUILD_FLAGS="--incremental_state_retention_strategy=discard_eagerly --discard_analysis_cache"
test_packages_cleared
STARTUP_FLAGS="$old_startup_flags"
BUILD_FLAGS="$old_build_flags"
@@ -356,7 +357,7 @@ function test_packages_cleared_nobatch() {
function test_packages_cleared_implicit_noincrementality_data() {
readonly local old_build_flags="$BUILD_FLAGS"
- BUILD_FLAGS="$BUILD_FLAGS --keep_incrementality_data"
+ BUILD_FLAGS="$BUILD_FLAGS --incremental_state_retention_strategy=keep_forever"
test_packages_cleared
BUILD_FLAGS="$old_build_flags"
}
@@ -365,22 +366,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="--nokeep_incrementality_data"
+ BUILD_FLAGS="--incremental_state_retention_strategy=discard_eagerly"
test_actions_deleted_after_execution
STARTUP_FLAGS="$old_startup_flags"
BUILD_FLAGS="$old_build_flags"
}
function test_dump_after_discard_incrementality_data() {
- bazel build --nokeep_incrementality_data //testing:mytest >& "$TEST_log" \
- || fail "Expected success"
+ bazel build --incremental_state_retention_strategy=discard_eagerly \
+ //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 --nokeep_incrementality_data //testing:mytest \
- >& "$TEST_log" || fail "Expected success"
+ bazel build --nobuild --incremental_state_retention_strategy=discard_eagerly \
+ //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"
@@ -390,8 +391,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 --nokeep_incrementality_data //testing:mytest \
- >& "$TEST_log" || fail "Expected success"
+ bazel build --nobuild --incremental_state_retention_strategy=discard_eagerly \
+ //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" ]] \
@@ -399,20 +400,22 @@ function test_shutdown_after_discard_incrementality_data() {
}
function test_clean_after_discard_incrementality_data() {
- bazel build --nobuild --nokeep_incrementality_data //testing:mytest \
- >& "$TEST_log" || fail "Expected success"
+ bazel build --nobuild --incremental_state_retention_strategy=discard_eagerly \
+ //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 \
- --nokeep_incrementality_data server_pid 2> /dev/null)"
+ --incremental_state_retention_strategy=discard_eagerly server_pid 2> /dev/null)"
[[ -z "$server_pid" ]] && fail "Couldn't get server pid"
- bazel test --noexperimental_ui --nokeep_incrementality_data \
- //testing:mytest >& "$TEST_log" || fail "Expected success"
+ bazel test --noexperimental_ui \
+ --incremental_state_retention_strategy=discard_eagerly //testing:mytest \
+ >& "$TEST_log" || fail "Expected success"
expect_log "Loading package: testing"
- bazel test --noexperimental_ui --nokeep_incrementality_data \
- //testing:mytest >& "$TEST_log" || fail "Expected success"
+ bazel test --noexperimental_ui \
+ --incremental_state_retention_strategy=discard_eagerly //testing:mytest \
+ >& "$TEST_log" || fail "Expected success"
expect_log "Loading package: testing"
bazel test --noexperimental_ui //testing:mytest >& "$TEST_log" \
|| fail "Expected success"
@@ -420,8 +423,9 @@ 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 --nokeep_incrementality_data \
- //testing:mytest >& "$TEST_log" || fail "Expected success"
+ bazel test --noexperimental_ui \
+ --incremental_state_retention_strategy=discard_eagerly //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" ]] \
@@ -431,10 +435,8 @@ 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 --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"
+ expect_log \
+ "--batch and --discard_analysis_cache specified, but --incremental_state_retention_strategy not set to discard_eagerly"
}
run_suite "test for --discard_graph_edges"