Remove shell legacy android tests This should help reduce overall CI time by reducing the number of tests. Closes #20346. PiperOrigin-RevId: 586095997 Change-Id: I66f60e87a59ec8bcc730b88f821af6a18a914d8d
diff --git a/.bazelci/postsubmit.yml b/.bazelci/postsubmit.yml index 0ff4c51..3f31871 100644 --- a/.bazelci/postsubmit.yml +++ b/.bazelci/postsubmit.yml
@@ -47,10 +47,8 @@ # https://github.com/bazelbuild/bazel/issues/18776 - "-//src/test/shell/bazel/android:android_instrumentation_test_integration_test" - "-//src/test/shell/bazel/android:android_instrumentation_test_integration_test_with_head_android_tools" - - "-//src/test/shell/bazel/android:android_instrumentation_test_integration_test_with_platforms" - "-//src/test/shell/bazel/android:aapt_integration_test" - "-//src/test/shell/bazel/android:aapt_integration_test_with_head_android_tools" - - "-//src/test/shell/bazel/android:aapt_integration_test_with_platforms" include_json_profile: - build - test @@ -88,10 +86,8 @@ # https://github.com/bazelbuild/bazel/issues/18776 - "-//src/test/shell/bazel/android:android_instrumentation_test_integration_test" - "-//src/test/shell/bazel/android:android_instrumentation_test_integration_test_with_head_android_tools" - - "-//src/test/shell/bazel/android:android_instrumentation_test_integration_test_with_platforms" - "-//src/test/shell/bazel/android:aapt_integration_test" - "-//src/test/shell/bazel/android:aapt_integration_test_with_head_android_tools" - - "-//src/test/shell/bazel/android:aapt_integration_test_with_platforms" include_json_profile: - build - test @@ -155,10 +151,8 @@ # https://github.com/bazelbuild/bazel/issues/18776 - "-//src/test/shell/bazel/android:android_instrumentation_test_integration_test" - "-//src/test/shell/bazel/android:android_instrumentation_test_integration_test_with_head_android_tools" - - "-//src/test/shell/bazel/android:android_instrumentation_test_integration_test_with_platforms" - "-//src/test/shell/bazel/android:aapt_integration_test" - "-//src/test/shell/bazel/android:aapt_integration_test_with_head_android_tools" - - "-//src/test/shell/bazel/android:aapt_integration_test_with_platforms" include_json_profile: - build - test @@ -209,10 +203,8 @@ # https://github.com/bazelbuild/bazel/issues/18776 - "-//src/test/shell/bazel/android:android_instrumentation_test_integration_test" - "-//src/test/shell/bazel/android:android_instrumentation_test_integration_test_with_head_android_tools" - - "-//src/test/shell/bazel/android:android_instrumentation_test_integration_test_with_platforms" - "-//src/test/shell/bazel/android:aapt_integration_test" - "-//src/test/shell/bazel/android:aapt_integration_test_with_head_android_tools" - - "-//src/test/shell/bazel/android:aapt_integration_test_with_platforms" # https://github.com/bazelbuild/bazel/issues/17410 - "-//src/test/java/com/google/devtools/build/lib/platform:SystemMemoryPressureEventTest" # https://github.com/bazelbuild/bazel/issues/17411 @@ -407,10 +399,8 @@ # https://github.com/bazelbuild/bazel/issues/18776 - "-//src/test/shell/bazel/android:android_instrumentation_test_integration_test" - "-//src/test/shell/bazel/android:android_instrumentation_test_integration_test_with_head_android_tools" - - "-//src/test/shell/bazel/android:android_instrumentation_test_integration_test_with_platforms" - "-//src/test/shell/bazel/android:aapt_integration_test" - "-//src/test/shell/bazel/android:aapt_integration_test_with_head_android_tools" - - "-//src/test/shell/bazel/android:aapt_integration_test_with_platforms" include_json_profile: - build - test
diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index e10485c..745651a 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml
@@ -48,10 +48,8 @@ # https://github.com/bazelbuild/bazel/issues/18776 - "-//src/test/shell/bazel/android:android_instrumentation_test_integration_test" - "-//src/test/shell/bazel/android:android_instrumentation_test_integration_test_with_head_android_tools" - - "-//src/test/shell/bazel/android:android_instrumentation_test_integration_test_with_platforms" - "-//src/test/shell/bazel/android:aapt_integration_test" - "-//src/test/shell/bazel/android:aapt_integration_test_with_head_android_tools" - - "-//src/test/shell/bazel/android:aapt_integration_test_with_platforms" include_json_profile: - build - test @@ -90,10 +88,8 @@ # https://github.com/bazelbuild/bazel/issues/18776 - "-//src/test/shell/bazel/android:android_instrumentation_test_integration_test" - "-//src/test/shell/bazel/android:android_instrumentation_test_integration_test_with_head_android_tools" - - "-//src/test/shell/bazel/android:android_instrumentation_test_integration_test_with_platforms" - "-//src/test/shell/bazel/android:aapt_integration_test" - "-//src/test/shell/bazel/android:aapt_integration_test_with_head_android_tools" - - "-//src/test/shell/bazel/android:aapt_integration_test_with_platforms" include_json_profile: - build - test @@ -158,10 +154,8 @@ # https://github.com/bazelbuild/bazel/issues/18776 - "-//src/test/shell/bazel/android:android_instrumentation_test_integration_test" - "-//src/test/shell/bazel/android:android_instrumentation_test_integration_test_with_head_android_tools" - - "-//src/test/shell/bazel/android:android_instrumentation_test_integration_test_with_platforms" - "-//src/test/shell/bazel/android:aapt_integration_test" - "-//src/test/shell/bazel/android:aapt_integration_test_with_head_android_tools" - - "-//src/test/shell/bazel/android:aapt_integration_test_with_platforms" include_json_profile: - build - test @@ -213,10 +207,8 @@ # # https://github.com/bazelbuild/bazel/issues/18776 # - "-//src/test/shell/bazel/android:android_instrumentation_test_integration_test" # - "-//src/test/shell/bazel/android:android_instrumentation_test_integration_test_with_head_android_tools" - # - "-//src/test/shell/bazel/android:android_instrumentation_test_integration_test_with_platforms" # - "-//src/test/shell/bazel/android:aapt_integration_test" # - "-//src/test/shell/bazel/android:aapt_integration_test_with_head_android_tools" - # - "-//src/test/shell/bazel/android:aapt_integration_test_with_platforms" # # https://github.com/bazelbuild/bazel/issues/17410 # - "-//src/test/java/com/google/devtools/build/lib/platform:SystemMemoryPressureEventTest" # # https://github.com/bazelbuild/bazel/issues/17411 @@ -471,10 +463,8 @@ # https://github.com/bazelbuild/bazel/issues/18776 - "-//src/test/shell/bazel/android:android_instrumentation_test_integration_test" - "-//src/test/shell/bazel/android:android_instrumentation_test_integration_test_with_head_android_tools" - - "-//src/test/shell/bazel/android:android_instrumentation_test_integration_test_with_platforms" - "-//src/test/shell/bazel/android:aapt_integration_test" - "-//src/test/shell/bazel/android:aapt_integration_test_with_head_android_tools" - - "-//src/test/shell/bazel/android:aapt_integration_test_with_platforms" include_json_profile: - build - test
diff --git a/src/test/shell/bazel/android/DexFileSplitter_synthetic_classes_test.sh b/src/test/shell/bazel/android/DexFileSplitter_synthetic_classes_test.sh index 44c4a00..95a4e0d 100755 --- a/src/test/shell/bazel/android/DexFileSplitter_synthetic_classes_test.sh +++ b/src/test/shell/bazel/android/DexFileSplitter_synthetic_classes_test.sh
@@ -33,7 +33,7 @@ || { echo "android_helper.sh not found!" >&2; exit 1; } fail_if_no_android_sdk -resolve_android_toolchains "$1" +resolve_android_toolchains function create_test_app() {
diff --git a/src/test/shell/bazel/android/aapt_integration_test.sh b/src/test/shell/bazel/android/aapt_integration_test.sh index 9fc17f7..9132f3b 100755 --- a/src/test/shell/bazel/android/aapt_integration_test.sh +++ b/src/test/shell/bazel/android/aapt_integration_test.sh
@@ -46,7 +46,7 @@ # (bazelbuild/continuous-integration#578). add_to_bazelrc "build --incompatible_use_python_toolchains=false" -resolve_android_toolchains "$1" +resolve_android_toolchains function test_build_with_aapt2() { create_new_workspace
diff --git a/src/test/shell/bazel/android/aar_integration_test.sh b/src/test/shell/bazel/android/aar_integration_test.sh index 31025bb..e52bd77 100755 --- a/src/test/shell/bazel/android/aar_integration_test.sh +++ b/src/test/shell/bazel/android/aar_integration_test.sh
@@ -33,7 +33,7 @@ source "${CURRENT_DIR}/../../integration_test_setup.sh" \ || { echo "integration_test_setup.sh not found!" >&2; exit 1; } -resolve_android_toolchains "$1" +resolve_android_toolchains # Regression test for https://github.com/bazelbuild/bazel/issues/1928. function test_empty_tree_artifact_action_inputs_mount_empty_directories() {
diff --git a/src/test/shell/bazel/android/aidl_integration_test.sh b/src/test/shell/bazel/android/aidl_integration_test.sh index 41ae3db..6a35a48 100755 --- a/src/test/shell/bazel/android/aidl_integration_test.sh +++ b/src/test/shell/bazel/android/aidl_integration_test.sh
@@ -32,7 +32,7 @@ source "$(rlocation io_bazel/src/test/shell/integration_test_setup.sh)" \ || { echo "integration_test_setup.sh not found!" >&2; exit 1; } -resolve_android_toolchains "$1" +resolve_android_toolchains function test_simple_idl_srcs() { create_new_workspace
diff --git a/src/test/shell/bazel/android/android_helper.sh b/src/test/shell/bazel/android/android_helper.sh index 2cb7864..7d6341a 100755 --- a/src/test/shell/bazel/android/android_helper.sh +++ b/src/test/shell/bazel/android/android_helper.sh
@@ -111,16 +111,9 @@ # Resolves Android toolchains with platforms. function resolve_android_toolchains() { - if [[ "$1" = '--with_platforms' ]]; then - echo "This test uses platform-based Android toolchain resolution." - add_to_bazelrc "build --incompatible_enable_android_toolchain_resolution" - add_to_bazelrc "build --incompatible_enable_cc_toolchain_resolution" - add_to_bazelrc "build --android_platforms=//test_android_platforms:simple" - else - echo "This test uses legacy Android toolchains." - add_to_bazelrc "build --noincompatible_enable_android_toolchain_resolution" - add_to_bazelrc "build --noincompatible_enable_cc_toolchain_resolution" - fi + add_to_bazelrc "build --incompatible_enable_android_toolchain_resolution" + add_to_bazelrc "build --incompatible_enable_cc_toolchain_resolution" + add_to_bazelrc "build --android_platforms=//test_android_platforms:simple" } setup_head_android_tools_if_exists
diff --git a/src/test/shell/bazel/android/android_instrumentation_test_integration_test.sh b/src/test/shell/bazel/android/android_instrumentation_test_integration_test.sh index c10c21d..8d05fe9 100755 --- a/src/test/shell/bazel/android/android_instrumentation_test_integration_test.sh +++ b/src/test/shell/bazel/android/android_instrumentation_test_integration_test.sh
@@ -34,7 +34,7 @@ # (bazelbuild/continuous-integration#578). add_to_bazelrc "build --incompatible_use_python_toolchains=false" -resolve_android_toolchains "$1" +resolve_android_toolchains function setup_android_instrumentation_test_env() { mkdir -p java/com/bin/res/values
diff --git a/src/test/shell/bazel/android/android_integration_test.sh b/src/test/shell/bazel/android/android_integration_test.sh index b0ce851..8724afe 100755 --- a/src/test/shell/bazel/android/android_integration_test.sh +++ b/src/test/shell/bazel/android/android_integration_test.sh
@@ -33,7 +33,7 @@ source "${CURRENT_DIR}/../../integration_test_setup.sh" \ || { echo "integration_test_setup.sh not found!" >&2; exit 1; } -resolve_android_toolchains "$1" +resolve_android_toolchains function test_sdk_library_deps() { create_new_workspace @@ -212,7 +212,6 @@ ) EOF cat > MODULE.bazel << 'EOF' -# Required for android_integration_test_with_platforms bazel_dep(name = "platforms", version = "0.0.7") EOF
diff --git a/src/test/shell/bazel/android/android_local_test_integration_test.sh b/src/test/shell/bazel/android/android_local_test_integration_test.sh index 0c5cf55..fb91c52 100755 --- a/src/test/shell/bazel/android/android_local_test_integration_test.sh +++ b/src/test/shell/bazel/android/android_local_test_integration_test.sh
@@ -34,7 +34,7 @@ source "${CURRENT_DIR}/../../integration_test_setup.sh" \ || { echo "integration_test_setup.sh not found!" >&2; exit 1; } -resolve_android_toolchains "$1" +resolve_android_toolchains function setup_android_local_test_env() { mkdir -p java/com/bin/res/values
diff --git a/src/test/shell/bazel/android/android_ndk_integration_test.sh b/src/test/shell/bazel/android/android_ndk_integration_test.sh index 15f2590..6eda46c 100755 --- a/src/test/shell/bazel/android/android_ndk_integration_test.sh +++ b/src/test/shell/bazel/android/android_ndk_integration_test.sh
@@ -38,7 +38,7 @@ source "${CURRENT_DIR}/../../integration_test_setup.sh" \ || { echo "integration_test_setup.sh not found!" >&2; exit 1; } -resolve_android_toolchains $1 +resolve_android_toolchains function create_android_binary() { mkdir -p java/bazel
diff --git a/src/test/shell/bazel/android/android_sdk_integration_test.sh b/src/test/shell/bazel/android/android_sdk_integration_test.sh index 3b83268..2e44190 100755 --- a/src/test/shell/bazel/android/android_sdk_integration_test.sh +++ b/src/test/shell/bazel/android/android_sdk_integration_test.sh
@@ -33,7 +33,7 @@ source "${CURRENT_DIR}/../../integration_test_setup.sh" \ || { echo "integration_test_setup.sh not found!" >&2; exit 1; } -resolve_android_toolchains "$1" +resolve_android_toolchains function test_android_sdk_repository_path_from_environment() { create_new_workspace
diff --git a/src/test/shell/bazel/android/android_sh_test.bzl b/src/test/shell/bazel/android/android_sh_test.bzl index 426fc9c..6638906 100644 --- a/src/test/shell/bazel/android/android_sh_test.bzl +++ b/src/test/shell/bazel/android/android_sh_test.bzl
@@ -30,7 +30,7 @@ ) def android_sh_test(create_test_with_released_tools = True, **kwargs): - """Creates versions of the test with and without platforms and head android tools. + """Creates versions of the test with and without head android tools. Args: create_test_with_released_tools: Whether to create a version of the test with the released @@ -47,24 +47,14 @@ # Test with released android_tools version. native.sh_test( name = name, - args = ["--without_platforms"], data = data, **kwargs ) - # Test with platform-based toolchain resolution. - native.sh_test( - name = name + "_with_platforms", - data = data, - args = ["--with_platforms"], - **kwargs - ) - # Test with android_tools version that's built at the same revision # as the test itself. native.sh_test( name = name + "_with_head_android_tools", - args = ["--without_platforms"], data = data + [ "//tools/android/runtime_deps:android_tools.tar", ],
diff --git a/src/test/shell/bazel/android/desugarer_integration_test.sh b/src/test/shell/bazel/android/desugarer_integration_test.sh index fa25ace..87ded51 100755 --- a/src/test/shell/bazel/android/desugarer_integration_test.sh +++ b/src/test/shell/bazel/android/desugarer_integration_test.sh
@@ -38,7 +38,7 @@ source "$(rlocation io_bazel/src/test/shell/integration_test_setup.sh)" \ || { echo "integration_test_setup.sh not found!" >&2; exit 1; } -resolve_android_toolchains "$1" +resolve_android_toolchains function create_java_8_android_binary() { mkdir -p java/bazel
diff --git a/src/test/shell/bazel/android/library_desugarer_integration_test.sh b/src/test/shell/bazel/android/library_desugarer_integration_test.sh index ce8bfca..b8b5000 100755 --- a/src/test/shell/bazel/android/library_desugarer_integration_test.sh +++ b/src/test/shell/bazel/android/library_desugarer_integration_test.sh
@@ -38,7 +38,7 @@ source "$(rlocation io_bazel/src/test/shell/integration_test_setup.sh)" \ || { echo "integration_test_setup.sh not found!" >&2; exit 1; } -resolve_android_toolchains "$1" +resolve_android_toolchains function test_library_desugar_lib_builds() { # TODO(b/299338002): Move this to the main desugarer test suite.
diff --git a/src/test/shell/bazel/android/proguard_integration_test.sh b/src/test/shell/bazel/android/proguard_integration_test.sh index 8a322e3..869589d 100755 --- a/src/test/shell/bazel/android/proguard_integration_test.sh +++ b/src/test/shell/bazel/android/proguard_integration_test.sh
@@ -38,7 +38,7 @@ source "$(rlocation io_bazel/src/test/shell/integration_test_setup.sh)" \ || { echo "integration_test_setup.sh not found!" >&2; exit 1; } -resolve_android_toolchains "$1" +resolve_android_toolchains function test_proguard() { create_new_workspace
diff --git a/src/test/shell/bazel/android/resource_processing_integration_test.sh b/src/test/shell/bazel/android/resource_processing_integration_test.sh index 18fef25..d4d2f08 100755 --- a/src/test/shell/bazel/android/resource_processing_integration_test.sh +++ b/src/test/shell/bazel/android/resource_processing_integration_test.sh
@@ -38,7 +38,7 @@ source "$(rlocation io_bazel/src/test/shell/integration_test_setup.sh)" \ || { echo "integration_test_setup.sh not found!" >&2; exit 1; } -resolve_android_toolchains "$1" +resolve_android_toolchains function setup_font_resources() { rm java/bazel/BUILD