Open pauldraper opened 3 years ago
cc @lberki
I think it's a reasonable addition, although I haven't gamed out all the possible implications in my head.
I found some references to such a feature in the code (https://cs.opensource.google/bazel/bazel/+/master:src/main/java/com/google/devtools/build/lib/buildeventstream/TestFileNameConstants.java;l=37;drc=38117d4072df3c8d76591b39e36167b9fde66662). Is this available with the Google-internal test runner implementation?
No, it's not that (if we had this feature internally, we'd just open source it!)
It's a way to automatically detect which input files of a test were unused (IIRC by looking at atimes) to facilitate dependency pruning in BUILD files. It doesn't change what Blaze considers the action graph, it's only for diagnostics.
Description of the problem / feature request:
Allow tests to be dependency pruned, for better caching.
Feature requests: what underlying problem are you trying to solve with this feature?
unused_input_list in actions addresses the problem of over-declared inputs. https://docs.bazel.build/versions/1.2.0/skylark/lib/actions.html#run
Tests have this same problem. Testing performance could be improved if unused inputs could be listed.
A number of testing frameworks have this feature (JS and Go).
Workaround
One workaround to achieve this is to convert tests into actions with unused_input_list, and use
bazel build
to "test." But this gives up a lot of the ergonomics aroundbazel test
.