@@ -9,7 +9,6 @@ _IOS_TEST_KWARGS = [
9
9
"bundle_id" ,
10
10
"bundle_name" ,
11
11
"env" ,
12
- "features" ,
13
12
"flaky" ,
14
13
"frameworks" ,
15
14
"infoplists" ,
@@ -34,7 +33,6 @@ _APPLE_BUNDLE_ATTRS = {
34
33
"bundle_id" ,
35
34
"bundle_name" ,
36
35
"families" ,
37
- "features" ,
38
36
"frameworks" ,
39
37
"infoplists" ,
40
38
"linkopts" ,
@@ -45,6 +43,22 @@ _APPLE_BUNDLE_ATTRS = {
45
43
]
46
44
}
47
45
46
+ # See: https://bazel.build/reference/be/common-definitions#common-attributes
47
+ # NOTE: `testonly` arent listed because we have custom logic for them in here.
48
+ _ALWAYS_AVAILABLE_ATTRS = [
49
+ "compatible_with" ,
50
+ "deprecation" ,
51
+ "distribs" ,
52
+ "exec_compatible_with" ,
53
+ "exec_properties" ,
54
+ "features" ,
55
+ "restricted_to" ,
56
+ "tags" ,
57
+ "target_compatible_with" ,
58
+ "toolchains" ,
59
+ "visibility" ,
60
+ ]
61
+
48
62
_DEFAULT_APPLE_TEST_RUNNER = "@build_bazel_rules_apple//apple/testing/default_runner:ios_default_runner"
49
63
50
64
def _make_runner_split (name , runner , ** in_split ):
@@ -104,7 +118,7 @@ def _make_test(name, test_rule, **kwargs):
104
118
Helper to create an individual test
105
119
"""
106
120
runner = kwargs .pop ("runner" , None ) or _DEFAULT_APPLE_TEST_RUNNER
107
- test_attrs = {k : v for (k , v ) in kwargs .items () if k not in _APPLE_BUNDLE_ATTRS }
121
+ test_attrs = {k : v for (k , v ) in kwargs .items () if ( k not in _APPLE_BUNDLE_ATTRS ) or ( k in _ALWAYS_AVAILABLE_ATTRS ) }
108
122
109
123
test_rule (
110
124
name = name ,
@@ -159,7 +173,7 @@ def _ios_test(name, bundle_rule, test_rule, test_factory, apple_library, infopli
159
173
"""
160
174
161
175
testonly = kwargs .pop ("testonly" , True )
162
- ios_test_kwargs = {arg : kwargs .pop (arg ) for arg in _IOS_TEST_KWARGS if arg in kwargs }
176
+ ios_test_kwargs = {arg : kwargs .pop (arg ) for arg in ( _IOS_TEST_KWARGS + _ALWAYS_AVAILABLE_ATTRS ) if arg in kwargs }
163
177
ios_test_kwargs ["data" ] = kwargs .pop ("test_data" , [])
164
178
165
179
test_exec_properties = kwargs .pop ("test_exec_properties" , None )
@@ -218,7 +232,7 @@ def _ios_test(name, bundle_rule, test_rule, test_factory, apple_library, infopli
218
232
219
233
# Set this to a single __internal__ test bundle.
220
234
test_bundle_name = name + ".__internal__.__test_bundle"
221
- bundle_attrs = {k : v for (k , v ) in ios_test_kwargs .items () if k in _APPLE_BUNDLE_ATTRS }
235
+ bundle_attrs = {k : v for (k , v ) in ios_test_kwargs .items () if ( k in _APPLE_BUNDLE_ATTRS ) or ( k in _ALWAYS_AVAILABLE_ATTRS ) }
222
236
bundle_name = bundle_attrs .pop ("bundle_name" , name )
223
237
bundle_rule (
224
238
name = test_bundle_name ,
0 commit comments