From f0a88c45b816518facc8272f4197767c70f88e77 Mon Sep 17 00:00:00 2001 From: UebelAndre Date: Fri, 27 Feb 2026 10:12:37 -0800 Subject: [PATCH 1/3] Add `coverage` invocations to presubmit --- .bazelci/presubmit.yml | 102 +++++++++++++++++++++++++++++++++++------ .bcr/presubmit.yml | 1 + 2 files changed, 89 insertions(+), 14 deletions(-) diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index 568d7c3f7..de169f5fc 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -31,6 +31,11 @@ test_targets_bazel_6: &test_targets_bazel_6 - "-//tests/rule_based_toolchain/tool_map:_duplicate_action_test_subject" # Intentionally broken rule. - "-//tests/system_library:system_library_test" # Should be skipped on Windows and MacOS +# Test failures are not collected under `coverage` invocations. +# https://github.com/bazelbuild/continuous-integration/issues/1838 +common_coverage_flags: &common_coverage_flags + - "--test_output=errors" + buildifier: version: latest @@ -54,10 +59,16 @@ tasks: - "//examples/..." - "//tests/..." - "-//tests/rule_based_toolchain/tool_map:_duplicate_action_test_subject" # Intentionally broken rule. + macos_intel_head: + name: MacOS Intel (Bazel HEAD) + bazel: last_green + platform: macos + build_targets: *build_targets + test_targets: *test_targets macos_head: name: MacOS (Bazel HEAD) bazel: last_green - platform: macos + platform: macos_arm64 build_targets: *build_targets test_targets: *test_targets windows_head: @@ -79,18 +90,30 @@ tasks: - "//examples/..." - "//tests/..." - "-//tests/rule_based_toolchain/tool_map:_duplicate_action_test_subject" # Intentionally broken rule. + macos_intel_rolling: + name: MacOS Intel (Bazel rolling) + bazel: rolling + platform: macos + build_targets: *build_targets + test_targets: *test_targets + coverage_flags: *common_coverage_flags + coverage_targets: *test_targets macos_rolling: name: MacOS (Bazel rolling) bazel: rolling - platform: macos + platform: macos_arm64 build_targets: *build_targets test_targets: *test_targets + coverage_flags: *common_coverage_flags + coverage_targets: *test_targets windows_rolling: name: Windows (Bazel rolling) bazel: rolling platform: windows build_targets: *build_targets test_targets: *test_targets + coverage_flags: *common_coverage_flags + coverage_targets: *test_targets # Bazel 6 ubuntu2004_bazel_6: @@ -100,7 +123,7 @@ tasks: build_targets: *build_targets_bazel_6 test_targets: *test_targets_bazel_6 macos_bazel_6: - name: MacOS (Bazel 6) + name: MacOS Intel (Bazel 6) bazel: 6.3.0 platform: macos build_targets: *build_targets_bazel_6 @@ -119,18 +142,32 @@ tasks: platform: ubuntu2004 build_targets: *build_targets_bazel_6 test_targets: *test_targets_bazel_6 + coverage_flags: *common_coverage_flags + coverage_targets: *test_targets_bazel_6 + macos_intel_bazel_7: + name: MacOS Intel (Bazel 7) + bazel: 7.x + platform: macos + build_targets: *build_targets_bazel_6 + test_targets: *test_targets_bazel_6 + coverage_flags: *common_coverage_flags + coverage_targets: *test_targets_bazel_6 macos_bazel_7: name: MacOS (Bazel 7) bazel: 7.x - platform: macos + platform: macos_arm64 build_targets: *build_targets_bazel_6 test_targets: *test_targets_bazel_6 + coverage_flags: *common_coverage_flags + coverage_targets: *test_targets_bazel_6 windows_bazel_7: name: Windows (Bazel 7) bazel: 7.x platform: windows build_targets: *build_targets_bazel_6 test_targets: *test_targets_bazel_6 + coverage_flags: *common_coverage_flags + coverage_targets: *test_targets_bazel_6 # Bazel 8 ubuntu2004_bazel_8: @@ -139,38 +176,67 @@ tasks: platform: ubuntu2004 build_targets: *build_targets_bazel_6 test_targets: *test_targets_bazel_6 + coverage_flags: *common_coverage_flags + coverage_targets: *test_targets_bazel_6 + macos_intel_bazel_8: + name: MacOS Intel (Bazel 8) + bazel: 8.x + platform: macos + build_targets: *build_targets_bazel_6 + test_targets: *test_targets_bazel_6 + coverage_flags: *common_coverage_flags + coverage_targets: *test_targets_bazel_6 macos_bazel_8: name: MacOS (Bazel 8) bazel: 8.x - platform: macos + platform: macos_arm64 build_targets: *build_targets_bazel_6 test_targets: *test_targets_bazel_6 + coverage_flags: *common_coverage_flags + coverage_targets: *test_targets_bazel_6 windows_bazel_8: name: Windows (Bazel 8) bazel: 8.x platform: windows build_targets: *build_targets_bazel_6 test_targets: *test_targets_bazel_6 + coverage_flags: *common_coverage_flags + coverage_targets: *test_targets_bazel_6 # Bazel 9 ubuntu2004: - name: Ubuntu 20.04 (Bazel LTS) - bazel: last_rc # TODO: change to 9.x when released + name: Ubuntu 20.04 (Bazel 9) + bazel: 9.x + build_targets: *build_targets + test_targets: *test_targets + coverage_flags: *common_coverage_flags + coverage_targets: *test_targets + macos_intel: + name: MacOS Intel (Bazel 9) + bazel: 9.x + platform: macos build_targets: *build_targets test_targets: *test_targets + coverage_flags: *common_coverage_flags + coverage_targets: *test_targets macos: - name: MacOS (Bazel LTS) - bazel: last_rc # TODO: change to 9.x when released + name: MacOS (Bazel 9) + bazel: 9.x + platform: macos_arm64 build_targets: *build_targets test_targets: *test_targets + coverage_flags: *common_coverage_flags + coverage_targets: *test_targets windows: - name: Windows (Bazel LTS) - bazel: last_rc # TODO: change to 9.x when released + name: Windows (Bazel 9) + bazel: 9.x build_targets: *build_targets test_targets: *test_targets + coverage_flags: *common_coverage_flags + coverage_targets: *test_targets ubuntu_bzlmod: - name: Ubuntu 20.04 (Bazel LTS, bzlmod) - bazel: last_rc # TODO: change to 9.x when released + name: Ubuntu 20.04 (Bazel 9, bzlmod) + bazel: 9.x platform: ubuntu2004 build_flags: - "--enable_bzlmod" @@ -187,7 +253,7 @@ tasks: test_targets: - "//..." - macos_rule_based_toolchains: + macos_intel_rule_based_toolchains: name: macOS rule-based toolchains platform: macos working_directory: examples/rule_based_toolchain @@ -195,3 +261,11 @@ tasks: - "--enable_bzlmod" build_targets: - "//..." + macos_rule_based_toolchains: + name: macOS rule-based toolchains + platform: macos_arm64 + working_directory: examples/rule_based_toolchain + build_flags: + - "--enable_bzlmod" + build_targets: + - "//..." diff --git a/.bcr/presubmit.yml b/.bcr/presubmit.yml index b1335fb19..3a48e3bbb 100644 --- a/.bcr/presubmit.yml +++ b/.bcr/presubmit.yml @@ -3,6 +3,7 @@ matrix: bazel: - 7.x - 8.x + - 9.x tasks: verify_targets: name: "Verify build targets" From a0ededf881ca29d5b75b955475cb04867552d2b6 Mon Sep 17 00:00:00 2001 From: UebelAndre Date: Mon, 2 Mar 2026 13:13:33 -0800 Subject: [PATCH 2/3] Ignore collection failures --- .bazelci/presubmit.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index de169f5fc..898d1fe60 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -31,9 +31,12 @@ test_targets_bazel_6: &test_targets_bazel_6 - "-//tests/rule_based_toolchain/tool_map:_duplicate_action_test_subject" # Intentionally broken rule. - "-//tests/system_library:system_library_test" # Should be skipped on Windows and MacOS -# Test failures are not collected under `coverage` invocations. -# https://github.com/bazelbuild/continuous-integration/issues/1838 common_coverage_flags: &common_coverage_flags + # Starting in Bazel 9 coverage collection causes some tests to fail. + # https://github.com/bazelbuild/rules_cc/issues/613 + - "--test_env=IGNORE_COVERAGE_COLLECTION_FAILURES=1" + # Test failures are not collected under `coverage` invocations. + # https://github.com/bazelbuild/continuous-integration/issues/1838 - "--test_output=errors" buildifier: From a8f7c7e641dc79601ee50cbaef31a452a1166fbc Mon Sep 17 00:00:00 2001 From: UebelAndre Date: Fri, 6 Mar 2026 20:37:25 -0800 Subject: [PATCH 3/3] Remove coverage tests on windows --- .bazelci/presubmit.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index 898d1fe60..02d8c73ac 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -115,8 +115,6 @@ tasks: platform: windows build_targets: *build_targets test_targets: *test_targets - coverage_flags: *common_coverage_flags - coverage_targets: *test_targets # Bazel 6 ubuntu2004_bazel_6: @@ -169,8 +167,6 @@ tasks: platform: windows build_targets: *build_targets_bazel_6 test_targets: *test_targets_bazel_6 - coverage_flags: *common_coverage_flags - coverage_targets: *test_targets_bazel_6 # Bazel 8 ubuntu2004_bazel_8: @@ -203,8 +199,6 @@ tasks: platform: windows build_targets: *build_targets_bazel_6 test_targets: *test_targets_bazel_6 - coverage_flags: *common_coverage_flags - coverage_targets: *test_targets_bazel_6 # Bazel 9 ubuntu2004: @@ -235,8 +229,6 @@ tasks: bazel: 9.x build_targets: *build_targets test_targets: *test_targets - coverage_flags: *common_coverage_flags - coverage_targets: *test_targets ubuntu_bzlmod: name: Ubuntu 20.04 (Bazel 9, bzlmod) bazel: 9.x