[JIRA] [zephyr-enterprise-test-management-plugin] (JENKINS-30091) Null pointer exception when importing xml containing only passing test cases

309 views
Skip to first unread message

david1.gonzalez@intel.com (JIRA)

unread,
Aug 21, 2015, 1:19:01 PM8/21/15
to jenkinsc...@googlegroups.com
David Gonzalez created an issue
 
Jenkins / Bug JENKINS-30091
Null pointer exception when importing xml containing only passing test cases
Issue Type: Bug Bug
Assignee: Zephyr Developer
Components: zephyr-enterprise-test-management-plugin
Created: 21/Aug/15 5:18 PM
Environment: Jenkins 1.624
Jira – internally hosted: v6.3.7
Zephyr for Jira and Zapi
Labels: plugin
Priority: Major Major
Reporter: David Gonzalez

Importing xUnit XML for a suite of test cases which does not contain a failure results in a Null pointer exception.
Using xml generated from the python unittest framework for a suite with two passing test cases, we encountered a Null pointer exception:

[ZapiTestResultReporter] [INFO] Examining test results...
Build result is SUCCESS
Total Test Cases : 2ERROR: Build step failed with exception
java.lang.NullPointerException
at com.thed.zephyr.jenkins.utils.rest.TestCaseUtil.executeTests(TestCaseUtil.java:331)
at com.thed.zephyr.jenkins.utils.rest.TestCaseUtil.processTestCaseDetails(TestCaseUtil.java:441)
at com.thed.zephyr.jenkins.reporter.ZfjReporter.perform(ZfjReporter.java:98)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:726)
at hudson.model.Build$BuildExecution.post2(Build.java:185)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:671)
at hudson.model.Run.execute(Run.java:1766)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:381)
Build step 'Publish test result to Zephyr for JIRA' marked build as failure

Looking through the source code, we noticed in TestCaseUtil.java#L331, that response is closed when passList.size > 0. However, response becomes non null only if the failList.size > 0 in line 326. Line 331 should check to see if response != null before attempting to close and continue if it is null.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.2#64017-sha1:e244265)
Atlassian logo

developer@getzephyr.com (JIRA)

unread,
Aug 24, 2015, 6:01:03 PM8/24/15
to jenkinsc...@googlegroups.com
Zephyr Developer updated an issue
Change By: Zephyr Developer
Component/s: zephyr-for-jira-test-management-plugin
Component/s: zephyr-enterprise-test-management-plugin

scm_issue_link@java.net (JIRA)

unread,
Aug 26, 2015, 1:28:01 PM8/26/15
to jenkinsc...@googlegroups.com

knut.karlsen@chyronhego.com (JIRA)

unread,
Sep 2, 2015, 6:39:02 AM9/2/15
to jenkinsc...@googlegroups.com

I think we get the same issue in our Zephyr>Jira job:

[xUnit] [INFO] - Check 'Failed Tests' threshold.
[xUnit] [INFO] - The total number of tests for this category exceeds the specified 'unstable' threshold value.
[xUnit] [INFO] - Setting the build status to UNSTABLE
[xUnit] [INFO] - Stopping recording.
Build step 'Publish xUnit test result report' changed build result to UNSTABLE
[ZapiTestResultReporter] [INFO] Examining test results...
Build result is UNSTABLE
Total Test Cases : 478ERROR: Build step failed with exception
java.lang.NullPointerException
	at com.thed.zephyr.jenkins.utils.rest.TestCaseUtil.assignTests(TestCaseUtil.java:218)
	at com.thed.zephyr.jenkins.utils.rest.TestCaseUtil.processTestCaseDetails(TestCaseUtil.java:411)
	at com.thed.zephyr.jenkins.reporter.ZfjReporter.perform(ZfjReporter.java:98)
	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
	at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:726)
	at hudson.model.Build$BuildExecution.post2(Build.java:185)
	at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:671)
	at hudson.model.Run.execute(Run.java:1766)
	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
	at hudson.model.ResourceController.execute(ResourceController.java:98)
	at hudson.model.Executor.run(Executor.java:408)
Build step 'Publish test result to Zephyr for JIRA' marked build as failure
Finished: FAILURE

It fails at a different point though:
TestCaseUtil.java:218

Knut

knut.karlsen@chyronhego.com (JIRA)

unread,
Sep 2, 2015, 7:14:01 AM9/2/15
to jenkinsc...@googlegroups.com

The above error is likely to be due to plugin mismatch on the JIRA server side, to be updated.

vladimir_luschik@docupace.com (JIRA)

