From 27ac6b6e71571783bbf9c6dee08cb00ca6155a32 Mon Sep 17 00:00:00 2001 From: Googler Date: Tue, 21 Nov 2023 08:08:52 -0800 Subject: [PATCH 01/11] Disable macOS jobs for Bazel presubmit PiperOrigin-RevId: 584328821 Change-Id: I995570340c3b1c28741fc41ba9658f3b148b44b9 --- .bazelci/presubmit.yml | 346 ++++++++++++++++++++--------------------- 1 file changed, 173 insertions(+), 173 deletions(-) diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index 7d24c739659aca..e10485c194e2b3 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -165,179 +165,179 @@ tasks: include_json_profile: - build - test - macos: - shards: 5 - shell_commands: - - sed -i.bak -e 's/^# android_sdk_repository/android_sdk_repository/' -e 's/^# - android_ndk_repository/android_ndk_repository/' WORKSPACE.bzlmod - - rm -f WORKSPACE.bzlmod.bak - - rm -rf $HOME/bazeltest - - mkdir $HOME/bazeltest - - ln -sf $OUTPUT_BASE/external $HOME/bazeltest/external - build_flags: - - "--config=ci-macos" - build_targets: - - "//src:bazel" - - "//src:bazel_jdk_minimal" - - "//src:test_repos" - - "//src/main/java/..." - test_flags: - - "--config=ci-macos" - # Fine tune the number of test jobs running in parallel to avoid timeout - - "--local_test_jobs=8" - test_targets: - - "//scripts/..." - - "//src/main/starlark/tests/builtins_bzl/..." - - "//src/test/..." - - "//src/tools/execlog/..." - - "//src/tools/singlejar/..." - - "//src/tools/workspacelog/..." - - "//third_party/ijar/..." - - "//tools/android/..." - - "//tools/aquery_differ/..." - - "//tools/python/..." - - "//tools/bash/..." - # Re-enable once fixed: https://github.com/bazelbuild/bazel/issues/8162 - - "-//src/java_tools/buildjar/..." - - "-//src/java_tools/import_deps_checker/..." - # C++ coverage is not supported on macOS yet. - - "-//src/test/shell/bazel:bazel_cc_code_coverage_test" - # MacOS does not have cgroups so it can't support hardened sandbox - - "-//src/test/shell/integration:bazel_hardened_sandboxed_worker_test" - # https://github.com/bazelbuild/bazel/issues/16526 - - "-//src/test/shell/bazel:starlark_repository_test" - # https://github.com/bazelbuild/bazel/issues/17407 - - "-//src/test/shell/bazel/apple:bazel_apple_test" - # https://github.com/bazelbuild/bazel/issues/17408 - - "-//src/test/shell/bazel/apple:bazel_objc_test" - # 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 - - "-//src/test/java/com/google/devtools/build/lib/blackbox/tests/workspace:PatchApiBlackBoxTest" - # https://github.com/bazelbuild/bazel/issues/17447 - - "-//src/test/java/com/google/devtools/build/lib/blackbox/tests/workspace:GitRepositoryBlackBoxTest" - # https://github.com/bazelbuild/bazel/issues/17456 - - "-//src/test/shell/bazel:bazel_determinism_test" - # https://github.com/bazelbuild/bazel/issues/17457 - - "-//src/test/shell/bazel:jdeps_test" - include_json_profile: - - build - - test - macos_arm64: - shards: 2 - shell_commands: - - sed -i.bak -e 's/^# android_sdk_repository/android_sdk_repository/' -e 's/^# - android_ndk_repository/android_ndk_repository/' WORKSPACE.bzlmod - - rm -f WORKSPACE.bzlmod.bak - - rm -rf $HOME/bazeltest - - mkdir $HOME/bazeltest - - ln -sf $OUTPUT_BASE/external $HOME/bazeltest/external - build_flags: - - "--config=ci-macos" - build_targets: - - "//src:bazel" - - "//src:bazel_jdk_minimal" - - "//src:test_repos" - - "//src/main/java/..." - test_flags: - - "--config=ci-macos" - test_targets: - - "//scripts/..." - - "//src/main/starlark/tests/builtins_bzl/..." - - "//src/test/..." - - "//src/tools/execlog/..." - - "//src/tools/singlejar/..." - - "//src/tools/workspacelog/..." - - "//third_party/ijar/..." - - "//tools/android/..." - - "//tools/aquery_differ/..." - - "//tools/python/..." - - "//tools/bash/..." - # Re-enable once fixed: https://github.com/bazelbuild/bazel/issues/8162 - - "-//src/java_tools/buildjar/..." - - "-//src/java_tools/import_deps_checker/..." - # C++ coverage is not supported on macOS yet. - - "-//src/test/shell/bazel:bazel_cc_code_coverage_test" - # MacOS does not have cgroups so it can't support hardened sandbox - - "-//src/test/shell/integration:bazel_hardened_sandboxed_worker_test" - # https://github.com/bazelbuild/bazel/issues/16521 & https://github.com/bazelbuild/bazel/issues/18776 - - "-//src/test/shell/bazel/android/..." - - "-//src/tools/android/java/com/google/devtools/build/android/..." - - "-//src/test/java/com/google/devtools/build/android/dexer:AllTests" - # https://github.com/bazelbuild/bazel/issues/16525 - - "-//src/test/java/com/google/devtools/build/lib/buildtool:KeepGoingTest" - - "-//src/test/java/com/google/devtools/build/lib/buildtool:DanglingSymlinkTest" - - "-//src/test/java/com/google/devtools/build/lib/buildtool:CompileOneDependencyIntegrationTest" - - "-//src/test/java/com/google/devtools/build/lib/buildtool:SkymeldBuildIntegrationTest" - - "-//src/test/java/com/google/devtools/build/lib/rules/objc:BazelJ2ObjcLibraryTest" - - "-//src/test/java/com/google/devtools/build/lib/skyframe/rewinding:RewindingTest" - - "-//src/test/java/com/google/devtools/build/lib/buildtool:MiscAnalysisTest" - - "-//src/test/java/com/google/devtools/build/lib/rules/objc:ObjcRulesTests" - # https://github.com/bazelbuild/bazel/issues/17007 - - "-//src/test/java/com/google/devtools/build/lib/platform:SystemMemoryPressureEventTest" - # Disable the most time-consuming tests on macOS arm64 platform in presubmit. - # To run any of the following test in presubmit, just comment out the corresponding line. - # TODO(pcloudy): Re-enable when Apple Silicon machine waiting time is no longer the major - # bottleneck for presubmit. - - "-//src/test/shell/bazel:bazel_determinism_test" - - "-//src/test/shell/bazel:jdeps_test" - - "-//src/test/shell/bazel:starlark_git_repository_test" - - "-//src/test/shell/bazel:bazel_bootstrap_distfile_tar_test" - - "-//src/test/shell/integration:bazel_json_worker_test" - - "-//src/test/py/bazel:runfiles_test" - - "-//src/test/py/bazel:launcher_test" - - "-//src/test/py/bazel:bazel_module_test" - - "-//src/test/shell/bazel:bazel_java_test_jdk11_toolchain_head" - - "-//src/test/shell/integration:target_compatible_with_test" - - "-//src/test/py/bazel:py_test" - - "-//src/test/py/bazel:bzlmod_query_test" - - "-//src/test/py/bazel:cc_import_test" - - "-//src/test/shell/bazel/remote:build_without_the_bytes_test" - - "-//src/test/shell/bazel:bazel_coverage_java_test" - - "-//src/test/py/bazel:bazel_yanked_versions_test" - - "-//src/test/shell/bazel:bazel_coverage_java_jdk17_toolchain_head_test" - - "-//src/test/shell/bazel:bazel_proto_library_test" - - "-//src/test/shell/bazel:bazel_java_tools_test" - - "-//src/test/shell/integration:build_event_stream_test" - - "-//src/test/py/bazel:bazel_overrides_test" - - "-//src/test/shell/bazel:cc_integration_test" - - "-//src/test/shell/bazel:bazel_java_test" - - "-//src/test/java/com/google/devtools/build/lib/rules/config:ConfigRulesTests" - - "-//src/test/shell/bazel:bazel_java_test_jdk17_toolchain_head" - - "-//src/test/shell/integration:bazel_worker_test" - - "-//src/test/shell/bazel:tags_propagation_native_test" - - "-//src/test/shell/bazel:bazel_coverage_java_jdk11_toolchain_head_test" - - "-//src/test/shell/integration:bazel_sandboxed_worker_test" - - "-//src/test/py/bazel:bazel_repo_mapping_test" - - "-//src/test/shell/bazel:bazel_coverage_java_jdk11_toolchain_released_test" - - "-//src/test/py/bazel:bazel_workspace_test" - - "-//src/test/shell/bazel:execroot_test" - - "-//src/test/shell/bazel:starlark_repository_test" - - "-//src/test/shell/bazel:bazel_coverage_java_jdk17_toolchain_released_test" - - "-//src/test/shell/bazel/remote:remote_execution_test" - - "-//src/test/shell/integration:toolchain_test" - - "-//src/test/shell/bazel:bazel_test_test" - - "-//src/test/shell/integration:test_test" - - "-//src/test/shell/bazel:bazel_execlog_test" - - "-//src/test/shell/integration:modify_execution_info_test" - - "-//src/test/shell/bazel:external_integration_test" - - "-//src/test/py/bazel:bazel_external_repository_test" - - "-//src/test/shell/bazel:bazel_workspaces_test" - - "-//src/test/shell/integration:client_test" - - "-//src/test/shell/bazel:workspace_resolved_test" - - "-//src/test/shell/bazel:bazel_repository_cache_test" - - "-//src/test/shell/integration:aquery_test" - - "-//src/test/shell/integration:py_args_escaping_test" - include_json_profile: - - build - - test + # macos: + # shards: 5 + # shell_commands: + # - sed -i.bak -e 's/^# android_sdk_repository/android_sdk_repository/' -e 's/^# + # android_ndk_repository/android_ndk_repository/' WORKSPACE.bzlmod + # - rm -f WORKSPACE.bzlmod.bak + # - rm -rf $HOME/bazeltest + # - mkdir $HOME/bazeltest + # - ln -sf $OUTPUT_BASE/external $HOME/bazeltest/external + # build_flags: + # - "--config=ci-macos" + # build_targets: + # - "//src:bazel" + # - "//src:bazel_jdk_minimal" + # - "//src:test_repos" + # - "//src/main/java/..." + # test_flags: + # - "--config=ci-macos" + # # Fine tune the number of test jobs running in parallel to avoid timeout + # - "--local_test_jobs=8" + # test_targets: + # - "//scripts/..." + # - "//src/main/starlark/tests/builtins_bzl/..." + # - "//src/test/..." + # - "//src/tools/execlog/..." + # - "//src/tools/singlejar/..." + # - "//src/tools/workspacelog/..." + # - "//third_party/ijar/..." + # - "//tools/android/..." + # - "//tools/aquery_differ/..." + # - "//tools/python/..." + # - "//tools/bash/..." + # # Re-enable once fixed: https://github.com/bazelbuild/bazel/issues/8162 + # - "-//src/java_tools/buildjar/..." + # - "-//src/java_tools/import_deps_checker/..." + # # C++ coverage is not supported on macOS yet. + # - "-//src/test/shell/bazel:bazel_cc_code_coverage_test" + # # MacOS does not have cgroups so it can't support hardened sandbox + # - "-//src/test/shell/integration:bazel_hardened_sandboxed_worker_test" + # # https://github.com/bazelbuild/bazel/issues/16526 + # - "-//src/test/shell/bazel:starlark_repository_test" + # # https://github.com/bazelbuild/bazel/issues/17407 + # - "-//src/test/shell/bazel/apple:bazel_apple_test" + # # https://github.com/bazelbuild/bazel/issues/17408 + # - "-//src/test/shell/bazel/apple:bazel_objc_test" + # # 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 + # - "-//src/test/java/com/google/devtools/build/lib/blackbox/tests/workspace:PatchApiBlackBoxTest" + # # https://github.com/bazelbuild/bazel/issues/17447 + # - "-//src/test/java/com/google/devtools/build/lib/blackbox/tests/workspace:GitRepositoryBlackBoxTest" + # # https://github.com/bazelbuild/bazel/issues/17456 + # - "-//src/test/shell/bazel:bazel_determinism_test" + # # https://github.com/bazelbuild/bazel/issues/17457 + # - "-//src/test/shell/bazel:jdeps_test" + # include_json_profile: + # - build + # - test + # macos_arm64: + # shards: 2 + # shell_commands: + # - sed -i.bak -e 's/^# android_sdk_repository/android_sdk_repository/' -e 's/^# + # android_ndk_repository/android_ndk_repository/' WORKSPACE.bzlmod + # - rm -f WORKSPACE.bzlmod.bak + # - rm -rf $HOME/bazeltest + # - mkdir $HOME/bazeltest + # - ln -sf $OUTPUT_BASE/external $HOME/bazeltest/external + # build_flags: + # - "--config=ci-macos" + # build_targets: + # - "//src:bazel" + # - "//src:bazel_jdk_minimal" + # - "//src:test_repos" + # - "//src/main/java/..." + # test_flags: + # - "--config=ci-macos" + # test_targets: + # - "//scripts/..." + # - "//src/main/starlark/tests/builtins_bzl/..." + # - "//src/test/..." + # - "//src/tools/execlog/..." + # - "//src/tools/singlejar/..." + # - "//src/tools/workspacelog/..." + # - "//third_party/ijar/..." + # - "//tools/android/..." + # - "//tools/aquery_differ/..." + # - "//tools/python/..." + # - "//tools/bash/..." + # # Re-enable once fixed: https://github.com/bazelbuild/bazel/issues/8162 + # - "-//src/java_tools/buildjar/..." + # - "-//src/java_tools/import_deps_checker/..." + # # C++ coverage is not supported on macOS yet. + # - "-//src/test/shell/bazel:bazel_cc_code_coverage_test" + # # MacOS does not have cgroups so it can't support hardened sandbox + # - "-//src/test/shell/integration:bazel_hardened_sandboxed_worker_test" + # # https://github.com/bazelbuild/bazel/issues/16521 & https://github.com/bazelbuild/bazel/issues/18776 + # - "-//src/test/shell/bazel/android/..." + # - "-//src/tools/android/java/com/google/devtools/build/android/..." + # - "-//src/test/java/com/google/devtools/build/android/dexer:AllTests" + # # https://github.com/bazelbuild/bazel/issues/16525 + # - "-//src/test/java/com/google/devtools/build/lib/buildtool:KeepGoingTest" + # - "-//src/test/java/com/google/devtools/build/lib/buildtool:DanglingSymlinkTest" + # - "-//src/test/java/com/google/devtools/build/lib/buildtool:CompileOneDependencyIntegrationTest" + # - "-//src/test/java/com/google/devtools/build/lib/buildtool:SkymeldBuildIntegrationTest" + # - "-//src/test/java/com/google/devtools/build/lib/rules/objc:BazelJ2ObjcLibraryTest" + # - "-//src/test/java/com/google/devtools/build/lib/skyframe/rewinding:RewindingTest" + # - "-//src/test/java/com/google/devtools/build/lib/buildtool:MiscAnalysisTest" + # - "-//src/test/java/com/google/devtools/build/lib/rules/objc:ObjcRulesTests" + # # https://github.com/bazelbuild/bazel/issues/17007 + # - "-//src/test/java/com/google/devtools/build/lib/platform:SystemMemoryPressureEventTest" + # # Disable the most time-consuming tests on macOS arm64 platform in presubmit. + # # To run any of the following test in presubmit, just comment out the corresponding line. + # # TODO(pcloudy): Re-enable when Apple Silicon machine waiting time is no longer the major + # # bottleneck for presubmit. + # - "-//src/test/shell/bazel:bazel_determinism_test" + # - "-//src/test/shell/bazel:jdeps_test" + # - "-//src/test/shell/bazel:starlark_git_repository_test" + # - "-//src/test/shell/bazel:bazel_bootstrap_distfile_tar_test" + # - "-//src/test/shell/integration:bazel_json_worker_test" + # - "-//src/test/py/bazel:runfiles_test" + # - "-//src/test/py/bazel:launcher_test" + # - "-//src/test/py/bazel:bazel_module_test" + # - "-//src/test/shell/bazel:bazel_java_test_jdk11_toolchain_head" + # - "-//src/test/shell/integration:target_compatible_with_test" + # - "-//src/test/py/bazel:py_test" + # - "-//src/test/py/bazel:bzlmod_query_test" + # - "-//src/test/py/bazel:cc_import_test" + # - "-//src/test/shell/bazel/remote:build_without_the_bytes_test" + # - "-//src/test/shell/bazel:bazel_coverage_java_test" + # - "-//src/test/py/bazel:bazel_yanked_versions_test" + # - "-//src/test/shell/bazel:bazel_coverage_java_jdk17_toolchain_head_test" + # - "-//src/test/shell/bazel:bazel_proto_library_test" + # - "-//src/test/shell/bazel:bazel_java_tools_test" + # - "-//src/test/shell/integration:build_event_stream_test" + # - "-//src/test/py/bazel:bazel_overrides_test" + # - "-//src/test/shell/bazel:cc_integration_test" + # - "-//src/test/shell/bazel:bazel_java_test" + # - "-//src/test/java/com/google/devtools/build/lib/rules/config:ConfigRulesTests" + # - "-//src/test/shell/bazel:bazel_java_test_jdk17_toolchain_head" + # - "-//src/test/shell/integration:bazel_worker_test" + # - "-//src/test/shell/bazel:tags_propagation_native_test" + # - "-//src/test/shell/bazel:bazel_coverage_java_jdk11_toolchain_head_test" + # - "-//src/test/shell/integration:bazel_sandboxed_worker_test" + # - "-//src/test/py/bazel:bazel_repo_mapping_test" + # - "-//src/test/shell/bazel:bazel_coverage_java_jdk11_toolchain_released_test" + # - "-//src/test/py/bazel:bazel_workspace_test" + # - "-//src/test/shell/bazel:execroot_test" + # - "-//src/test/shell/bazel:starlark_repository_test" + # - "-//src/test/shell/bazel:bazel_coverage_java_jdk17_toolchain_released_test" + # - "-//src/test/shell/bazel/remote:remote_execution_test" + # - "-//src/test/shell/integration:toolchain_test" + # - "-//src/test/shell/bazel:bazel_test_test" + # - "-//src/test/shell/integration:test_test" + # - "-//src/test/shell/bazel:bazel_execlog_test" + # - "-//src/test/shell/integration:modify_execution_info_test" + # - "-//src/test/shell/bazel:external_integration_test" + # - "-//src/test/py/bazel:bazel_external_repository_test" + # - "-//src/test/shell/bazel:bazel_workspaces_test" + # - "-//src/test/shell/integration:client_test" + # - "-//src/test/shell/bazel:workspace_resolved_test" + # - "-//src/test/shell/bazel:bazel_repository_cache_test" + # - "-//src/test/shell/integration:aquery_test" + # - "-//src/test/shell/integration:py_args_escaping_test" + # include_json_profile: + # - build + # - test windows: shards: 4 setup: From b652cdf98d0444fb9c96f564664211d93cf55153 Mon Sep 17 00:00:00 2001 From: Googler Date: Wed, 22 Nov 2023 04:13:01 -0800 Subject: [PATCH 02/11] Disable //src/test/shell/bazel:jdeps_test on RBE build to fix presubmit Related https://github.com/bazelbuild/bazel/issues/20288 PiperOrigin-RevId: 584584636 Change-Id: Iea064efe8d6caf9e60daf32e5408c325524685ca --- .bazelci/presubmit.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index e10485c194e2b3..2b610589e0f61b 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -475,6 +475,8 @@ tasks: - "-//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/20288 + - "-//src/test/shell/bazel:jdeps_test" include_json_profile: - build - test From 9a0bffb36b00ab57c273260305ef3c79f953de0b Mon Sep 17 00:00:00 2001 From: Googler Date: Thu, 23 Nov 2023 00:54:53 -0800 Subject: [PATCH 03/11] Automated rollback of commit 01f620599c6138de4b4551da92917148ab18efe3. *** Reason for rollback *** Fix jdeps_test RBE failure The culprit change added a new class that presumably pushed us over the xargs arg limit. Unfortunately, jdeps does not support @argfile, so this change updates the command buffer size to twice the default on RBE. Fixes https://github.com/bazelbuild/bazel/issues/20288 *** Original change description *** Disable //src/test/shell/bazel:jdeps_test on RBE build to fix presubmit Related https://github.com/bazelbuild/bazel/issues/20288 PiperOrigin-RevId: 584820138 Change-Id: I6f5157d7e72c539a5fdc81841a35543df473aa4a --- .bazelci/presubmit.yml | 2 -- src/test/shell/bazel/jdeps_test.sh | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index 2b610589e0f61b..e10485c194e2b3 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -475,8 +475,6 @@ tasks: - "-//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/20288 - - "-//src/test/shell/bazel:jdeps_test" include_json_profile: - build - test diff --git a/src/test/shell/bazel/jdeps_test.sh b/src/test/shell/bazel/jdeps_test.sh index 98513409df9929..2776ebee9c4c88 100755 --- a/src/test/shell/bazel/jdeps_test.sh +++ b/src/test/shell/bazel/jdeps_test.sh @@ -72,7 +72,7 @@ function test_jdeps() { # src/test/shell/bazel/jdeps_class_denylist.txt. find . -type f -iname \*class | \ grep -vFf "$denylist" | \ - xargs ../jdk/reduced/bin/jdeps --list-reduced-deps --ignore-missing-deps | \ + xargs -s 262144 ../jdk/reduced/bin/jdeps --list-reduced-deps --ignore-missing-deps | \ grep -v "unnamed module" > ../jdeps \ || fail "Failed to run jdeps on non denylisted class files." cd .. From baf5f62aef5c0874a820b0ea97e54adb469fa738 Mon Sep 17 00:00:00 2001 From: John Cater Date: Tue, 28 Nov 2023 13:58:57 -0800 Subject: [PATCH 04/11] 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 --- .bazelci/postsubmit.yml | 10 ---------- .bazelci/presubmit.yml | 10 ---------- .../DexFileSplitter_synthetic_classes_test.sh | 2 +- .../shell/bazel/android/aapt_integration_test.sh | 2 +- .../shell/bazel/android/aar_integration_test.sh | 2 +- .../shell/bazel/android/aidl_integration_test.sh | 2 +- src/test/shell/bazel/android/android_helper.sh | 13 +++---------- ...android_instrumentation_test_integration_test.sh | 2 +- .../shell/bazel/android/android_integration_test.sh | 3 +-- .../android/android_local_test_integration_test.sh | 2 +- .../bazel/android/android_ndk_integration_test.sh | 2 +- .../bazel/android/android_sdk_integration_test.sh | 2 +- src/test/shell/bazel/android/android_sh_test.bzl | 12 +----------- .../bazel/android/desugarer_integration_test.sh | 2 +- .../android/library_desugarer_integration_test.sh | 2 +- .../bazel/android/proguard_integration_test.sh | 2 +- .../android/resource_processing_integration_test.sh | 2 +- 17 files changed, 17 insertions(+), 55 deletions(-) diff --git a/.bazelci/postsubmit.yml b/.bazelci/postsubmit.yml index 0ff4c51bcb282a..3f318712522b71 100644 --- a/.bazelci/postsubmit.yml +++ b/.bazelci/postsubmit.yml @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index e10485c194e2b3..745651a29e1480 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 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 44c4a00020f2ee..95a4e0d83c835f 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 @@ 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() { diff --git a/src/test/shell/bazel/android/aapt_integration_test.sh b/src/test/shell/bazel/android/aapt_integration_test.sh index 9fc17f76760701..9132f3b4f5b453 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 @@ 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 diff --git a/src/test/shell/bazel/android/aar_integration_test.sh b/src/test/shell/bazel/android/aar_integration_test.sh index 31025bb9fd022e..e52bd77a53a83b 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 @@ 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() { diff --git a/src/test/shell/bazel/android/aidl_integration_test.sh b/src/test/shell/bazel/android/aidl_integration_test.sh index 41ae3db3dbb46f..6a35a4827ee49b 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 @@ 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 diff --git a/src/test/shell/bazel/android/android_helper.sh b/src/test/shell/bazel/android/android_helper.sh index 2cb7864a4c2867..7d6341a908c602 100755 --- a/src/test/shell/bazel/android/android_helper.sh +++ b/src/test/shell/bazel/android/android_helper.sh @@ -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 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 c10c21d9051719..8d05fe96162449 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 @@ 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 diff --git a/src/test/shell/bazel/android/android_integration_test.sh b/src/test/shell/bazel/android/android_integration_test.sh index cd83c7e988dc3d..01b047a86a0d7e 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 @@ 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 @@ -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 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 0c5cf553450e01..fb91c52ec895d3 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 @@ 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 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 15f25906c7bad5..6eda46cbfac091 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 @@ 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 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 3b8326808d761e..2e44190195970d 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 @@ 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 diff --git a/src/test/shell/bazel/android/android_sh_test.bzl b/src/test/shell/bazel/android/android_sh_test.bzl index 426fc9c278bfd0..663890692d782a 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 @@ 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 @@ -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", ], diff --git a/src/test/shell/bazel/android/desugarer_integration_test.sh b/src/test/shell/bazel/android/desugarer_integration_test.sh index fa25ace0938de3..87ded51a950e5a 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 @@ 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 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 ce8bfcad33e74c..b8b5000066d35d 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 @@ 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. diff --git a/src/test/shell/bazel/android/proguard_integration_test.sh b/src/test/shell/bazel/android/proguard_integration_test.sh index 8a322e3aa7bd47..869589de67919a 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 @@ 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 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 18fef259b8e456..d4d2f08144b2f5 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 @@ 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 From 7ae32f3ea9d4bdd40bfabf13316f45dc6d2de178 Mon Sep 17 00:00:00 2001 From: John Cater Date: Mon, 4 Dec 2023 04:38:58 -0800 Subject: [PATCH 05/11] Re enable android tests Work towards #18776. Centos tests are still disabled because of python version issues: https://github.com/bazelbuild/bazel/issues/18776#issuecomment-1832277382 Closes #20348. PiperOrigin-RevId: 587674122 Change-Id: Id99b09d9dc184f015f02e4ebc921dcfa58adcc45 --- .bazelci/postsubmit.yml | 26 +------------------------- .bazelci/presubmit.yml | 26 +------------------------- 2 files changed, 2 insertions(+), 50 deletions(-) diff --git a/.bazelci/postsubmit.yml b/.bazelci/postsubmit.yml index 3f318712522b71..52deced24a16b5 100644 --- a/.bazelci/postsubmit.yml +++ b/.bazelci/postsubmit.yml @@ -44,7 +44,7 @@ tasks: - "-//src/test/shell/bazel:bazel_coverage_cc_released_test_gcc" - "-//src/test/shell/bazel:bazel_coverage_cc_head_test_gcc" - "-//src/test/shell/bazel:bazel_coverage_sh_test" - # https://github.com/bazelbuild/bazel/issues/18776 + # Centos7 uses python 2 by default, so these fail: 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:aapt_integration_test" @@ -83,11 +83,6 @@ tasks: - "//tools/bash/..." # Re-enable once fixed: https://github.com/bazelbuild/bazel/issues/8162 - "-//src/java_tools/import_deps_checker/..." - # 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:aapt_integration_test" - - "-//src/test/shell/bazel/android:aapt_integration_test_with_head_android_tools" include_json_profile: - build - test @@ -148,11 +143,6 @@ tasks: - "//tools/bash/..." # Re-enable once fixed: https://github.com/bazelbuild/bazel/issues/8162 - "-//src/java_tools/import_deps_checker/..." - # 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:aapt_integration_test" - - "-//src/test/shell/bazel/android:aapt_integration_test_with_head_android_tools" include_json_profile: - build - test @@ -200,11 +190,6 @@ tasks: - "-//src/test/shell/bazel/apple:bazel_apple_test" # https://github.com/bazelbuild/bazel/issues/17408 - "-//src/test/shell/bazel/apple:bazel_objc_test" - # 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:aapt_integration_test" - - "-//src/test/shell/bazel/android:aapt_integration_test_with_head_android_tools" # https://github.com/bazelbuild/bazel/issues/17410 - "-//src/test/java/com/google/devtools/build/lib/platform:SystemMemoryPressureEventTest" # https://github.com/bazelbuild/bazel/issues/17411 @@ -254,10 +239,6 @@ tasks: - "-//src/test/shell/bazel:bazel_cc_code_coverage_test" # MacOS does not have cgroups so it can't support hardened sandbox - "-//src/test/shell/integration:bazel_hardened_sandboxed_worker_test" - # https://github.com/bazelbuild/bazel/issues/16521 & https://github.com/bazelbuild/bazel/issues/18776 - - "-//src/test/shell/bazel/android/..." - - "-//src/tools/android/java/com/google/devtools/build/android/..." - - "-//src/test/java/com/google/devtools/build/android/dexer:AllTests" # https://github.com/bazelbuild/bazel/issues/16525 - "-//src/test/java/com/google/devtools/build/lib/buildtool:KeepGoingTest" - "-//src/test/java/com/google/devtools/build/lib/buildtool:DanglingSymlinkTest" @@ -396,11 +377,6 @@ tasks: - "-//src/test/py/bazel:bazel_yanked_versions_test" - "-//src/test/py/bazel:bzlmod_query_test" - "-//src/test/shell/bazel:verify_workspace" - # 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:aapt_integration_test" - - "-//src/test/shell/bazel/android:aapt_integration_test_with_head_android_tools" include_json_profile: - build - test diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index 745651a29e1480..fcf534ac699e9b 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -45,7 +45,7 @@ tasks: - "-//src/test/shell/bazel:bazel_coverage_cc_released_test_gcc" - "-//src/test/shell/bazel:bazel_coverage_cc_head_test_gcc" - "-//src/test/shell/bazel:bazel_coverage_sh_test" - # https://github.com/bazelbuild/bazel/issues/18776 + # Centos7 uses python 2 by default, so these fail: 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:aapt_integration_test" @@ -85,11 +85,6 @@ tasks: - "//tools/bash/..." # Re-enable once fixed: https://github.com/bazelbuild/bazel/issues/8162 - "-//src/java_tools/import_deps_checker/..." - # 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:aapt_integration_test" - - "-//src/test/shell/bazel/android:aapt_integration_test_with_head_android_tools" include_json_profile: - build - test @@ -151,11 +146,6 @@ tasks: - "//tools/bash/..." # Re-enable once fixed: https://github.com/bazelbuild/bazel/issues/8162 - "-//src/java_tools/import_deps_checker/..." - # 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:aapt_integration_test" - - "-//src/test/shell/bazel/android:aapt_integration_test_with_head_android_tools" include_json_profile: - build - test @@ -204,11 +194,6 @@ tasks: # - "-//src/test/shell/bazel/apple:bazel_apple_test" # # https://github.com/bazelbuild/bazel/issues/17408 # - "-//src/test/shell/bazel/apple:bazel_objc_test" - # # 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:aapt_integration_test" - # - "-//src/test/shell/bazel/android:aapt_integration_test_with_head_android_tools" # # https://github.com/bazelbuild/bazel/issues/17410 # - "-//src/test/java/com/google/devtools/build/lib/platform:SystemMemoryPressureEventTest" # # https://github.com/bazelbuild/bazel/issues/17411 @@ -259,10 +244,6 @@ tasks: # - "-//src/test/shell/bazel:bazel_cc_code_coverage_test" # # MacOS does not have cgroups so it can't support hardened sandbox # - "-//src/test/shell/integration:bazel_hardened_sandboxed_worker_test" - # # https://github.com/bazelbuild/bazel/issues/16521 & https://github.com/bazelbuild/bazel/issues/18776 - # - "-//src/test/shell/bazel/android/..." - # - "-//src/tools/android/java/com/google/devtools/build/android/..." - # - "-//src/test/java/com/google/devtools/build/android/dexer:AllTests" # # https://github.com/bazelbuild/bazel/issues/16525 # - "-//src/test/java/com/google/devtools/build/lib/buildtool:KeepGoingTest" # - "-//src/test/java/com/google/devtools/build/lib/buildtool:DanglingSymlinkTest" @@ -460,11 +441,6 @@ tasks: # Flaky on rbe_ubuntu2004 # https://github.com/bazelbuild/continuous-integration/issues/1631 - "-//src/test/shell/bazel:bazel_sandboxing_networking_test" - # 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:aapt_integration_test" - - "-//src/test/shell/bazel/android:aapt_integration_test_with_head_android_tools" include_json_profile: - build - test From bbeb80456914452dee1668b95f8baa81fa252435 Mon Sep 17 00:00:00 2001 From: David Ostrovsky Date: Mon, 4 Dec 2023 06:24:04 -0800 Subject: [PATCH 06/11] Add fedora39 to CI platforms Fedora 39 is shipping GCC 13, modern C/C++ toolchain, so that adding it to CI platforms would help to detect breakages earlier, that related to modern C/C++ toolchains. Closes #20405. PiperOrigin-RevId: 587697147 Change-Id: Ib5adf1579991a85f1e2994fb86b1b9e7b25bad7f --- .bazelci/postsubmit.yml | 16 ++++++++++++++++ .bazelci/presubmit.yml | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/.bazelci/postsubmit.yml b/.bazelci/postsubmit.yml index 52deced24a16b5..8db4baff2ec605 100644 --- a/.bazelci/postsubmit.yml +++ b/.bazelci/postsubmit.yml @@ -52,6 +52,22 @@ tasks: include_json_profile: - build - test + fedora39: + shell_commands: + - sed -i.bak -e 's/^# android_sdk_repository/android_sdk_repository/' -e 's/^# + android_ndk_repository/android_ndk_repository/' WORKSPACE.bzlmod + - rm -f WORKSPACE.bzlmod.bak + - rm -rf $HOME/bazeltest + - mkdir $HOME/bazeltest + build_flags: + - "--config=ci-linux" + build_targets: + - "//src:bazel" + - "//src:bazel_jdk_minimal" + - "//src/main/java/..." + include_json_profile: + - build + - test ubuntu2204: shell_commands: - sed -i.bak -e 's/^# android_sdk_repository/android_sdk_repository/' -e 's/^# diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index fcf534ac699e9b..d7317f6ed529ba 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -53,6 +53,22 @@ tasks: include_json_profile: - build - test + fedora39: + shell_commands: + - sed -i.bak -e 's/^# android_sdk_repository/android_sdk_repository/' -e 's/^# + android_ndk_repository/android_ndk_repository/' WORKSPACE.bzlmod + - rm -f WORKSPACE.bzlmod.bak + - rm -rf $HOME/bazeltest + - mkdir $HOME/bazeltest + build_flags: + - "--config=ci-linux" + build_targets: + - "//src:bazel" + - "//src:bazel_jdk_minimal" + - "//src/main/java/..." + include_json_profile: + - build + - test ubuntu2204: shards: 4 shell_commands: From 498209dda084eb7bf091971d8d995894466a026e Mon Sep 17 00:00:00 2001 From: John Cater Date: Tue, 5 Dec 2023 13:56:42 -0800 Subject: [PATCH 07/11] Re-disable android_instrumentation_test_integration_test on macOS. Still seeing problems with finding python: https://buildkite.com/bazel/bazel-bazel/builds/25852#018c37b0-3cb4-4829-826b-eced53b34e5f Part of #20437 and #18776. Closes #20440. PiperOrigin-RevId: 588180701 Change-Id: I8a0181f96df7612c72ce5e33336690f3a0efef15 --- .bazelci/postsubmit.yml | 10 ++++++++++ .bazelci/presubmit.yml | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/.bazelci/postsubmit.yml b/.bazelci/postsubmit.yml index 8db4baff2ec605..72bae0440f25db 100644 --- a/.bazelci/postsubmit.yml +++ b/.bazelci/postsubmit.yml @@ -216,6 +216,11 @@ tasks: - "-//src/test/shell/bazel:bazel_determinism_test" # https://github.com/bazelbuild/bazel/issues/17457 - "-//src/test/shell/bazel:jdeps_test" + # Macs can't find python, so these fail: 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:aapt_integration_test" + - "-//src/test/shell/bazel/android:aapt_integration_test_with_head_android_tools" include_json_profile: - build - test @@ -266,6 +271,11 @@ tasks: - "-//src/test/java/com/google/devtools/build/lib/rules/objc:ObjcRulesTests" # https://github.com/bazelbuild/bazel/issues/17007 - "-//src/test/java/com/google/devtools/build/lib/platform:SystemMemoryPressureEventTest" + # Macs can't find python, so these fail: 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:aapt_integration_test" + - "-//src/test/shell/bazel/android:aapt_integration_test_with_head_android_tools" include_json_profile: - build - test diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index d7317f6ed529ba..b3022adf312e93 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -220,6 +220,11 @@ tasks: # - "-//src/test/shell/bazel:bazel_determinism_test" # # https://github.com/bazelbuild/bazel/issues/17457 # - "-//src/test/shell/bazel:jdeps_test" + # # Macs can't find python, so these fail: 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:aapt_integration_test" + # - "-//src/test/shell/bazel/android:aapt_integration_test_with_head_android_tools" # include_json_profile: # - build # - test @@ -324,6 +329,11 @@ tasks: # - "-//src/test/shell/bazel:bazel_repository_cache_test" # - "-//src/test/shell/integration:aquery_test" # - "-//src/test/shell/integration:py_args_escaping_test" + # # Macs can't find python, so these fail: 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:aapt_integration_test" + # - "-//src/test/shell/bazel/android:aapt_integration_test_with_head_android_tools" # include_json_profile: # - build # - test From 9dcb2cc6dced45f84c3f47ceea0be9415cce4f4f Mon Sep 17 00:00:00 2001 From: Googler Date: Wed, 6 Dec 2023 06:17:37 -0800 Subject: [PATCH 08/11] Enable macOS presubmit and disable failing tests To prevent further regressions on macOS. Related: https://github.com/bazelbuild/bazel/issues/20437 PiperOrigin-RevId: 588402302 Change-Id: I91fba9cad88c45626a51ee05b527bf7a3b66199b --- .bazelci/postsubmit.yml | 18 ++ .bazelci/presubmit.yml | 362 +++++++++++++++++++++------------------- 2 files changed, 208 insertions(+), 172 deletions(-) diff --git a/.bazelci/postsubmit.yml b/.bazelci/postsubmit.yml index 72bae0440f25db..43eed4a8b4c29e 100644 --- a/.bazelci/postsubmit.yml +++ b/.bazelci/postsubmit.yml @@ -221,6 +221,13 @@ tasks: - "-//src/test/shell/bazel/android:android_instrumentation_test_integration_test_with_head_android_tools" - "-//src/test/shell/bazel/android:aapt_integration_test" - "-//src/test/shell/bazel/android:aapt_integration_test_with_head_android_tools" + # Disable recently regressed tests: https://github.com/bazelbuild/bazel/issues/20437 + - "-//src/test/java/com/google/devtools/build/lib/rules/cpp:CppSysrootTest" + - "-//src/test/java/com/google/devtools/build/lib/rules/cpp:CcImportConfiguredTargetTest" + - "-//src/test/java/com/google/devtools/build/lib/rules/objc:ObjcRulesTests" + - "-//src/test/java/com/google/devtools/build/lib/rules/objc:BazelJ2ObjcLibraryTest" + - "-//src/test/java/com/google/devtools/build/lib/rules/cpp:CcToolchainTest" + - "-//src/test/shell/integration:minimal_jdk_test" include_json_profile: - build - test @@ -271,11 +278,22 @@ tasks: - "-//src/test/java/com/google/devtools/build/lib/rules/objc:ObjcRulesTests" # https://github.com/bazelbuild/bazel/issues/17007 - "-//src/test/java/com/google/devtools/build/lib/platform:SystemMemoryPressureEventTest" + # https://github.com/bazelbuild/bazel/issues/16521 & https://github.com/bazelbuild/bazel/issues/18776 + - "-//src/test/shell/bazel/android/..." + - "-//src/tools/android/java/com/google/devtools/build/android/..." + - "-//src/test/java/com/google/devtools/build/android/dexer:AllTests" # Macs can't find python, so these fail: 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:aapt_integration_test" - "-//src/test/shell/bazel/android:aapt_integration_test_with_head_android_tools" + # Disable recently regressed tests: https://github.com/bazelbuild/bazel/issues/20437 + - "-//src/test/java/com/google/devtools/build/lib/rules/cpp:CppSysrootTest" + - "-//src/test/java/com/google/devtools/build/lib/rules/cpp:CcImportConfiguredTargetTest" + - "-//src/test/java/com/google/devtools/build/lib/rules/objc:ObjcRulesTests" + - "-//src/test/java/com/google/devtools/build/lib/rules/objc:BazelJ2ObjcLibraryTest" + - "-//src/test/java/com/google/devtools/build/lib/rules/cpp:CcToolchainTest" + - "-//src/test/shell/integration:minimal_jdk_test" include_json_profile: - build - test diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index b3022adf312e93..b799df7ddb2cfc 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -165,178 +165,196 @@ tasks: include_json_profile: - build - test - # macos: - # shards: 5 - # shell_commands: - # - sed -i.bak -e 's/^# android_sdk_repository/android_sdk_repository/' -e 's/^# - # android_ndk_repository/android_ndk_repository/' WORKSPACE.bzlmod - # - rm -f WORKSPACE.bzlmod.bak - # - rm -rf $HOME/bazeltest - # - mkdir $HOME/bazeltest - # - ln -sf $OUTPUT_BASE/external $HOME/bazeltest/external - # build_flags: - # - "--config=ci-macos" - # build_targets: - # - "//src:bazel" - # - "//src:bazel_jdk_minimal" - # - "//src:test_repos" - # - "//src/main/java/..." - # test_flags: - # - "--config=ci-macos" - # # Fine tune the number of test jobs running in parallel to avoid timeout - # - "--local_test_jobs=8" - # test_targets: - # - "//scripts/..." - # - "//src/main/starlark/tests/builtins_bzl/..." - # - "//src/test/..." - # - "//src/tools/execlog/..." - # - "//src/tools/singlejar/..." - # - "//src/tools/workspacelog/..." - # - "//third_party/ijar/..." - # - "//tools/android/..." - # - "//tools/aquery_differ/..." - # - "//tools/python/..." - # - "//tools/bash/..." - # # Re-enable once fixed: https://github.com/bazelbuild/bazel/issues/8162 - # - "-//src/java_tools/buildjar/..." - # - "-//src/java_tools/import_deps_checker/..." - # # C++ coverage is not supported on macOS yet. - # - "-//src/test/shell/bazel:bazel_cc_code_coverage_test" - # # MacOS does not have cgroups so it can't support hardened sandbox - # - "-//src/test/shell/integration:bazel_hardened_sandboxed_worker_test" - # # https://github.com/bazelbuild/bazel/issues/16526 - # - "-//src/test/shell/bazel:starlark_repository_test" - # # https://github.com/bazelbuild/bazel/issues/17407 - # - "-//src/test/shell/bazel/apple:bazel_apple_test" - # # https://github.com/bazelbuild/bazel/issues/17408 - # - "-//src/test/shell/bazel/apple:bazel_objc_test" - # # https://github.com/bazelbuild/bazel/issues/17410 - # - "-//src/test/java/com/google/devtools/build/lib/platform:SystemMemoryPressureEventTest" - # # https://github.com/bazelbuild/bazel/issues/17411 - # - "-//src/test/java/com/google/devtools/build/lib/blackbox/tests/workspace:PatchApiBlackBoxTest" - # # https://github.com/bazelbuild/bazel/issues/17447 - # - "-//src/test/java/com/google/devtools/build/lib/blackbox/tests/workspace:GitRepositoryBlackBoxTest" - # # https://github.com/bazelbuild/bazel/issues/17456 - # - "-//src/test/shell/bazel:bazel_determinism_test" - # # https://github.com/bazelbuild/bazel/issues/17457 - # - "-//src/test/shell/bazel:jdeps_test" - # # Macs can't find python, so these fail: 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:aapt_integration_test" - # - "-//src/test/shell/bazel/android:aapt_integration_test_with_head_android_tools" - # include_json_profile: - # - build - # - test - # macos_arm64: - # shards: 2 - # shell_commands: - # - sed -i.bak -e 's/^# android_sdk_repository/android_sdk_repository/' -e 's/^# - # android_ndk_repository/android_ndk_repository/' WORKSPACE.bzlmod - # - rm -f WORKSPACE.bzlmod.bak - # - rm -rf $HOME/bazeltest - # - mkdir $HOME/bazeltest - # - ln -sf $OUTPUT_BASE/external $HOME/bazeltest/external - # build_flags: - # - "--config=ci-macos" - # build_targets: - # - "//src:bazel" - # - "//src:bazel_jdk_minimal" - # - "//src:test_repos" - # - "//src/main/java/..." - # test_flags: - # - "--config=ci-macos" - # test_targets: - # - "//scripts/..." - # - "//src/main/starlark/tests/builtins_bzl/..." - # - "//src/test/..." - # - "//src/tools/execlog/..." - # - "//src/tools/singlejar/..." - # - "//src/tools/workspacelog/..." - # - "//third_party/ijar/..." - # - "//tools/android/..." - # - "//tools/aquery_differ/..." - # - "//tools/python/..." - # - "//tools/bash/..." - # # Re-enable once fixed: https://github.com/bazelbuild/bazel/issues/8162 - # - "-//src/java_tools/buildjar/..." - # - "-//src/java_tools/import_deps_checker/..." - # # C++ coverage is not supported on macOS yet. - # - "-//src/test/shell/bazel:bazel_cc_code_coverage_test" - # # MacOS does not have cgroups so it can't support hardened sandbox - # - "-//src/test/shell/integration:bazel_hardened_sandboxed_worker_test" - # # https://github.com/bazelbuild/bazel/issues/16525 - # - "-//src/test/java/com/google/devtools/build/lib/buildtool:KeepGoingTest" - # - "-//src/test/java/com/google/devtools/build/lib/buildtool:DanglingSymlinkTest" - # - "-//src/test/java/com/google/devtools/build/lib/buildtool:CompileOneDependencyIntegrationTest" - # - "-//src/test/java/com/google/devtools/build/lib/buildtool:SkymeldBuildIntegrationTest" - # - "-//src/test/java/com/google/devtools/build/lib/rules/objc:BazelJ2ObjcLibraryTest" - # - "-//src/test/java/com/google/devtools/build/lib/skyframe/rewinding:RewindingTest" - # - "-//src/test/java/com/google/devtools/build/lib/buildtool:MiscAnalysisTest" - # - "-//src/test/java/com/google/devtools/build/lib/rules/objc:ObjcRulesTests" - # # https://github.com/bazelbuild/bazel/issues/17007 - # - "-//src/test/java/com/google/devtools/build/lib/platform:SystemMemoryPressureEventTest" - # # Disable the most time-consuming tests on macOS arm64 platform in presubmit. - # # To run any of the following test in presubmit, just comment out the corresponding line. - # # TODO(pcloudy): Re-enable when Apple Silicon machine waiting time is no longer the major - # # bottleneck for presubmit. - # - "-//src/test/shell/bazel:bazel_determinism_test" - # - "-//src/test/shell/bazel:jdeps_test" - # - "-//src/test/shell/bazel:starlark_git_repository_test" - # - "-//src/test/shell/bazel:bazel_bootstrap_distfile_tar_test" - # - "-//src/test/shell/integration:bazel_json_worker_test" - # - "-//src/test/py/bazel:runfiles_test" - # - "-//src/test/py/bazel:launcher_test" - # - "-//src/test/py/bazel:bazel_module_test" - # - "-//src/test/shell/bazel:bazel_java_test_jdk11_toolchain_head" - # - "-//src/test/shell/integration:target_compatible_with_test" - # - "-//src/test/py/bazel:py_test" - # - "-//src/test/py/bazel:bzlmod_query_test" - # - "-//src/test/py/bazel:cc_import_test" - # - "-//src/test/shell/bazel/remote:build_without_the_bytes_test" - # - "-//src/test/shell/bazel:bazel_coverage_java_test" - # - "-//src/test/py/bazel:bazel_yanked_versions_test" - # - "-//src/test/shell/bazel:bazel_coverage_java_jdk17_toolchain_head_test" - # - "-//src/test/shell/bazel:bazel_proto_library_test" - # - "-//src/test/shell/bazel:bazel_java_tools_test" - # - "-//src/test/shell/integration:build_event_stream_test" - # - "-//src/test/py/bazel:bazel_overrides_test" - # - "-//src/test/shell/bazel:cc_integration_test" - # - "-//src/test/shell/bazel:bazel_java_test" - # - "-//src/test/java/com/google/devtools/build/lib/rules/config:ConfigRulesTests" - # - "-//src/test/shell/bazel:bazel_java_test_jdk17_toolchain_head" - # - "-//src/test/shell/integration:bazel_worker_test" - # - "-//src/test/shell/bazel:tags_propagation_native_test" - # - "-//src/test/shell/bazel:bazel_coverage_java_jdk11_toolchain_head_test" - # - "-//src/test/shell/integration:bazel_sandboxed_worker_test" - # - "-//src/test/py/bazel:bazel_repo_mapping_test" - # - "-//src/test/shell/bazel:bazel_coverage_java_jdk11_toolchain_released_test" - # - "-//src/test/py/bazel:bazel_workspace_test" - # - "-//src/test/shell/bazel:execroot_test" - # - "-//src/test/shell/bazel:starlark_repository_test" - # - "-//src/test/shell/bazel:bazel_coverage_java_jdk17_toolchain_released_test" - # - "-//src/test/shell/bazel/remote:remote_execution_test" - # - "-//src/test/shell/integration:toolchain_test" - # - "-//src/test/shell/bazel:bazel_test_test" - # - "-//src/test/shell/integration:test_test" - # - "-//src/test/shell/bazel:bazel_execlog_test" - # - "-//src/test/shell/integration:modify_execution_info_test" - # - "-//src/test/shell/bazel:external_integration_test" - # - "-//src/test/py/bazel:bazel_external_repository_test" - # - "-//src/test/shell/bazel:bazel_workspaces_test" - # - "-//src/test/shell/integration:client_test" - # - "-//src/test/shell/bazel:workspace_resolved_test" - # - "-//src/test/shell/bazel:bazel_repository_cache_test" - # - "-//src/test/shell/integration:aquery_test" - # - "-//src/test/shell/integration:py_args_escaping_test" - # # Macs can't find python, so these fail: 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:aapt_integration_test" - # - "-//src/test/shell/bazel/android:aapt_integration_test_with_head_android_tools" - # include_json_profile: - # - build - # - test + macos: + shards: 5 + shell_commands: + - sed -i.bak -e 's/^# android_sdk_repository/android_sdk_repository/' -e 's/^# + android_ndk_repository/android_ndk_repository/' WORKSPACE.bzlmod + - rm -f WORKSPACE.bzlmod.bak + - rm -rf $HOME/bazeltest + - mkdir $HOME/bazeltest + - ln -sf $OUTPUT_BASE/external $HOME/bazeltest/external + build_flags: + - "--config=ci-macos" + build_targets: + - "//src:bazel" + - "//src:bazel_jdk_minimal" + - "//src:test_repos" + - "//src/main/java/..." + test_flags: + - "--config=ci-macos" + # Fine tune the number of test jobs running in parallel to avoid timeout + - "--local_test_jobs=8" + test_targets: + - "//scripts/..." + - "//src/main/starlark/tests/builtins_bzl/..." + - "//src/test/..." + - "//src/tools/execlog/..." + - "//src/tools/singlejar/..." + - "//src/tools/workspacelog/..." + - "//third_party/ijar/..." + - "//tools/android/..." + - "//tools/aquery_differ/..." + - "//tools/python/..." + - "//tools/bash/..." + # Re-enable once fixed: https://github.com/bazelbuild/bazel/issues/8162 + - "-//src/java_tools/buildjar/..." + - "-//src/java_tools/import_deps_checker/..." + # C++ coverage is not supported on macOS yet. + - "-//src/test/shell/bazel:bazel_cc_code_coverage_test" + # MacOS does not have cgroups so it can't support hardened sandbox + - "-//src/test/shell/integration:bazel_hardened_sandboxed_worker_test" + # https://github.com/bazelbuild/bazel/issues/16526 + - "-//src/test/shell/bazel:starlark_repository_test" + # https://github.com/bazelbuild/bazel/issues/17407 + - "-//src/test/shell/bazel/apple:bazel_apple_test" + # https://github.com/bazelbuild/bazel/issues/17408 + - "-//src/test/shell/bazel/apple:bazel_objc_test" + # https://github.com/bazelbuild/bazel/issues/17410 + - "-//src/test/java/com/google/devtools/build/lib/platform:SystemMemoryPressureEventTest" + # https://github.com/bazelbuild/bazel/issues/17411 + - "-//src/test/java/com/google/devtools/build/lib/blackbox/tests/workspace:PatchApiBlackBoxTest" + # https://github.com/bazelbuild/bazel/issues/17447 + - "-//src/test/java/com/google/devtools/build/lib/blackbox/tests/workspace:GitRepositoryBlackBoxTest" + # https://github.com/bazelbuild/bazel/issues/17456 + - "-//src/test/shell/bazel:bazel_determinism_test" + # https://github.com/bazelbuild/bazel/issues/17457 + - "-//src/test/shell/bazel:jdeps_test" + # Macs can't find python, so these fail: 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:aapt_integration_test" + - "-//src/test/shell/bazel/android:aapt_integration_test_with_head_android_tools" + # Disable recently regressed tests: https://github.com/bazelbuild/bazel/issues/20437 + - "-//src/test/java/com/google/devtools/build/lib/rules/cpp:CppSysrootTest" + - "-//src/test/java/com/google/devtools/build/lib/rules/cpp:CcImportConfiguredTargetTest" + - "-//src/test/java/com/google/devtools/build/lib/rules/objc:ObjcRulesTests" + - "-//src/test/java/com/google/devtools/build/lib/rules/objc:BazelJ2ObjcLibraryTest" + - "-//src/test/java/com/google/devtools/build/lib/rules/cpp:CcToolchainTest" + - "-//src/test/shell/integration:minimal_jdk_test" + include_json_profile: + - build + - test + macos_arm64: + shards: 2 + shell_commands: + - sed -i.bak -e 's/^# android_sdk_repository/android_sdk_repository/' -e 's/^# + android_ndk_repository/android_ndk_repository/' WORKSPACE.bzlmod + - rm -f WORKSPACE.bzlmod.bak + - rm -rf $HOME/bazeltest + - mkdir $HOME/bazeltest + - ln -sf $OUTPUT_BASE/external $HOME/bazeltest/external + build_flags: + - "--config=ci-macos" + build_targets: + - "//src:bazel" + - "//src:bazel_jdk_minimal" + - "//src:test_repos" + - "//src/main/java/..." + test_flags: + - "--config=ci-macos" + test_targets: + - "//scripts/..." + - "//src/main/starlark/tests/builtins_bzl/..." + - "//src/test/..." + - "//src/tools/execlog/..." + - "//src/tools/singlejar/..." + - "//src/tools/workspacelog/..." + - "//third_party/ijar/..." + - "//tools/android/..." + - "//tools/aquery_differ/..." + - "//tools/python/..." + - "//tools/bash/..." + # Re-enable once fixed: https://github.com/bazelbuild/bazel/issues/8162 + - "-//src/java_tools/buildjar/..." + - "-//src/java_tools/import_deps_checker/..." + # C++ coverage is not supported on macOS yet. + - "-//src/test/shell/bazel:bazel_cc_code_coverage_test" + # MacOS does not have cgroups so it can't support hardened sandbox + - "-//src/test/shell/integration:bazel_hardened_sandboxed_worker_test" + # https://github.com/bazelbuild/bazel/issues/16525 + - "-//src/test/java/com/google/devtools/build/lib/buildtool:KeepGoingTest" + - "-//src/test/java/com/google/devtools/build/lib/buildtool:DanglingSymlinkTest" + - "-//src/test/java/com/google/devtools/build/lib/buildtool:CompileOneDependencyIntegrationTest" + - "-//src/test/java/com/google/devtools/build/lib/buildtool:SkymeldBuildIntegrationTest" + - "-//src/test/java/com/google/devtools/build/lib/rules/objc:BazelJ2ObjcLibraryTest" + - "-//src/test/java/com/google/devtools/build/lib/skyframe/rewinding:RewindingTest" + - "-//src/test/java/com/google/devtools/build/lib/buildtool:MiscAnalysisTest" + - "-//src/test/java/com/google/devtools/build/lib/rules/objc:ObjcRulesTests" + # https://github.com/bazelbuild/bazel/issues/17007 + - "-//src/test/java/com/google/devtools/build/lib/platform:SystemMemoryPressureEventTest" + # Disable the most time-consuming tests on macOS arm64 platform in presubmit. + # To run any of the following test in presubmit, just comment out the corresponding line. + # TODO(pcloudy): Re-enable when Apple Silicon machine waiting time is no longer the major + # bottleneck for presubmit. + - "-//src/test/shell/bazel:bazel_determinism_test" + - "-//src/test/shell/bazel:jdeps_test" + - "-//src/test/shell/bazel:starlark_git_repository_test" + - "-//src/test/shell/bazel:bazel_bootstrap_distfile_tar_test" + - "-//src/test/shell/integration:bazel_json_worker_test" + - "-//src/test/py/bazel:runfiles_test" + - "-//src/test/py/bazel:launcher_test" + - "-//src/test/py/bazel:bazel_module_test" + - "-//src/test/shell/bazel:bazel_java_test_jdk11_toolchain_head" + - "-//src/test/shell/integration:target_compatible_with_test" + - "-//src/test/py/bazel:py_test" + - "-//src/test/py/bazel:bzlmod_query_test" + - "-//src/test/py/bazel:cc_import_test" + - "-//src/test/shell/bazel/remote:build_without_the_bytes_test" + - "-//src/test/shell/bazel:bazel_coverage_java_test" + - "-//src/test/py/bazel:bazel_yanked_versions_test" + - "-//src/test/shell/bazel:bazel_coverage_java_jdk17_toolchain_head_test" + - "-//src/test/shell/bazel:bazel_proto_library_test" + - "-//src/test/shell/bazel:bazel_java_tools_test" + - "-//src/test/shell/integration:build_event_stream_test" + - "-//src/test/py/bazel:bazel_overrides_test" + - "-//src/test/shell/bazel:cc_integration_test" + - "-//src/test/shell/bazel:bazel_java_test" + - "-//src/test/java/com/google/devtools/build/lib/rules/config:ConfigRulesTests" + - "-//src/test/shell/bazel:bazel_java_test_jdk17_toolchain_head" + - "-//src/test/shell/integration:bazel_worker_test" + - "-//src/test/shell/bazel:tags_propagation_native_test" + - "-//src/test/shell/bazel:bazel_coverage_java_jdk11_toolchain_head_test" + - "-//src/test/shell/integration:bazel_sandboxed_worker_test" + - "-//src/test/py/bazel:bazel_repo_mapping_test" + - "-//src/test/shell/bazel:bazel_coverage_java_jdk11_toolchain_released_test" + - "-//src/test/py/bazel:bazel_workspace_test" + - "-//src/test/shell/bazel:execroot_test" + - "-//src/test/shell/bazel:starlark_repository_test" + - "-//src/test/shell/bazel:bazel_coverage_java_jdk17_toolchain_released_test" + - "-//src/test/shell/bazel/remote:remote_execution_test" + - "-//src/test/shell/integration:toolchain_test" + - "-//src/test/shell/bazel:bazel_test_test" + - "-//src/test/shell/integration:test_test" + - "-//src/test/shell/bazel:bazel_execlog_test" + - "-//src/test/shell/integration:modify_execution_info_test" + - "-//src/test/shell/bazel:external_integration_test" + - "-//src/test/py/bazel:bazel_external_repository_test" + - "-//src/test/shell/bazel:bazel_workspaces_test" + - "-//src/test/shell/integration:client_test" + - "-//src/test/shell/bazel:workspace_resolved_test" + - "-//src/test/shell/bazel:bazel_repository_cache_test" + - "-//src/test/shell/integration:aquery_test" + - "-//src/test/shell/integration:py_args_escaping_test" + # https://github.com/bazelbuild/bazel/issues/16521 & https://github.com/bazelbuild/bazel/issues/18776 + - "-//src/test/shell/bazel/android/..." + - "-//src/tools/android/java/com/google/devtools/build/android/..." + - "-//src/test/java/com/google/devtools/build/android/dexer:AllTests" + # Macs can't find python, so these fail: 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:aapt_integration_test" + - "-//src/test/shell/bazel/android:aapt_integration_test_with_head_android_tools" + # Disable recently regressed tests: https://github.com/bazelbuild/bazel/issues/20437 + - "-//src/test/java/com/google/devtools/build/lib/rules/cpp:CppSysrootTest" + - "-//src/test/java/com/google/devtools/build/lib/rules/cpp:CcImportConfiguredTargetTest" + - "-//src/test/java/com/google/devtools/build/lib/rules/objc:ObjcRulesTests" + - "-//src/test/java/com/google/devtools/build/lib/rules/objc:BazelJ2ObjcLibraryTest" + - "-//src/test/java/com/google/devtools/build/lib/rules/cpp:CcToolchainTest" + - "-//src/test/shell/integration:minimal_jdk_test" + include_json_profile: + - build + - test windows: shards: 4 setup: From 7c2ac4a916ecccba7f9d731e1228baca353e640a Mon Sep 17 00:00:00 2001 From: Justin Horvitz Date: Thu, 7 Dec 2023 05:24:34 -0800 Subject: [PATCH 09/11] Re-enable minimal_jdk_test with a higher tolerance Re-enable `minimal_jdk_test` with a higher tolerance. Closes #20451. PiperOrigin-RevId: 588756736 Change-Id: Ib26da4a31f942b1f0d7a3ed976389449f7995105 --- .bazelci/postsubmit.yml | 2 -- .bazelci/presubmit.yml | 1 - src/test/shell/integration/minimal_jdk_test.sh | 6 +++--- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.bazelci/postsubmit.yml b/.bazelci/postsubmit.yml index 43eed4a8b4c29e..ceb5eed0de0172 100644 --- a/.bazelci/postsubmit.yml +++ b/.bazelci/postsubmit.yml @@ -227,7 +227,6 @@ tasks: - "-//src/test/java/com/google/devtools/build/lib/rules/objc:ObjcRulesTests" - "-//src/test/java/com/google/devtools/build/lib/rules/objc:BazelJ2ObjcLibraryTest" - "-//src/test/java/com/google/devtools/build/lib/rules/cpp:CcToolchainTest" - - "-//src/test/shell/integration:minimal_jdk_test" include_json_profile: - build - test @@ -293,7 +292,6 @@ tasks: - "-//src/test/java/com/google/devtools/build/lib/rules/objc:ObjcRulesTests" - "-//src/test/java/com/google/devtools/build/lib/rules/objc:BazelJ2ObjcLibraryTest" - "-//src/test/java/com/google/devtools/build/lib/rules/cpp:CcToolchainTest" - - "-//src/test/shell/integration:minimal_jdk_test" include_json_profile: - build - test diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index b799df7ddb2cfc..96917e1468d985 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -231,7 +231,6 @@ tasks: - "-//src/test/java/com/google/devtools/build/lib/rules/objc:ObjcRulesTests" - "-//src/test/java/com/google/devtools/build/lib/rules/objc:BazelJ2ObjcLibraryTest" - "-//src/test/java/com/google/devtools/build/lib/rules/cpp:CcToolchainTest" - - "-//src/test/shell/integration:minimal_jdk_test" include_json_profile: - build - test diff --git a/src/test/shell/integration/minimal_jdk_test.sh b/src/test/shell/integration/minimal_jdk_test.sh index 82f40fd9e63a94..dad2abe4aa6e64 100755 --- a/src/test/shell/integration/minimal_jdk_test.sh +++ b/src/test/shell/integration/minimal_jdk_test.sh @@ -42,13 +42,13 @@ export BAZEL_SUFFIX="_jdk_minimal" source "$(rlocation "io_bazel/src/test/shell/integration_test_setup.sh")" \ || { echo "integration_test_setup.sh not found!" >&2; exit 1; } -# Bazel's install base is < 370MB with minimal JDK and > 370MB with an all +# Bazel's install base is < 450MB with minimal JDK and > 450MB with an all # modules JDK. -function test_size_less_than_370MB() { +function test_size_less_than_450MB() { bazel info ib=$(bazel info install_base) size=$(du -s "$ib" | cut -d\ -f1) - maxsize=$((1024*370)) + maxsize=$((1024*450)) if [ $size -gt $maxsize ]; then echo "$ib was too big:" 1>&2 du -a "$ib" 1>&2 From ae6f9eebec674a0d7c5e304918f49b90a922f475 Mon Sep 17 00:00:00 2001 From: Googler Date: Fri, 22 Dec 2023 00:11:58 -0800 Subject: [PATCH 10/11] Disable two failing tests on macos_arm64 Those two are failing after upgrading to Xcode 14 PiperOrigin-RevId: 593039540 Change-Id: I12a1455cc09460c3bf0278a959de400f94988145 --- .bazelci/postsubmit.yml | 4 ++++ .bazelci/presubmit.yml | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/.bazelci/postsubmit.yml b/.bazelci/postsubmit.yml index ceb5eed0de0172..cfa0d90314b24d 100644 --- a/.bazelci/postsubmit.yml +++ b/.bazelci/postsubmit.yml @@ -292,6 +292,10 @@ tasks: - "-//src/test/java/com/google/devtools/build/lib/rules/objc:ObjcRulesTests" - "-//src/test/java/com/google/devtools/build/lib/rules/objc:BazelJ2ObjcLibraryTest" - "-//src/test/java/com/google/devtools/build/lib/rules/cpp:CcToolchainTest" + # https://github.com/bazelbuild/bazel/issues/17411 + - "-//src/test/java/com/google/devtools/build/lib/blackbox/tests/workspace:PatchApiBlackBoxTest" + # https://github.com/bazelbuild/bazel/issues/17447 + - "-//src/test/java/com/google/devtools/build/lib/blackbox/tests/workspace:GitRepositoryBlackBoxTest" include_json_profile: - build - test diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index 96917e1468d985..4ecbd214998351 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -351,6 +351,10 @@ tasks: - "-//src/test/java/com/google/devtools/build/lib/rules/objc:BazelJ2ObjcLibraryTest" - "-//src/test/java/com/google/devtools/build/lib/rules/cpp:CcToolchainTest" - "-//src/test/shell/integration:minimal_jdk_test" + # https://github.com/bazelbuild/bazel/issues/17411 + - "-//src/test/java/com/google/devtools/build/lib/blackbox/tests/workspace:PatchApiBlackBoxTest" + # https://github.com/bazelbuild/bazel/issues/17447 + - "-//src/test/java/com/google/devtools/build/lib/blackbox/tests/workspace:GitRepositoryBlackBoxTest" include_json_profile: - build - test From 3d66bc750f385be9d0c74508a65a016377a3fc69 Mon Sep 17 00:00:00 2001 From: Googler Date: Fri, 22 Dec 2023 07:27:35 -0800 Subject: [PATCH 11/11] Disable PyTest.testSmoke on macOS Due to https://github.com/bazelbuild/bazel/issues/20660 RELNOTES: None PiperOrigin-RevId: 593115090 Change-Id: Ifc2a282dbd6dd8a3abfec987398388e5844af91c --- src/test/py/bazel/py_test.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/test/py/bazel/py_test.py b/src/test/py/bazel/py_test.py index 6158b17b191a7e..83e45a16d103f6 100644 --- a/src/test/py/bazel/py_test.py +++ b/src/test/py/bazel/py_test.py @@ -46,6 +46,9 @@ def createSimpleFiles(self): ]) def testSmoke(self): + if test_base.TestBase.IsDarwin(): + # Re-enable after fixing https://github.com/bazelbuild/bazel/issues/20660 + return self.createSimpleFiles() _, stdout, _ = self.RunBazel(['run', '//a:a']) self.assertIn('Hello, World', stdout)