test_runner: propagate only to test ancestors#48932
test_runner: propagate only to test ancestors#48932MoLow wants to merge 5 commits intonodejs:mainfrom
Conversation
|
Review requested:
|
|
I haven't reviewed or tested this, but some initial thoughts:
This seems like it would be more confusing than what we currently have.
I don't think this is going to end up in a very efficient design. Unless I'm mistaken, it also doesn't solve the problem of an I think it would probably be better to keep the As a side note: I think solving #46728 would be more useful since it overlaps a lot with this feature and also makes IDE integration significantly better. I believe that issue can be solved in the current state of the test runner, but could also be solved by building the entire test tree. |
you are mistaken (It might have a bug, but the intent is for a test at any level to cause all other tests to be skipped). describe('top level', () => {
describe('nested', () => {
describe('nested', () => {
it.only('only', (t) => {
t.diagnostic('only')
});
it('this is a test', () => {});
it('this is a test', () => {});
});
it('this is a test', () => {});
});
it('this is a test', () => {});
});
it.only('this is a test', () => {});
it('this is a test', () => {
console.log('this is a test')
});▶ top level
▶ nested
▶ nested
✔ only (0.208458ms)
ℹ only
﹣ this is a test (0.090208ms) # SKIP
﹣ this is a test (0.041084ms) # SKIP
▶ nested (1.021583ms)
﹣ this is a test (0.077125ms) # SKIP
▶ nested (1.2045ms)
﹣ this is a test (0.031ms) # SKIP
▶ top level (1.404667ms)
✔ this is a test (0.037875ms)
﹣ this is a test (0.041542ms) # SKIP
ℹ tests 7
ℹ suites 3
ℹ pass 2
ℹ fail 0
ℹ cancelled 0
ℹ skipped 5
ℹ todo 0
ℹ duration_ms 2.580958
doing this won't solve the multiple files issue. |
only to not need --test-only|
@cjihrig Following our discussion, I have updated the pr |
f71a3ed to
e82455f
Compare
This comment was marked as outdated.
This comment was marked as outdated.
|
seems like we might want to still require |
d3c2853 to
c818aab
Compare
0e09ada to
0017181
Compare
0017181 to
a08c687
Compare
|
@MoLow are you still planning to work on this? I think it makes sense to implement this for suites now. If you don't want to, I'd be happy to take a shot at it. |
Taking a look now |
Fixes: #47945
this PR is broken into smaller commits that are intended to be logically independent and easier to review.
some limitations/todos:
This only works for a single file. meaningtest.onlywill skip all tests in that file, but not in other files.solving this is much less trivial since it requires some kind of two-way communication between the test file and the parent process, in between the enqueue and the dequeue phases.
we should consider if this solution is a big enough improvement compared to the current behavior for it to be released, or if we should solve multiple files as well
need to document deprecation of--run-only--test-onlywith multiple files