unread,
Sep 3, 2015, 2:53:02 PM9/3/15
to jenkinsc...@googlegroups.com

I've got the same error :

Recording test results


[ZapiTestResultReporter] [INFO] Examining test results...

Build result is SUCCESS
Total Test Cases : 3ERROR: Build step failed with exception
java.lang.NullPointerException


at com.thed.zephyr.jenkins.utils.rest.TestCaseUtil.executeTests(TestCaseUtil.java:331)
at com.thed.zephyr.jenkins.utils.rest.TestCaseUtil.processTestCaseDetails(TestCaseUtil.java:441)

at com.thed.zephyr.jenkins.reporter.ZfjReporter.perform(ZfjReporter.java:98)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:726)
at hudson.model.Build$BuildExecution.post2(Build.java:185)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:671)
at hudson.model.Run.execute(Run.java:1766)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)

at hudson.model.Executor.run(Executor.java:381)

vladimir_luschik@docupace.com (JIRA)

unread,
Sep 3, 2015, 2:54:01 PM9/3/15
to jenkinsc...@googlegroups.com
Vladimir Luschik edited a comment on Bug JENKINS-30091
I've got the same error  (Zephyr for JIRA 2.5.4)  : 


Recording test results
[ZapiTestResultReporter] [INFO] Examining test results...
Build result is SUCCESS
Total Test Cases : 3ERROR: Build step failed with exception
java.lang.NullPointerException
at com.thed.zephyr.jenkins.utils.rest.TestCaseUtil.executeTests(TestCaseUtil.java:331)
at com.thed.zephyr.jenkins.utils.rest.TestCaseUtil.processTestCaseDetails(TestCaseUtil.java:441)
at com.thed.zephyr.jenkins.reporter.ZfjReporter.perform(ZfjReporter.java:98)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:726)
at hudson.model.Build$BuildExecution.post2(Build.java:185)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:671)
at hudson.model.Run.execute(Run.java:1766)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:381)

vladimir_luschik@docupace.com (JIRA)

unread,
Sep 3, 2015, 2:54:01 PM9/3/15
to jenkinsc...@googlegroups.com
Vladimir Luschik edited a comment on Bug JENKINS-30091
I've got the same error (Zephyr for JIRA 2.5.4  and ZAPI for JIRA 1.5.0 ) : 


Recording test results
[ZapiTestResultReporter] [INFO] Examining test results...
Build result is SUCCESS
Total Test Cases : 3ERROR: Build step failed with exception
java.lang.NullPointerException
at com.thed.zephyr.jenkins.utils.rest.TestCaseUtil.executeTests(TestCaseUtil.java:331)
at com.thed.zephyr.jenkins.utils.rest.TestCaseUtil.processTestCaseDetails(TestCaseUtil.java:441)
at com.thed.zephyr.jenkins.reporter.ZfjReporter.perform(ZfjReporter.java:98)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:726)
at hudson.model.Build$BuildExecution.post2(Build.java:185)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:671)
at hudson.model.Run.execute(Run.java:1766)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:381)

vladimir_luschik@docupace.com (JIRA)

unread,
Sep 3, 2015, 2:57:02 PM9/3/15
to jenkinsc...@googlegroups.com
Vladimir Luschik updated an issue
 
Change By: Vladimir Luschik
Comment:
I've got the same error (Zephyr for JIRA 2.5.4 and ZAPI for JIRA 1.5.0) : 

Recording test results
[ZapiTestResultReporter] [INFO] Examining test results...
Build result is SUCCESS
Total Test Cases : 3ERROR: Build step failed with exception
java.lang.NullPointerException
at com.thed.zephyr.jenkins.utils.rest.TestCaseUtil.executeTests(TestCaseUtil.java:331)
at com.thed.zephyr.jenkins.utils.rest.TestCaseUtil.processTestCaseDetails(TestCaseUtil.java:441)
at com.thed.zephyr.jenkins.reporter.ZfjReporter.perform(ZfjReporter.java:98)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:726)
at hudson.model.Build$BuildExecution.post2(Build.java:185)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:671)
at hudson.model.Run.execute(Run.java:1766)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:381)

david1.gonzalez@intel.com (JIRA)

unread,
Sep 3, 2015, 2:59:01 PM9/3/15
to jenkinsc...@googlegroups.com
David Gonzalez commented on Bug JENKINS-30091
 
Re: Null pointer exception when importing xml containing only passing test cases

Hi Vladimir,

The fix was committed to github. I'm waiting for the updated plugin to show up in Jenkins update center to confirm the fix.

maikeffi@gmail.com (JIRA)

