Commit 08e228d
Introduce
Closes #24817
## What this change does
Introduce `autoTestDiscoverOnSavePattern` configuration option to
control `autoTestDiscoverOnSaveEnabled` behavior to only attempt test
discovery refresh when files matching the specified glob pattern are
saved.
## Why this change
In a Python project we have with over 40K tests, developers definitely
notice issues when pytest discovery is running whenever any file in the
workspace is saved, despite all tests matching a very consistent pattern
(`./tests/**/test_*.py`).
## Other alternatives I considered
I did consider trying to match only the specific patterns used by
unittest/pytest here. Given that would require parsing underlying
configuration files / raw args in the test configuration for the
workspace for both unittest and pytest (plus any other test runners
supported in future) - I don't think that's going to be easy to
maintain. Plus the addition / deletion of `__init__.py` files play a
significant part in test discovery despite not being covered by the test
configuration pattern - so this solution would be incomplete.
Another alternative would be to accept a parent directory and only
include python files from that directory + subdirectories (using
workspace directory as default value). This avoids introducing a glob
configuration value, but feels very limiting.
---------
Co-authored-by: Eleanor Boyd <[email protected]>autoTestDiscoverOnSavePattern configuration option (#24728)1 parent 79e8a13 commit 08e228d
File tree
6 files changed
+15
-2
lines changed- resources
- src/client
- common
- testing
- configuration
- testController
6 files changed
+15
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
657 | 657 | | |
658 | 658 | | |
659 | 659 | | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
660 | 666 | | |
661 | 667 | | |
662 | 668 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| 77 | + | |
77 | 78 | | |
78 | 79 | | |
79 | 80 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
| 82 | + | |
| 83 | + | |
83 | 84 | | |
84 | 85 | | |
85 | 86 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
320 | 320 | | |
321 | 321 | | |
322 | 322 | | |
| 323 | + | |
323 | 324 | | |
324 | 325 | | |
325 | 326 | | |
| |||
336 | 337 | | |
337 | 338 | | |
338 | 339 | | |
| 340 | + | |
339 | 341 | | |
340 | 342 | | |
341 | 343 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
552 | 553 | | |
553 | 554 | | |
554 | 555 | | |
555 | | - | |
| 556 | + | |
| 557 | + | |
556 | 558 | | |
557 | 559 | | |
558 | 560 | | |
| |||
0 commit comments