Skip to content

Commit

Permalink
Remove shell legacy android tests
Browse files Browse the repository at this point in the history
This should help reduce overall CI time by reducing the number of tests.

Closes #20346.

PiperOrigin-RevId: 586095997
Change-Id: I66f60e87a59ec8bcc730b88f821af6a18a914d8d
  • Loading branch information
katre authored and copybara-github committed Nov 28, 2023
1 parent 31dc134 commit 18ac628
Show file tree
Hide file tree
Showing 17 changed files with 17 additions and 55 deletions.
10 changes: 0 additions & 10 deletions .bazelci/postsubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,8 @@ tasks:
# 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
Expand Down Expand Up @@ -88,10 +86,8 @@ tasks:
# 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
Expand Down Expand Up @@ -155,10 +151,8 @@ tasks:
# 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
Expand Down Expand Up @@ -209,10 +203,8 @@ tasks:
# 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
Expand Down Expand Up @@ -407,10 +399,8 @@ tasks:
# 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
Expand Down
10 changes: 0 additions & 10 deletions .bazelci/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,8 @@ tasks:
# 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
Expand Down Expand Up @@ -90,10 +88,8 @@ tasks:
# 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
Expand Down Expand Up @@ -158,10 +154,8 @@ tasks:
# 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
Expand Down Expand Up @@ -213,10 +207,8 @@ tasks:
# # 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
Expand Down Expand Up @@ -471,10 +463,8 @@ tasks:
# 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ source "${CURRENT_DIR}/android_helper.sh" \
|| { 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() {

Expand Down
2 changes: 1 addition & 1 deletion src/test/shell/bazel/android/aapt_integration_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ source "$(rlocation io_bazel/src/test/shell/integration_test_setup.sh)" \
# (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
Expand Down
2 changes: 1 addition & 1 deletion src/test/shell/bazel/android/aar_integration_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ fail_if_no_android_sdk
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() {
Expand Down
2 changes: 1 addition & 1 deletion src/test/shell/bazel/android/aidl_integration_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ fail_if_no_android_sdk
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
Expand Down
13 changes: 3 additions & 10 deletions src/test/shell/bazel/android/android_helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -111,16 +111,9 @@ function setup_head_android_tools_if_exists() {

# 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
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ source "${CURRENT_DIR}/../../integration_test_setup.sh" \
# (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
Expand Down
3 changes: 1 addition & 2 deletions src/test/shell/bazel/android/android_integration_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ fail_if_no_android_sdk
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
Expand Down Expand Up @@ -212,7 +212,6 @@ android_binary(
)
EOF
cat > MODULE.bazel << 'EOF'
# Required for android_integration_test_with_platforms
bazel_dep(name = "platforms", version = "0.0.7")
EOF

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ fail_if_no_android_sdk
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ fail_if_no_android_ndk
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ fail_if_no_android_sdk
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
Expand Down
12 changes: 1 addition & 11 deletions src/test/shell/bazel/android/android_sh_test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ CHECK_FOR_ANDROID_SDK = select(
)

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
Expand All @@ -47,24 +47,14 @@ def android_sh_test(create_test_with_released_tools = True, **kwargs):
# 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",
],
Expand Down
2 changes: 1 addition & 1 deletion src/test/shell/bazel/android/desugarer_integration_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ fail_if_no_android_sdk
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ fail_if_no_android_sdk
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.
Expand Down
2 changes: 1 addition & 1 deletion src/test/shell/bazel/android/proguard_integration_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ fail_if_no_android_sdk
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ fail_if_no_android_sdk
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
Expand Down

0 comments on commit 18ac628

Please sign in to comment.