unread,
Sep 9, 2015, 4:50:05 AM9/9/15
to jenkinsc...@googlegroups.com

The fix in GIT did not work !
The results are getting updated but the but execution status remains unexecuted

BUILD SUCCESSFUL
Total time: 3 seconds


Recording test results
[ZapiTestResultReporter] [INFO] Examining test results...
Build result is SUCCESS

Total Test Cases : 1ERROR: Build step failed with exception


java.lang.NullPointerException
at com.thed.zephyr.jenkins.utils.rest.TestCaseUtil.executeTests(TestCaseUtil.java:331)
at com.thed.zephyr.jenkins.utils.rest.TestCaseUtil.processTestCaseDetails(TestCaseUtil.java:441)
at com.thed.zephyr.jenkins.reporter.ZfjReporter.perform(ZfjReporter.java:98)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:726)
at hudson.model.Build$BuildExecution.post2(Build.java:185)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:671)
at hudson.model.Run.execute(Run.java:1766)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)

at hudson.model.Executor.run(Executor.java:408)
Build step 'Publish test result to Zephyr for JIRA' marked build as failure

Notifying upstream projects of job completion
Finished: FAILURE

maikeffi@gmail.com (JIRA)

unread,
Sep 9, 2015, 5:03:01 AM9/9/15
to jenkinsc...@googlegroups.com

maikeffi@gmail.com (JIRA)

unread,
Sep 9, 2015, 5:09:01 AM9/9/15
to jenkinsc...@googlegroups.com
 
Re: Null pointer exception when importing xml containing only passing test cases

The fix is working now !
if (response !=null )

{ response.close(); }

[junit] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.495 sec

BUILD SUCCESSFUL
Total time: 5 seconds


Recording test results
[ZapiTestResultReporter] [INFO] Examining test results...
Build result is SUCCESS

Total Test Cases : 1[ZapiTestResultReporter] [INFO] Done.


Notifying upstream projects of job completion

Finished: SUCCESS

PS: To get a HPI file download the ZIP file and build it with Maven
for example if you unzip it to /home/usr/ZFJ
cd /home/usr/ZFJ
mvn
in the report folder you should fine the hpi file

maikeffi@gmail.com (JIRA)

unread,
Sep 9, 2015, 5:11:02 AM9/9/15
to jenkinsc...@googlegroups.com
kannan maikeffi edited a comment on Bug JENKINS-30091
The fix is working now !   
 

add he below check before closing response in  TestCaseUtil.java #330
if (response !=null )
{
response.close();
}


    [junit] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.495 sec

BUILD SUCCESSFUL
Total time: 5 seconds
Recording test results
[ZapiTestResultReporter] [INFO] Examining test results...
Build result is SUCCESS
Total Test Cases : 1[ZapiTestResultReporter] [INFO] Done.
Notifying upstream projects of job completion
Finished: SUCCESS


PS: To get a HPI file download the ZIP file and build it with Maven 
for example if you unzip it to /home/usr/ZFJ
cd /home/usr/ZFJ
mvn 
in the report folder you should fine the hpi file 

tapiomtr@java.net (JIRA)

unread,
Oct 14, 2015, 4:57:03 AM10/14/15
to jenkinsc...@googlegroups.com
tapiomtr commented on Bug JENKINS-30091

Zephyr for JIRA Test Management plugin ver. 1.2
Test cases are created in Jira, but the execution stops in an exeption:

Recording test results
[ZapiTestResultReporter] [INFO] Examining test results...
Build result is SUCCESS

Total Test Cases : 1ERROR: Build step failed with exception


java.lang.NullPointerException
at com.thed.zephyr.jenkins.utils.rest.TestCaseUtil.executeTests(TestCaseUtil.java:331)
at com.thed.zephyr.jenkins.utils.rest.TestCaseUtil.processTestCaseDetails(TestCaseUtil.java:441)
at com.thed.zephyr.jenkins.reporter.ZfjReporter.perform(ZfjReporter.java:98)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)

at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:761)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:721)
at hudson.model.Build$BuildExecution.post2(Build.java:183)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:670)


at hudson.model.Run.execute(Run.java:1766)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)

at hudson.model.Executor.run(Executor.java:374)


Build step 'Publish test result to Zephyr for JIRA' marked build as failure

BTW: Is they way to create test steps inside testsuite in Jira

mohan.kumar@getzephyr.com (JIRA)

unread,
Oct 15, 2015, 2:57:01 PM10/15/15
to jenkinsc...@googlegroups.com

mohan.kumar@getzephyr.com (JIRA)

