You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Test runner with junit reporter and forceExit flag results in incomplete report #54327
This is what we get without passing the --test-force-exit flag. Also, other test-reporters (e.g. tap) don't seem to be affected by the flag, i.e. they produce the same report regardless of if the flag is passed or not.
What do you see instead?
test-results.xml is an incomplete file with the following content:
@redyetidev are you sure your setup acutally detects the test file? It looks suspicious that all your reports state 0 tests. Can you try naming the file index.test.js, or alternatively explicity specify the file when running node --test [...]?
I'm looking into it. It looks like the close event is being emitted before the stream actually finishes. it could be because the composed stream is not the same as the reporter?
Activity
avivkeller commentedon Aug 12, 2024
samuelmurray commentedon Aug 12, 2024
@redyetidev are you sure your setup acutally detects the test file? It looks suspicious that all your reports state 0 tests. Can you try naming the file
index.test.js, or alternatively explicity specify the file when runningnode --test [...]?avivkeller commentedon Aug 12, 2024
Haha! I forgot to name the file, you are correct, sorry! Reproduction results:
$ node --test-reporter junit --test-reporter-destination test-results.xml --test --test-force-exit$ node --test-reporter junit --test-reporter-destination test-results.xml --test$ node --test-reporter tap --test-reporter-destination test-results.tap --test --test-force-exit$ node --test-reporter tap --test-reporter-destination test-results.tap --testThe file is named
index.test.mjs(mjsfor module features)I've hidden my older to comment to prevent confusion.
cjihrig commentedon Aug 12, 2024
I'm guessing we need more logic around here when we're using any file destinations.
MoLow commentedon Aug 16, 2024
I am on vacation without a computer until mid-september, I will give a look when I am back if no one else does before me
avivkeller commentedon Sep 14, 2024
I'm looking into it. It looks like the
closeevent is being emitted before the stream actually finishes. it could be because thecomposed stream is not the same as thereporter?avivkeller commentedon Sep 15, 2024
I have a patch. Just gotta add tests
avivkeller commentedon Sep 15, 2024
See #54953
test_runner: close and flush destinations on forced exit
test_runner: close and flush destinations on forced exit
test_runner: close and flush destinations on forced exit