Skip to content

Commit 7d6ad05

Browse files
A GooglerBlaze Rules Copybara
authored andcommitted
Remove collect_actions_recursively
It wasn't implemented correctly / the implementation was never finished. PiperOrigin-RevId: 737548039
1 parent d150114 commit 7d6ad05

File tree

3 files changed

+11
-19
lines changed

3 files changed

+11
-19
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
[0.X.0]: https://github.com/bazelbuild/rules_testing/releases/tag/v0.X.0
66

77
## Changed
8+
89
* Add `{bindir}` to formatting variables.
910
* Format values in `ActionsSubject.contains_flag_values()`.
1011
* `CollectionSubject` accepts new constructor parameter `format`. When used
@@ -13,13 +14,21 @@
1314
`action.argv().contains_at_least(["-f", "{bindir}/{package}/input.txt"])`.
1415

1516
### Added
17+
1618
* Nothing yet
1719

20+
### Removed
21+
22+
* Removed `util.recursive_testing_aspect` and
23+
`analysis_test.collect_actions_recursively`. They were never properly
24+
implemented.
25+
1826
## [0.7.0] - 2024-10-29
1927

2028
[0.7.0]: https://github.com/bazelbuild/rules_testing/releases/tag/v0.7.0
2129

2230
### Added
31+
2332
* `matching.any()` and `matching.all()` for composing `Matcher` objects using
2433
"or" and "and" semantics, respectively
2534
* Predicate-variants for RunfilesSubject methods:

lib/private/analysis_test.bzl

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Support for testing analysis phase logic, such as rules.
2020
load("@bazel_skylib//lib:dicts.bzl", "dicts")
2121
load("@bazel_skylib//lib:types.bzl", "types")
2222
load("//lib:truth.bzl", "truth")
23-
load("//lib:util.bzl", "recursive_testing_aspect", "testing_aspect")
23+
load("//lib:util.bzl", "testing_aspect")
2424
load("//lib/private:target_subject.bzl", "PROVIDER_SUBJECT_FACTORIES")
2525
load("//lib/private:util.bzl", "get_test_name_from_function")
2626

@@ -140,7 +140,6 @@ def analysis_test(
140140
fragments = [],
141141
config_settings = {},
142142
extra_target_under_test_aspects = [],
143-
collect_actions_recursively = False,
144143
provider_subject_factories = []):
145144
"""Creates an analysis test from its implementation function.
146145
@@ -216,8 +215,6 @@ def analysis_test(
216215
in your repository's context, not rule_testing's.
217216
extra_target_under_test_aspects: An optional list of aspects to apply to the target_under_test
218217
in addition to those set up by default for the test harness itself.
219-
collect_actions_recursively: If true, runs testing_aspect over all attributes, otherwise
220-
it is only applied to the target under test.
221218
provider_subject_factories: Optional list of ProviderSubjectFactory structs,
222219
these are additional provider factories on top of built in ones.
223220
A ProviderSubjectFactory is a struct with the following fields:
@@ -264,10 +261,7 @@ def analysis_test(
264261
target_under_test_cfg = None
265262

266263
applied_aspects = []
267-
if collect_actions_recursively:
268-
applied_aspects.append(recursive_testing_aspect)
269-
else:
270-
applied_aspects.append(testing_aspect)
264+
applied_aspects.append(testing_aspect)
271265
applied_aspects.extend(extra_target_under_test_aspects)
272266

273267
target_under_test_attr_names = []

lib/util.bzl

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -177,16 +177,6 @@ testing_aspect = aspect(
177177
implementation = _testing_aspect_impl,
178178
)
179179

180-
# The same as `testing_aspect`, but recurses through all attributes in the
181-
# whole graph. This is useful if you need to extract information about
182-
# targets that aren't direct dependencies of the target under test, or to
183-
# reconstruct a more complete graph of inputs/outputs/generating-target.
184-
# TODO(ilist): make private, after switching python tests to new testing framework
185-
recursive_testing_aspect = aspect(
186-
implementation = _testing_aspect_impl,
187-
attr_aspects = ["*"],
188-
)
189-
190180
def get_target_attrs(env):
191181
return analysistest.target_under_test(env)[TestingAspectInfo].attrs
192182

@@ -264,7 +254,6 @@ util = struct(
264254
force_exec_config = force_exec_config,
265255
helper_target = helper_target,
266256
merge_kwargs = merge_kwargs,
267-
recursive_testing_aspect = recursive_testing_aspect,
268257
runfiles_map = runfiles_map,
269258
runfiles_paths = runfiles_paths,
270259
short_paths = short_paths,

0 commit comments

Comments
 (0)