unread,
Oct 15, 2015, 2:58:03 PM10/15/15
to jenkinsc...@googlegroups.com
Mohan Kumar resolved as Fixed
 

Issue is fixed

Change By: Mohan Kumar
Status: In Progress Resolved
Resolution: Fixed

mohan.kumar@getzephyr.com (JIRA)

unread,
Oct 15, 2015, 2:58:03 PM10/15/15
to jenkinsc...@googlegroups.com
Mohan Kumar started work on Bug JENKINS-30091
 
Change By: Mohan Kumar
Status: Open In Progress

mohan.kumar@getzephyr.com (JIRA)

unread,
Oct 15, 2015, 2:59:03 PM10/15/15
to jenkinsc...@googlegroups.com

tapiomtr@java.net (JIRA)

unread,
Oct 16, 2015, 12:40:03 AM10/16/15
to jenkinsc...@googlegroups.com
tapiomtr commented on Bug JENKINS-30091

I today installed the latest released (1.3) version, and now it works without null pointer exception, and I can find out from the Jira inserted/run Junit test cases.

surajitdasgupt@gmail.com (JIRA)

unread,
Apr 13, 2016, 3:21:01 AM4/13/16
to jenkinsc...@googlegroups.com

Hi,

I am using the Zephyr for JIRA plugin to upload test results to JIRA.

But the upload process hangs after the following log msg.
Recording test results
Build step 'Publish JUnit test result report' changed build result to UNSTABLE


[ZapiTestResultReporter] [INFO] Examining test results...

Build result is UNSTABLE

If we stop the job, we get the same exception(NPE) as mentioned in this issue.
Plugin versions:
Zephyr for JIRA: 1.3
Zephyr Version on JIra server: 3.1.3.31302433
JIra version: 7.0

Can anyone pls help me to find why the job hangs while uploading test results and why the NPE .

TIA,
Surajit

surajitdasgupt@gmail.com (JIRA)

unread,
Apr 13, 2016, 3:22:01 AM4/13/16
to jenkinsc...@googlegroups.com
Surajit Dasgupta edited a comment on Bug JENKINS-30091
Hi,

I am using the Zephyr for JIRA plugin to upload test results to JIRA.

But the upload process hangs after the following log msg.
{color:#59afe1}Recording test results

Build step 'Publish JUnit test result report' changed build result to UNSTABLE
[ZapiTestResultReporter] [INFO] Examining test results...
Build result is UNSTABLE{color}

If we stop the job
(after hanging for 12-13hrs) , we get the same exception(NPE) as mentioned in this issue.
*Plugin versions:*

Zephyr for JIRA: 1.3
Zephyr Version on JIra server: 3.1.3.31302433
JIra version: 7.0

Can anyone pls help me to find why the job hangs while uploading test results and why the NPE .

TIA,
Surajit

surajitdasgupt@gmail.com (JIRA)

unread,
Apr 13, 2016, 3:29:02 AM4/13/16
to jenkinsc...@googlegroups.com
Surajit Dasgupta edited a comment on Bug JENKINS-30091
Hi,

I am using the Zephyr for JIRA plugin to upload test results to JIRA.

But the upload process hangs after the following log msg.
{color:#59afe1}Recording test results
Build step 'Publish JUnit test result report' changed build result to UNSTABLE
[ZapiTestResultReporter] [INFO] Examining test results...
Build result is UNSTABLE{color}

If we stop the job(after hanging for 12-13hrs), we get  the same  NPE.
*Exception Stacktrace:*
bq. Total Test Cases : 62ERROR: Build step failed with
 exception  java.lang.NullPointerException at com.thed.zephyr.jenkins.utils.rest.TestCaseUtil.assignTests ( NPE TestCaseUtil.java:218 )  as mentioned in this issue  at com . thed.zephyr.jenkins.utils.rest.TestCaseUtil.processTestCaseDetails(TestCaseUtil.java:413) at com.thed.zephyr.jenkins.reporter.ZfjReporter.perform(ZfjReporter.java:98) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:782) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:723) at hudson.model.Build$BuildExecution.post2(Build.java:185) at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:668) at hudson.model.Run.execute(Run.java:1763) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:410) 
bq. Build step 'Publish test result to Zephyr for JIRA' marked build as failure Finished: FAILURE


*Plugin versions:*
Zephyr for JIRA: 1.3
Zephyr Version on JIra server: 3.1.3.31302433
JIra version: 7.0

Can anyone pls help me to find why the job hangs while uploading test results and why the NPE .

TIA,
Surajit
Reply all
Reply to author
Forward
0 new messages