Skip to content
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

Exit code always 0 with multiple reporters #393

Closed
walling opened this issue Jul 3, 2015 · 9 comments
Assignees
Labels
bug
Milestone

Comments

@walling
Copy link

@walling walling commented Jul 3, 2015

Running with a single or just the default reporter lab returns exit code 1 for failed tests. It seems not to be the case, when running with multiple reporters. To reproduce:

  1. Create failing test case test.js:

    var lab = exports.lab = require("lab").script();
    
    lab.test('fail', function(done) {
        done(new Error('fail'));
    });
  2. Run with default reporter (exit code is 1):

    lab test.js; echo $?
  3. Run with multiple reporters (exit code is 0):

    lab -r console -o stdout -r html -o cov.html test.js; echo $?

It could be nice to get this fixed, so you can run your continues integration build with multiple reporters. I don't have time for a pull request right now, but I might look into it later.

@geek geek added the bug label Jul 6, 2015
@bapti

This comment has been minimized.

Copy link

@bapti bapti commented Jul 6, 2015

Hopefully this will fix

#396

@hofan41

This comment has been minimized.

Copy link
Contributor

@hofan41 hofan41 commented Jul 6, 2015

@bapti I don't think that will fix it, since the bug exists in multiple.js not doing process.exit.

@walling

This comment has been minimized.

Copy link
Author

@walling walling commented Jul 10, 2015

Is it possible to replicate the finalize logic from reporters/index.js in multiple.js?

@hofan41

This comment has been minimized.

Copy link
Contributor

@hofan41 hofan41 commented Jul 10, 2015

I have a fix for this will submit a PR shortly.

On Friday, July 10, 2015, Bjarke Walling notifications@github.com wrote:

Is it possible to replicate the finalize logic from reporters/index.js
https://github.com/hapijs/lab/blob/master/lib/reporters/index.js#L86-L102
in multiple.js?


Reply to this email directly or view it on GitHub
#393 (comment).

@lloydbenson

This comment has been minimized.

Copy link
Contributor

@lloydbenson lloydbenson commented Jul 26, 2015

I get an error when using multiple reporters that I believe this does fix. Instead of what you describe in io.js I see something like:
../node_modules/lab/lib/reporters/multiple.js:95
callback(self._results.err, self._results.code, self._results.outp
^
TypeError: callback is not a function

I see indeed that callback is undefined for the reporters. When I put in the code block you have however, when its doing an if callback clause this error seems to go away. Thanks for getting this fixed but just an FYI in case others run into multiple reporter issues with different symptoms.

@lloydbenson

This comment has been minimized.

Copy link
Contributor

@lloydbenson lloydbenson commented Jul 26, 2015

@geek any updates with this one and if it looks good can we get it merged and published?

@geek geek added this to the 5.14.0 milestone Jul 27, 2015
@geek geek closed this in #406 Jul 27, 2015
@geek

This comment has been minimized.

Copy link
Member

@geek geek commented Jul 27, 2015

@hofan41 you are my hero, thanks for fixing this issue.

@Marsup

This comment has been minimized.

Copy link
Member

@Marsup Marsup commented May 30, 2016

@hofan41 can you please do something to secure your account ? Thanks...

Screenshot of posts I deleted

@hofan41

This comment has been minimized.

Copy link
Contributor

@hofan41 hofan41 commented May 31, 2016

Apologies, I have added additional protections DKIM/DMARC/SPF to my email domain in hopes that this will prevent these spoofed messages from being received.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.