Details

Description

JUnit files created with phpunit started to cause a NULL-pointer exception after an upgrade from xUnit 2.1.0 to 2.2.1:

java.lang.NullPointerException
at org.jenkinsci.plugins.xunit.XUnitProcessor.recordTestResult(XUnitProcessor.java:354)
at org.jenkinsci.plugins.xunit.XUnitProcessor.process(XUnitProcessor.java:157)
at org.jenkinsci.plugins.xunit.XUnitPublisher.perform(XUnitPublisher.java:161)
at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:81)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690)
at hudson.model.Build$BuildExecution.post2(Build.java:186)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:635)
at hudson.model.Run.execute(Run.java:1823)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)

Nikolas Falco
added a comment - 2018-08-14 12:47 It's very strange that NPE because all cases seems covered. Could you please send me the job configuration? The issue is not related to the report file.

Exactly the same issue on our setup. Also started happening immediately after the upgrade to 2.2.1
Most of our builds have 2 xUnit steps at the end, to collect unittest information in 2 different formats.

INFO: Starting to record.
INFO: Processing QTestlib-Version 5.x
INFO: [QTestlib-Version 5.x] - 1 test report file(s) were found with the pattern 'Apps/*_qtest.xml' relative to '...' for the testing framework 'QTestlib-Version 5.x'.
INFO: Processing GoogleTest-1.6
INFO: [GoogleTest-1.6] - 18 test report file(s) were found with the pattern 'Apps/*_gtest.xml' relative to '...' for the testing framework 'GoogleTest-1.6'.
ERROR: Build step failed with exception
java.lang.NullPointerException
at org.jenkinsci.plugins.xunit.XUnitProcessor.recordTestResult(XUnitProcessor.java:354)
at org.jenkinsci.plugins.xunit.XUnitProcessor.process(XUnitProcessor.java:157)
at org.jenkinsci.plugins.xunit.XUnitPublisher.perform(XUnitPublisher.java:161)
at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:81)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690)
at hudson.model.Build$BuildExecution.post2(Build.java:186)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:635)
at hudson.model.Run.execute(Run.java:1840)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)
Build step 'Publish xUnit test result report' marked build as failure

Pieter-Jan Busschaert
added a comment - 2018-08-14 13:49 - edited Exactly the same issue on our setup. Also started happening immediately after the upgrade to 2.2.1
Most of our builds have 2 xUnit steps at the end, to collect unittest information in 2 different formats.
INFO: Starting to record.
INFO: Processing QTestlib-Version 5.x
INFO: [QTestlib-Version 5.x] - 1 test report file(s) were found with the pattern 'Apps/*_qtest.xml' relative to '...' for the testing framework 'QTestlib-Version 5.x'.
INFO: Processing GoogleTest-1.6
INFO: [GoogleTest-1.6] - 18 test report file(s) were found with the pattern 'Apps/*_gtest.xml' relative to '...' for the testing framework 'GoogleTest-1.6'.
ERROR: Build step failed with exception
java.lang.NullPointerException
at org.jenkinsci.plugins.xunit.XUnitProcessor.recordTestResult(XUnitProcessor.java:354)
at org.jenkinsci.plugins.xunit.XUnitProcessor.process(XUnitProcessor.java:157)
at org.jenkinsci.plugins.xunit.XUnitPublisher.perform(XUnitPublisher.java:161)
at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:81)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690)
at hudson.model.Build$BuildExecution.post2(Build.java:186)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:635)
at hudson.model.Run.execute(Run.java:1840)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)
Build step 'Publish xUnit test result report' marked build as failure

Florian P
added a comment - 2018-08-14 13:55 I attached both configs. The working one with 2.1.0 and the non-working version with 2.2.1.
This is indeed a non-pipeline job. The job configuration is built and deployed with Jenkins Job Builder 2.2.1 (latest as of writing).