-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TRX reporter is not reporting the hook failures #21
Comments
Hi @goelankit. Could you provide more details about your case?
If you could attach a minimum reproducible example it would be great. Thanks. |
Hi @pmoleri , I think it might not be working as expected in the mocha parallel mode. I see that if I run the test in sequenced mode the report come up fine. Mocha version: 8.0.1 Please find attached the minimal repro for this.
Similar for Skipped test showing up as "Inconclusive" in parallel mode.
We have our tests configured to run in parallel mode, and really looking forward to be able to consume mocha-trx-reporter in parallel mode as well. |
@goelankit Also consider that reporting failed hooks is something that I included in this reporter, but I haven't seen in other reporters. To sum up: |
@pmoleri , I think the issue is happening due to how the pending information for the test is surfaced between sequenced and parallel execution (which is perhaps a mocha issue). In parallel run, test.isPending() is how the info is available. If I change line 97 in test-to-trx.js to,
I see the output trx report getting generated fine for for parallel runs as well now with this change. The test gets marked correctly as pending now instead of inconclusive. I was not able to push a branch to the repo, any chance you can take a look at the change and get it in. Thanks in advance! |
Hi @pmoleri , Gentle reminder on this. Can you please check my previous reply and incorporate the change (zip file attached) in the code. Thanks! |
Hi @pmoleri , Gentle reminder on this. Can you please check @goelankit 's previous reply and incorporate the change (zip file attached) in the code. Thanks! |
The TRX reporter is not handling the hook failures correctly.
The condition here in "suite end" handler seems to be incorrect.
runner.on('suite end', (suite) => {
if (failedHook && failedHook.parent === suite) {
This is what I am seeing in debug console.
failedHook.parent
{root: false, title: '#test1()'}
root:false
title:'#test1()'
proto:Object
suite
{_bail: false, root: false, title: '#test1()', fullTitle: ƒ}
_bail:false
fullTitle:() => value
root:false
title:'#test1()'
proto:Object
failedHook.parent === suite
false
Since the failedHook.parent is not equal to suite, hook failures doesn't get reported in the trx reports.
The text was updated successfully, but these errors were encountered: