Commit d0c75ff
committed
Provide
This option is similar to `--instrumentation_filter` option. The difference
is this option can be used multiple times to accumulate its values. If this
option is provided `--instrumentation_filter` has no effect.
Multiple uses of `--instrumentation_filter` are not accumulated. This makes
it difficult to have short hand configuration flags for a combination of
coverage flags in a bazelrc file. e.g.,
```
build:covA --instrumentation_filter=afoo/abar,-afoo/abaz
build:covB --instrumentation_filter=bfoo/bbar,-bfoo/bbaz
build:covC --instrumentation_filter=cfoo/cbar,-cfoo/cbaz
\# To combine the flags concatenate the respective filter strings
build:covAB --instrumentation_filter=afoo/abar,-afoo/abaz,bfoo/bbar,-bfoo/bbaz
build:covAC --instrumentation_filter=afoo/abar,-afoo/abaz,cfoo/cbar,-cfoo/cbaz
build:covABC --instrumentation_filter=afoo/abar,-afoo/abaz,bfoo/bbar,-bfoo/bbaz,cfoo/cbar,-cfoo/cbaz
```
With a large set of flags and their respective large filter strings it is uneasy
to combine the short hand configuration flags because the respective filter strings
need to be concatenated into a single string. This is uneasy to maintain because
filter strings are repeated in the combinations.
`--experimental_instrumentation_filter_fragment` simplifies combining multiple shorthand
configuration flags because its multiple uses are accumulated. e.g.,
```
build:covA --experimental_instrumentation_filter_fragment=afoo/abar,-afoo/abaz
build:covB --experimental_instrumentation_filter_fragment=bfoo/bbar,-bfoo/bbaz
build:covC --experimental_instrumentation_filter_fragment=cfoo/cbar,-cfoo/cbaz
build:covAB --config covA --config covB
build:covAC --config covA --config covC
build:covABC --config covA --config covB --config covC
```
Add tests for --experimental_instrumentation_filter_fragment cli to verify that its
multiple uses are accumulated and --instrumentation_filter has no effect
when --experimental_instrumentation_filter_fragment is used.
bazelbuild#22959 is the upstream issue.
Testing Done:
```
$ bazelisk test src/test/java/com/google/devtools/build/lib/starlark:all
INFO: Analyzed 4 targets (0 packages loaded, 0 targets configured).
INFO: Found 1 target and 3 test targets...
INFO: Elapsed time: 242.197s, Critical Path: 216.72s
INFO: 27 processes: 1 internal, 25 darwin-sandbox, 1 worker.
INFO: Build completed successfully, 27 total actions
//src/test/java/com/google/devtools/build/lib/starlark:BindTest (cached) PASSED in 7.5s
//src/test/java/com/google/devtools/build/lib/starlark:StarlarkRuleClassFunctionsTest (cached) PASSED in 78.0s
Stats over 5 runs: max = 78.0s, min = 59.8s, avg = 73.9s, dev = 7.1s
//src/test/java/com/google/devtools/build/lib/starlark:StarlarkTests PASSED in 121.1s
Stats over 25 runs: max = 121.1s, min = 24.8s, avg = 88.6s, dev = 32.1s
Executed 1 out of 3 tests: 3 tests pass.
There were tests whose specified size is too big. Use the --test_verbose_timeout_warnings command line option to see which ones these are.
```--experimental_instrumentation_filter_fragment cli option1 parent 29f7c86 commit d0c75ff
File tree
3 files changed
+109
-1
lines changed- src
- main/java/com/google/devtools/build/lib/analysis/config
- test/java/com/google/devtools/build/lib/starlark
3 files changed
+109
-1
lines changedLines changed: 18 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
| 48 | + | |
47 | 49 | | |
48 | 50 | | |
49 | 51 | | |
| |||
143 | 145 | | |
144 | 146 | | |
145 | 147 | | |
| 148 | + | |
| 149 | + | |
146 | 150 | | |
147 | 151 | | |
148 | 152 | | |
| |||
298 | 302 | | |
299 | 303 | | |
300 | 304 | | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
301 | 318 | | |
302 | 319 | | |
303 | 320 | | |
| |||
566 | 583 | | |
567 | 584 | | |
568 | 585 | | |
569 | | - | |
| 586 | + | |
570 | 587 | | |
571 | 588 | | |
572 | 589 | | |
| |||
Lines changed: 17 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
274 | 275 | | |
275 | 276 | | |
276 | 277 | | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
277 | 294 | | |
278 | 295 | | |
279 | 296 | | |
| |||
Lines changed: 74 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3020 | 3020 | | |
3021 | 3021 | | |
3022 | 3022 | | |
| 3023 | + | |
| 3024 | + | |
| 3025 | + | |
| 3026 | + | |
| 3027 | + | |
| 3028 | + | |
| 3029 | + | |
| 3030 | + | |
| 3031 | + | |
| 3032 | + | |
| 3033 | + | |
| 3034 | + | |
| 3035 | + | |
| 3036 | + | |
| 3037 | + | |
| 3038 | + | |
| 3039 | + | |
| 3040 | + | |
| 3041 | + | |
| 3042 | + | |
| 3043 | + | |
| 3044 | + | |
| 3045 | + | |
| 3046 | + | |
| 3047 | + | |
| 3048 | + | |
| 3049 | + | |
| 3050 | + | |
| 3051 | + | |
| 3052 | + | |
| 3053 | + | |
| 3054 | + | |
| 3055 | + | |
| 3056 | + | |
| 3057 | + | |
| 3058 | + | |
| 3059 | + | |
| 3060 | + | |
| 3061 | + | |
| 3062 | + | |
| 3063 | + | |
| 3064 | + | |
| 3065 | + | |
| 3066 | + | |
| 3067 | + | |
| 3068 | + | |
| 3069 | + | |
| 3070 | + | |
| 3071 | + | |
| 3072 | + | |
| 3073 | + | |
| 3074 | + | |
| 3075 | + | |
| 3076 | + | |
| 3077 | + | |
| 3078 | + | |
| 3079 | + | |
| 3080 | + | |
| 3081 | + | |
| 3082 | + | |
| 3083 | + | |
| 3084 | + | |
| 3085 | + | |
| 3086 | + | |
| 3087 | + | |
| 3088 | + | |
| 3089 | + | |
| 3090 | + | |
| 3091 | + | |
| 3092 | + | |
| 3093 | + | |
| 3094 | + | |
| 3095 | + | |
| 3096 | + | |
3023 | 3097 | | |
3024 | 3098 | | |
3025 | 3099 | | |
| |||
0 commit comments