-
Notifications
You must be signed in to change notification settings - Fork 5
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
v4 output results in NullPointerException when used in Jenkins #32
Comments
This sounds like it might be something on my end, Do you mind posting the command line you pass to run tap-junit? And if possible 1 or 2 of your tests tap output if you could and I can get a working example on my end. I think it's literally just a naming issue if I'm not putting the name in right then that's something I need to correct right away, or maybe its the arguments being passed in! |
Sure, though I had to redact parts. I just realised we control the TAP output, so it could be we made a mistake there that accidentally worked with tap-junit version 3. A tap file: TAP version 13
# @scope/package
ok 1 - Package @scope/package is using registered runtime dependency @angular/core
ok 2 - Package @scope/package is using registered runtime dependency @angular/cdk
ok 3 - Package @scope/package is using registered runtime dependency rxjs
ok 4 - Package @scope/package's dependency @angular/cdk is used
ok 5 - Package @scope/package's dependency @angular/core is used
ok 6 - Package @scope/package's dependency rxjs is used
1..6 The command: tap-junit -o results -n dependencies.xml <results/dependencies.tap The output with tap-junit 3: <?xml version="1.0"?>
<testsuites tests="6" name="Tap-Junit" failures="0" errors="0">
<testsuite tests="6" failures="0" errors="0" name="@scope/package">
<testcase name="#1 Package @scope/package is using registered runtime dependency @angular/core"/>
<testcase name="#2 Package @scope/package is using registered runtime dependency @angular/cdk"/>
<testcase name="#3 Package @scope/package is using registered runtime dependency rxjs"/>
<testcase name="#4 Package @scope/package's dependency @angular/cdk is used"/>
<testcase name="#5 Package @scope/package's dependency @angular/core is used"/>
<testcase name="#6 Package @scope/package's dependency rxjs is used"/>
</testsuite>
</testsuites> The output with tap-junit 4 (pretty-printed): <?xml version="1.0"?>
<testsuites tests="6" name="Tap-Junit" failures="0">
<testsuite tests="6" skipped="0" failures="0">
<testcase name="Package @scope/package is using registered runtime dependency @angular/core" id="1"># @scope/package
</testcase>
<testcase name="Package @scope/package is using registered runtime dependency @angular/cdk" id="2"></testcase>
<testcase name="Package @scope/package is using registered runtime dependency rxjs" id="3"></testcase>
<testcase name="Package @scope/package's dependency @angular/cdk is used" id="4"></testcase>
<testcase name="Package @scope/package's dependency @angular/core is used" id="5"></testcase>
<testcase name="Package @scope/package's dependency rxjs is used" id="6"></testcase>
</testsuite>
</testsuites> |
It looks like maybe your plugin is expecting a name on testsuite, though I didn't see that in the junit specs, I can probably add it without it affecting much. It won't use your This is why it shows up in the first testcase as text. The parser takes it in as a tap comment and thinks it applies to the test that comes next. The sad part is I can't make out anything to pull that comment as a name instead of just a comment. So we may need to do something fancy there. |
I released v4.1.0, try using the new |
Caveat: I don't know the junit.xml format at all, so my apologies if this is a bug in Jenkins rather than
tap-junit
. I opened this ticket because it works when usingtap-junit
version 3.Describe the bug
Jenkins builds fail with a NullPointerException when passing output of
tap-junit
version 4 to thejunit
plugin.This is caused by the lack of a
name
attribute on thetestsuite
element. Jenkins falls back to that attribute if noclassname
attribute is present on atestcase
(source).To Reproduce
tap-junit
junit
pluginExpected behavior
The XML file is parsed by Jenkins
The text was updated successfully, but these errors were encountered: