diff options
author | 2018-04-16 01:53:31 -0700 | |
---|---|---|
committer | 2018-04-16 01:55:46 -0700 | |
commit | b1280de531bdda44d31f3cd9fbe2a2bb5e69cf2c (patch) | |
tree | 01de0672b3a566fd08c9dbc0157a7397dfea46a8 /src/test/shell | |
parent | d309d5706ad88b9ceb7768e02afc69630c39d158 (diff) |
Remove old name for --repository_cache
The flag --experimental_repository_cache has been renamed to --repository_cache
(with the old name still usable for some releases). Adapt the shell tests to
use the preferred name of that flag.
Change-Id: I88ba70d386d5e8bb1bb60bcac58b2f1cc325ff17
PiperOrigin-RevId: 193003482
Diffstat (limited to 'src/test/shell')
-rwxr-xr-x | src/test/shell/bazel/bazel_repository_cache_test.sh | 48 | ||||
-rwxr-xr-x | src/test/shell/bazel/external_integration_test.sh | 8 |
2 files changed, 28 insertions, 28 deletions
diff --git a/src/test/shell/bazel/bazel_repository_cache_test.sh b/src/test/shell/bazel/bazel_repository_cache_test.sh index d074cad64a..5b3995d1f8 100755 --- a/src/test/shell/bazel/bazel_repository_cache_test.sh +++ b/src/test/shell/bazel/bazel_repository_cache_test.sh @@ -214,7 +214,7 @@ function assert_files_same() { function test_build() { setup_repository - bazel run --experimental_repository_cache="$repo_cache_dir" //zoo:breeding-program >& $TEST_log \ + bazel run --repository_cache="$repo_cache_dir" //zoo:breeding-program >& $TEST_log \ || echo "Expected build/run to succeed" expect_log $what_does_the_fox_say } @@ -222,7 +222,7 @@ function test_build() { function test_fetch() { setup_repository - bazel fetch --experimental_repository_cache="$repo_cache_dir" //zoo:breeding-program >& $TEST_log \ + bazel fetch --repository_cache="$repo_cache_dir" //zoo:breeding-program >& $TEST_log \ || echo "Expected fetch to succeed" expect_log "All external dependencies fetched successfully" } @@ -230,7 +230,7 @@ function test_fetch() { function test_directory_structure() { setup_repository - bazel fetch --experimental_repository_cache="$repo_cache_dir" //zoo:breeding-program >& $TEST_log \ + bazel fetch --repository_cache="$repo_cache_dir" //zoo:breeding-program >& $TEST_log \ || echo "Expected fetch to succeed" if [ ! -d $repo_cache_dir/content_addressable/sha256/ ]; then fail "repository cache directories were not created" @@ -240,7 +240,7 @@ function test_directory_structure() { function test_cache_entry_exists() { setup_repository - bazel fetch --experimental_repository_cache="$repo_cache_dir" //zoo:breeding-program >& $TEST_log \ + bazel fetch --repository_cache="$repo_cache_dir" //zoo:breeding-program >& $TEST_log \ || echo "Expected fetch to succeed" if [ ! -f $repo_cache_dir/content_addressable/sha256/$sha256/file ]; then fail "the file was not cached successfully" @@ -257,7 +257,7 @@ function test_fetch_value_with_existing_cache_and_no_network() { # Fetch without a server shutdown_server - bazel fetch --experimental_repository_cache="$repo_cache_dir" //zoo:breeding-program >& $TEST_log \ + bazel fetch --repository_cache="$repo_cache_dir" //zoo:breeding-program >& $TEST_log \ || echo "Expected fetch to succeed" expect_log "All external dependencies fetched successfully" @@ -267,7 +267,7 @@ function test_fetch_value_with_existing_cache_and_no_network() { function test_load_cached_value() { setup_repository - bazel fetch --experimental_repository_cache="$repo_cache_dir" //zoo:breeding-program >& $TEST_log \ + bazel fetch --repository_cache="$repo_cache_dir" //zoo:breeding-program >& $TEST_log \ || echo "Expected fetch to succeed" # Kill the server @@ -275,7 +275,7 @@ function test_load_cached_value() { bazel clean --expunge # Fetch again - bazel fetch --experimental_repository_cache="$repo_cache_dir" //zoo:breeding-program >& $TEST_log \ + bazel fetch --repository_cache="$repo_cache_dir" //zoo:breeding-program >& $TEST_log \ || echo "Expected fetch to succeed" expect_log "All external dependencies fetched successfully" @@ -284,7 +284,7 @@ function test_load_cached_value() { function test_failed_fetch_without_cache() { setup_repository - bazel fetch --experimental_repository_cache="$repo_cache_dir" //zoo:breeding-program >& $TEST_log \ + bazel fetch --repository_cache="$repo_cache_dir" //zoo:breeding-program >& $TEST_log \ || echo "Expected fetch to succeed" # Kill the server and reset state @@ -295,7 +295,7 @@ function test_failed_fetch_without_cache() { rm -rf "$repo_cache_dir" # Attempt to fetch again - bazel fetch --experimental_repository_cache="$repo_cache_dir" //zoo:breeding-program >& $TEST_log \ + bazel fetch --repository_cache="$repo_cache_dir" //zoo:breeding-program >& $TEST_log \ && echo "Expected fetch to fail" expect_log "Error downloading" @@ -312,7 +312,7 @@ def _impl(repository_ctx): repo = repository_rule(implementation=_impl, local=False) EOF - bazel fetch --experimental_repository_cache="$repo_cache_dir" @foo//:all >& $TEST_log \ + bazel fetch --repository_cache="$repo_cache_dir" @foo//:all >& $TEST_log \ || echo "Expected fetch to succeed" if [ ! -f $repo_cache_dir/content_addressable/sha256/$zip_sha256/file ]; then @@ -331,7 +331,7 @@ def _impl(repository_ctx): repo = repository_rule(implementation=_impl, local=False) EOF - bazel fetch --experimental_repository_cache="$repo_cache_dir" @foo//:all >& $TEST_log \ + bazel fetch --repository_cache="$repo_cache_dir" @foo//:all >& $TEST_log \ || echo "Expected fetch to succeed" if [ ! -f $repo_cache_dir/content_addressable/sha256/$zip_sha256/file ]; then @@ -350,7 +350,7 @@ def _impl(repository_ctx): repo = repository_rule(implementation=_impl, local=False) EOF - bazel fetch --experimental_repository_cache="$repo_cache_dir" @foo//:all >& $TEST_log \ + bazel fetch --repository_cache="$repo_cache_dir" @foo//:all >& $TEST_log \ || echo "Expected fetch to succeed" # Kill the server @@ -358,7 +358,7 @@ EOF bazel clean --expunge # Fetch again - bazel fetch --experimental_repository_cache="$repo_cache_dir" @foo//:all >& $TEST_log \ + bazel fetch --repository_cache="$repo_cache_dir" @foo//:all >& $TEST_log \ || echo "Expected fetch to succeed" expect_log "All external dependencies fetched successfully" @@ -375,7 +375,7 @@ def _impl(repository_ctx): repo = repository_rule(implementation=_impl, local=False) EOF - bazel fetch --experimental_repository_cache="$repo_cache_dir" @foo//:all >& $TEST_log \ + bazel fetch --repository_cache="$repo_cache_dir" @foo//:all >& $TEST_log \ || echo "Expected fetch to succeed" # Kill the server @@ -386,7 +386,7 @@ EOF rm -rf "$repo_cache_dir" # Fetch again - bazel fetch --experimental_repository_cache="$repo_cache_dir" @foo//:all >& $TEST_log \ + bazel fetch --repository_cache="$repo_cache_dir" @foo//:all >& $TEST_log \ && echo "Expected fetch to fail" expect_log "Error downloading" @@ -403,7 +403,7 @@ def _impl(repository_ctx): repo = repository_rule(implementation=_impl, local=False) EOF - bazel fetch --experimental_repository_cache="$repo_cache_dir" @foo//:all >& $TEST_log \ + bazel fetch --repository_cache="$repo_cache_dir" @foo//:all >& $TEST_log \ || echo "Expected fetch to succeed" # Kill the server @@ -411,7 +411,7 @@ EOF bazel clean --expunge # Fetch again - bazel fetch --experimental_repository_cache="$repo_cache_dir" @foo//:all >& $TEST_log \ + bazel fetch --repository_cache="$repo_cache_dir" @foo//:all >& $TEST_log \ || echo "Expected fetch to succeed" expect_log "All external dependencies fetched successfully" @@ -428,7 +428,7 @@ def _impl(repository_ctx): repo = repository_rule(implementation=_impl, local=False) EOF - bazel fetch --experimental_repository_cache="$repo_cache_dir" @foo//:all >& $TEST_log \ + bazel fetch --repository_cache="$repo_cache_dir" @foo//:all >& $TEST_log \ || echo "Expected fetch to succeed" # Kill the server @@ -439,7 +439,7 @@ EOF rm -rf "$repo_cache_dir" # Fetch again - bazel fetch --experimental_repository_cache="$repo_cache_dir" @foo//:all >& $TEST_log \ + bazel fetch --repository_cache="$repo_cache_dir" @foo//:all >& $TEST_log \ && echo "Expected fetch to fail" expect_log "Error downloading" @@ -448,7 +448,7 @@ EOF function test_maven_jar_exists_in_cache() { setup_maven_repository - bazel fetch --experimental_repository_cache="$repo_cache_dir" //zoo:ball-pit >& $TEST_log \ + bazel fetch --repository_cache="$repo_cache_dir" //zoo:ball-pit >& $TEST_log \ || echo "Expected fetch to succeed" if [ ! -f $repo_cache_dir/content_addressable/sha1/$sha1/file ]; then @@ -459,7 +459,7 @@ function test_maven_jar_exists_in_cache() { function test_load_cached_value_maven_jar() { setup_maven_repository - bazel fetch --experimental_repository_cache="$repo_cache_dir" //zoo:ball-pit >& $TEST_log \ + bazel fetch --repository_cache="$repo_cache_dir" //zoo:ball-pit >& $TEST_log \ || echo "Expected fetch to succeed" # Kill the server @@ -467,7 +467,7 @@ function test_load_cached_value_maven_jar() { bazel clean --expunge # Fetch again - bazel fetch --experimental_repository_cache="$repo_cache_dir" //zoo:ball-pit >& $TEST_log \ + bazel fetch --repository_cache="$repo_cache_dir" //zoo:ball-pit >& $TEST_log \ || echo "Expected fetch to succeed" expect_log "All external dependencies fetched successfully" @@ -476,7 +476,7 @@ function test_load_cached_value_maven_jar() { function test_maven_jar_fail_without_cache() { setup_maven_repository - bazel fetch --experimental_repository_cache="$repo_cache_dir" //zoo:ball-pit >& $TEST_log \ + bazel fetch --repository_cache="$repo_cache_dir" //zoo:ball-pit >& $TEST_log \ || echo "Expected fetch to succeed" # Kill the server @@ -487,7 +487,7 @@ function test_maven_jar_fail_without_cache() { rm -rf "$repo_cache_dir" # Fetch again - bazel fetch --experimental_repository_cache="$repo_cache_dir" //zoo:ball-pit >& $TEST_log \ + bazel fetch --repository_cache="$repo_cache_dir" //zoo:ball-pit >& $TEST_log \ && echo "Expected fetch to fail" expect_log "Failed to fetch Maven dependency" diff --git a/src/test/shell/bazel/external_integration_test.sh b/src/test/shell/bazel/external_integration_test.sh index e948e14754..6557f851f3 100755 --- a/src/test/shell/bazel/external_integration_test.sh +++ b/src/test/shell/bazel/external_integration_test.sh @@ -1243,7 +1243,7 @@ EOF } function test_repository_cache() { - # Verify that --experimental_repository_cache works for query and caches soly + # Verify that --repository_cache works for query and caches soly # based on the predicted hash. WRKDIR=$(mktemp -d "${TEST_TMPDIR}/testXXXXXX") cd "${WRKDIR}" @@ -1282,7 +1282,7 @@ http_archive( ) EOF # Use the external repository once to make sure it is cached. - bazel build --experimental_repository_cache="${TOPDIR}/cache}" '@ext//:bar' \ + bazel build --repository_cache="${TOPDIR}/cache}" '@ext//:bar' \ || fail "expected sucess" # Now "go offline" and clean local resources. @@ -1292,7 +1292,7 @@ EOF # The value should still be available from the repository cache bazel query 'deps("@ext//:bar")' \ - --experimental_repository_cache="${TOPDIR}/cache}" > "${TEST_log}" \ + --repository_cache="${TOPDIR}/cache}" > "${TEST_log}" \ || fail "Expected success" expect_log '@ext//:foo' @@ -1310,7 +1310,7 @@ http_archive( ) EOF bazel query 'deps("@ext//:bar")' \ - --experimental_repository_cache="${TOPDIR}/cache}" > "${TEST_log}" \ + --repository_cache="${TOPDIR}/cache}" > "${TEST_log}" \ || fail "Expected success" expect_log '@ext//:foo' } |