jenkinsci / jenkinsci/junit-plugin

[JENKINS-18672] NPE when reading JUnit reports

Open
#941 0 comments 0 reactions 0 assignees View on GitHub
component:junit-plugin imported-jira-issue priority:major resolution:unresolved
Dominant language
Java
Stars
87
Forks
351
Avg merge
1d 19h
Merged PRs (30d)
2

Description

When reading the generated reports I get the following exception

Recording test results

ERROR: Publisher hudson.tasks.junit.JUnitResultArchiver aborted due to exception

java.lang.NullPointerException

at hudson.tasks.junit.CaseResult.getPackageName(CaseResult.java:289)

at hudson.tasks.junit.TestResult.tally(TestResult.java:578)

at hudson.tasks.junit.JUnitParser$ParseResultCallable.invoke(JUnitParser.java:118)

at hudson.tasks.junit.JUnitParser$ParseResultCallable.invoke(JUnitParser.java:90)

at hudson.FilePath.act(FilePath.java:905)

at hudson.FilePath.act(FilePath.java:878)

at hudson.tasks.junit.JUnitParser.parse(JUnitParser.java:87)

at hudson.tasks.junit.JUnitResultArchiver.parse(JUnitResultArchiver.java:121)

at hudson.tasks.junit.JUnitResultArchiver.perform(JUnitResultArchiver.java:133)

at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)

at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804)

at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:776)

at hudson.model.Build$BuildExecution.post2(Build.java:183)

at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:726)

at hudson.model.Run.execute(Run.java:1618)

at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)

at hudson.model.ResourceController.execute(ResourceController.java:88)

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

example xml result:

















---
Originally reported by booveman, imported from: NPE when reading JUnit reports


  • status: Open
  • priority: Major
  • component(s): junit-plugin
  • resolution: Unresolved
  • votes: 0
  • watchers: 2
  • imported: 2025-11-26

Raw content of original issue

When reading the generated reports I get the following exception

Recording test results
ERROR: Publisher hudson.tasks.junit.JUnitResultArchiver aborted due to exception
java.lang.NullPointerException
at hudson.tasks.junit.CaseResult.getPackageName(CaseResult.java:289)
at hudson.tasks.junit.TestResult.tally(TestResult.java:578)
at hudson.tasks.junit.JUnitParser$ParseResultCallable.invoke(JUnitParser.java:118)
at hudson.tasks.junit.JUnitParser$ParseResultCallable.invoke(JUnitParser.java:90)
at hudson.FilePath.act(FilePath.java:905)
at hudson.FilePath.act(FilePath.java:878)
at hudson.tasks.junit.JUnitParser.parse(JUnitParser.java:87)
at hudson.tasks.junit.JUnitResultArchiver.parse(JUnitResultArchiver.java:121)
at hudson.tasks.junit.JUnitResultArchiver.perform(JUnitResultArchiver.java:133)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:776)
at hudson.model.Build$BuildExecution.post2(Build.java:183)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:726)
at hudson.model.Run.execute(Run.java:1618)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:247)

example xml result:

<?xml version="1.0" encoding="UTF-8"?>
<testsuite name="User with two api keys" tests="1" time="0.409146879" failures="0" errors="0" skipped="0">
<testcase name="User with two api keys #api_key returns the first api key" time="0.408775226">
</testcase>
<system-out>
</system-out>
<system-err>
</system-err>
</testsuite>

environment

```
ruby 1.9.3-p448

rails 3.2.13

rspec 2.13.1

ci_reporter 1.9.0

jenkins 1.521
```

Contributor guide

Open the contributing guide

Research direction

Start at CaseResult.getPackageName() at CaseResult.java:289 and trace how the supplied JUnit XML is parsed through TestResult.tally and JUnitParser. Reproduce the report-reading failure with the example XML, then verify that processing the report completes without the reported NullPointerException.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.