From 721d577d934ba717f3aaa16baf33bd43349d3b6f Mon Sep 17 00:00:00 2001 From: Florian Weikert Date: Thu, 21 Nov 2024 17:50:23 +0100 Subject: [PATCH] Improve accuracy of test filtering on MaOS/Windows (#2115) There's no easy way to get the values of --test_tag_filters in .bazelrc, so we work around the problem by excluding commonly used tags such as no_windows and no_macos. --- buildkite/bazelci.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/buildkite/bazelci.py b/buildkite/bazelci.py index 7b7d118e43..9a9be648f8 100755 --- a/buildkite/bazelci.py +++ b/buildkite/bazelci.py @@ -2140,7 +2140,6 @@ def calculate_targets( if not use_bazel_diff and not sharding_enabled: return build_targets, test_targets, coverage_targets, index_targets - # TODO(#1614): Fix target expansion expanded_test_targets = expand_test_target_patterns(bazel_binary, test_targets, test_flags) actual_test_targets = ( @@ -2252,7 +2251,14 @@ def get_test_tags(test_flags): return include, exclude - return [], ["manual"] + exclude = ["manual"] + # Workaround for --test_tag_filters in .bazelrc + if is_mac(): + exclude.append("no_macos") + elif is_windows(): + exclude.append("no_windows") + + return [], exclude def removeprefix(s, prefix):