Skip to content
This repository has been archived by the owner on Aug 24, 2019. It is now read-only.

NullPointerException when processing JUnit report but test files not included in analysis #35

Open
gretzki opened this issue Jun 26, 2017 · 1 comment
Labels

Comments

@gretzki
Copy link

gretzki commented Jun 26, 2017

When analysing a project with a test report, SurefireParser will process the reports and calls context.saveMeasure on the unit test resources. But if the unit test resources are not published to sonar-scanner via sonar.tests (cmdline or sonar-project.properties file), the unit test resource can't be found and context.saveMeasure will be invoked with null as resource parameter.
This will ultimately crash sonar-scanner.

This plugin should check if the unit test resource can be retrieved before calling context.saveMeasure to prevent the crash.

Tested on SonarQube 5.6.6 and sonar-objective-c plugin 0.6.1.
But will most likely occur on SonarQube 6.x too.

@zippy1978
Copy link

Hi @gretzki,

Since I upgraded SonarQube API, the way saveMeasure works is now different.

Could you tell me if the bug is gone with version 0.6.2 of the plugin ?

Gilles.

@zippy1978 zippy1978 added the bug label Dec 6, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants