nodejs test suite integration with xunit reporter

Facundo Cabrera's Avatar

Facundo Cabrera

13 Aug, 2014 12:43 AM

Hey,

I'm using your service to run a test suite with nodejs and I want to integrate the tests report in a better way. I can enable the xunit reporter at the moment I run the tests, so the question is: Is there a way to create a notification using the xunit output? I'm looking for something better than an email saying "success" or "failure".

Thanks!

  1. 1 Posted by Facundo Cabrera on 13 Aug, 2014 01:36 AM

    Facundo Cabrera's Avatar

    I'm checking the code for mocha reporters and it should be extremely easy to create a custom reporter for appveyor to show the test directly in the tests tab.

    Example: https://github.com/visionmedia/mocha/blob/master/lib/reporters/xuni...

    What do you think?

  2. Support Staff 2 Posted by Feodor Fitsner on 13 Aug, 2014 04:33 AM

    Feodor Fitsner's Avatar

    Hi Facundo,

    Yeah, I think it's doable. First, we have Build Worker REST API for pushing test results in a real-time. Take a look how it's made in xUnit: https://github.com/xunit/xunit/blob/master/src/xunit.console/Visito...
    xUnit reporter from Mocha looks very similar!

    Second, there is another way to push results in XML format: http://www.appveyor.com/docs/running-tests#test-results

    Let me know if you have any questions.

  3. 3 Posted by Facundo Cabrera on 13 Aug, 2014 04:51 AM

    Facundo Cabrera's Avatar

    For now I'm doing the following:

    1. Run mocha and generate a json report.
    2. I have created an PS script to parse the json report and call the command Add-AppveyorTest "Test A" -Outcome Passed -Duration 1000 # in milliseconds with the correct information per test executed.

    Should I embed the script into the appveyor.yml? because I didn't see an example calling a .ps file hooking the after_test property

    Thanks!

  4. 4 Posted by Facundo Cabrera on 13 Aug, 2014 05:16 AM

    Facundo Cabrera's Avatar

    Yay, it works!

    https://ci.appveyor.com/project/dendril/generator-tamagotchi/build/...

    If you have any comments, please let me know :D

  5. Support Staff 5 Posted by Feodor Fitsner on 13 Aug, 2014 03:45 PM

    Feodor Fitsner's Avatar

    Cool, thanks for the update!

    I can only add that if you have more than 100 tests a better way to push them to a build console could be calling REST API directly and in batches: http://www.appveyor.com/docs/build-worker-api#add-tests

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

17 Jun, 2018 04:04 PM
16 Jun, 2018 08:06 PM
16 Jun, 2018 07:30 PM
16 Jun, 2018 09:22 AM
15 Jun, 2018 09:31 PM

 

15 Jun, 2018 08:31 PM
15 Jun, 2018 04:29 PM
15 Jun, 2018 12:39 PM
15 Jun, 2018 12:37 PM
15 Jun, 2018 08:21 AM
14 Jun, 2018 12:44 AM