Problem Summary
I’m experiencing a critical error with the SonarQube Process Test Coverage plugin that causes the SonarQube compute engine to fail with a NaN is not allowed as a Measure value error during the Quality Gate step. This prevents the analysis from completing successfully.
Technical Environment
- SonarQube Version: Community/Developer Edition (localhost:9000)
- Plugin: Camunda Process Test Coverage Sonar Plugin 2.7.0 (processtestcoverage)
- Java Version: OpenJDK 17.0.15 (Homebrew)
- Maven Version: Apache Maven 3.9.10
- OS: macOS 15.5 (Darwin 24.5.0, aarch64)
- Camunda Version: 7.14.0 (Enterprise Edition)
- Process Test Coverage Library: camunda-process-test-coverage-spring-test-platform-7 v2.7.0
Error Details
Full Stack Trace
org.sonar.ce.task.projectanalysis.component.VisitException: Visit of Component {key=camunda-kafka-demo,uuid=7d6f9262-4499-4378-b588-7e97e4a52930,type=PROJECT} failed
at org.sonar.ce.task.projectanalysis.component.VisitException.rethrowOrWrap(VisitException.java:44)
at org.sonar.ce.task.projectanalysis.component.DepthTraversalTypeAwareCrawler.visit(DepthTraversalTypeAwareCrawler.java:41)
at org.sonar.ce.task.projectanalysis.step.QualityGateMeasuresStep.execute(QualityGateMeasuresStep.java:103)
at org.sonar.ce.task.step.ComputationStepExecutor.executeStep(ComputationStepExecutor.java:90)
at org.sonar.ce.task.step.ComputationStepExecutor.executeSteps(ComputationStepExecutor.java:81)
at org.sonar.ce.task.step.ComputationStepExecutor.execute(ComputationStepExecutor.java:68)
at org.sonar.ce.task.projectanalysis.taskprocessor.ReportTaskProcessor.process(ReportTaskProcessor.java:75)
at org.sonar.ce.taskprocessor.CeWorkerImpl$ExecuteTask.executeTask(CeWorkerImpl.java:212)
at org.sonar.ce.taskprocessor.CeWorkerImpl$ExecuteTask.run(CeWorkerImpl.java:194)
at org.sonar.ce.taskprocessor.CeWorkerImpl.findAndProcessTask(CeWorkerImpl.java:160)
at org.sonar.ce.taskprocessor.CeWorkerImpl$TrackRunningState.get(CeWorkerImpl.java:135)
at org.sonar.ce.taskprocessor.CeWorkerImpl.call(CeWorkerImpl.java:87)
at org.sonar.ce.taskprocessor.CeWorkerImpl.call(CeWorkerImpl.java:53)
at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:128)
at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:74)
at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:80)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:840)
Caused by: java.lang.IllegalArgumentException: NaN is not allowed as a Measure value
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:141)
at org.sonar.ce.task.projectanalysis.measure.Measure$NewMeasureBuilder.create(Measure.java:438)
at org.sonar.ce.task.projectanalysis.measure.BatchMeasureToMeasure.toDoubleMeasure(BatchMeasureToMeasure.java:83)
at org.sonar.ce.task.projectanalysis.measure.BatchMeasureToMeasure.toMeasure(BatchMeasureToMeasure.java:51)
at org.sonar.ce.task.projectanalysis.measure.MeasureRepositoryImpl.loadBatchMeasuresForComponent(MeasureRepositoryImpl.java:113)
at org.sonar.ce.task.projectanalysis.measure.MeasureRepositoryImpl.getRawMeasure(MeasureRepositoryImpl.java:81)
at org.sonar.ce.task.projectanalysis.step.QualityGateMeasuresStep.updateMeasures(QualityGateMeasuresStep.java:170)
at org.sonar.ce.task.projectanalysis.step.QualityGateMeasuresStep.executeForProject(QualityGateMeasuresStep.java:110)
at org.sonar.ce.task.projectanalysis.step.QualityGateMeasuresStep$1.visitProject(QualityGateMeasuresStep.java:101)
at org.sonar.ce.task.projectanalysis.component.DepthTraversalTypeAwareCrawler.visitNode(DepthTraversalTypeAwareCrawler.java:70)
at org.sonar.ce.task.projectanalysis.component.DepthTraversalTypeAwareCrawler.visitImpl(DepthTraversalTypeAwareCrawler.java:51)
at org.sonar.ce.task.projectanalysis.component.DepthTraversalTypeAwareCrawler.visit(DepthTraversalTypeAwareCrawler.java:39)
... 20 more
Project Configuration
Maven pom.xml (Relevant Sections)
<properties>
<java.version>11</java.version>
<camunda.version>7.14.0-ee</camunda.version>
<camunda-process-test-coverage.version>2.7.0</camunda-process-test-coverage.version>
<sonar.projectKey>camunda-kafka-demo</sonar.projectKey>
<sonar.projectName>Camunda Kafka Demo</sonar.projectName>
<sonar.projectVersion>1.0</sonar.projectVersion>
<sonar.host.url>http://localhost:9000</sonar.host.url>
<sonar.coverage.jacoco.xmlReportPaths>target/site/jacoco/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths>
<sonar.sources>src/main/java,src/main/resources</sonar.sources>
<sonar.tests>src/test/java</sonar.tests>
<sonar.java.binaries>target/classes</sonar.java.binaries>
<!-- Remove custom process test coverage configuration to let plugin use defaults -->
<sonar.process-test-coverage.jsonReportPaths></sonar.process-test-coverage.jsonReportPaths>
</properties>
<dependencies>
<dependency>
<groupId>org.camunda.community.process_test_coverage</groupId>
<artifactId>camunda-process-test-coverage-spring-test-platform-7</artifactId>
<version>${camunda-process-test-coverage.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.camunda.community.process_test_coverage</groupId>
<artifactId>camunda-process-test-coverage-report-aggregator-maven-plugin</artifactId>
<version>${camunda-process-test-coverage.version}</version>
<executions>
<execution>
<id>aggregate-reports</id>
<goals>
<goal>aggregate</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
Test Setup
The process test coverage is generated using a comprehensive test class with multiple test methods covering different BPMN process paths:
@Import(ProcessEngineCoverageConfiguration.class)
@Deployment(resources = {"process.bpmn", "order-process.bpmn", "data-format.bpmn"})
public class DataFormatProcessCoverageTest extends BaseIntegrationTest {
@Test
public void testDataFormatProcess_XmlPath_ShouldGenerateCoverageReport() { /* ... */ }
@Test
public void testDataFormatProcess_JsonPath_ShouldGenerateCoverageReport() { /* ... */ }
@Test
public void testOrderProcess_ShouldGenerateCoverageReport() { /* ... */ }
@Test
public void testGenericProcess_ShouldGenerateCoverageReport() { /* ... */ }
@Test
public void testCompleteProcessCoverage_AllPaths_ShouldGenerateComprehensiveReport() { /* ... */ }
@Test
public void testDataFormatProcess_BothPaths_ShouldAchieveFullCoverage() { /* ... */ }
}
Generated Coverage Data
Coverage Report Structure
-
Location: target/process-test-coverage/
-
Reports Generated:
- target/process-test-coverage/org.camunda.bpm.demo.coverage.DataFormatProcessCoverageTest/report.json (69,297 bytes)
- target/process-test-coverage/all/report.json (69,297 bytes, aggregated)
Coverage Results -
Test Coverage: 70.59% overall test class coverage
-
Individual Tests: Coverage ranging from 38.9% to 100% per test method
-
Processes Covered:
-
KafkaDemo (18 total elements)
- DataformatDemoProcess (16 total elements)
- order-process (17 total elements)
Sample Coverage Data (JSON)
The generated JSON contains detailed execution events for each process run:
{
"suites": [
{
"id": "org.camunda.bpm.demo.coverage.DataFormatProcessCoverageTest",
"name": "org.camunda.bpm.demo.coverage.DataFormatProcessCoverageTest",
"runs": [
{
"id": "testOrderProcess_ShouldGenerateCoverageReport",
"name": "testOrderProcess_ShouldGenerateCoverageReport",
"events": [
{
"source": "FLOW_NODE",
"type": "START",
"definitionKey": "StartEvent_OrderReceived",
"elementType": "startEvent",
"modelKey": "order-process",
"timestamp": 1752243053
},
// ... more events
]
}
]
}
],
"models": [
{
"key": "KafkaDemo",
"totalElementCount": 18,
"xml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?> <!-- BPMN XML content -->"
},
// ... more models
]
}
SonarQube Scanner Configuration
Plugin Configuration (as detected by scanner)
Plugins:
- Camunda Process Test Coverage Sonar Plugin 2.7.0 (processtestcoverage)
- JaCoCo 1.3.0.1538 (jacoco)
- IaC Code Quality and Security 1.47.0.15287 (iac)
- Text Code Quality and Security 2.24.1.6530 (text)
- Clean as You Code 2.4.0.2018 (cayc)
Project server settings:
- sonar.process-test-coverage.jsonReportPaths=target/process-test-coverage/**/report.json
- sonar.scm.disabled=true
- sonar.java.binaries=target/classes
- sonar.java.test.binaries=target/test-classes
- sonar.sources=src/main/java,src/main/resources
- sonar.tests=src/test/java
Steps to Reproduce
- Set up Maven project with Camunda 7.14.0-ee
- Add process test coverage dependencies (spring-test-platform-7 v2.7.0)
- Create comprehensive test class with multiple BPMN process coverage tests
- Install SonarQube Process Test Coverage plugin v2.7.0 on SonarQube server
- Run mvn clean test to generate coverage reports (succeeds)
- Run mvn sonar:sonar to analyze with SonarQube (fails with NaN error)
Analysis Results
- Coverage reports generated successfully:
69KB JSON reports with valid coverage data - SonarQube analysis import:
Fails during Quality Gate step with NaN error - Plugin detection:
Plugin correctly detected and loaded - Report parsing:
Reports found and initially processed (2 reports imported)
Attempted Solutions
- Removed custom jsonReportPaths configuration - Let plugin use default discovery
- Verified Java version compatibility - Upgraded to Java 17
- Fixed Git blame issues - Committed all changes to eliminate SCM warnings
- Checked JSON report validity - Reports are well-formed and contain valid data
- Verified plugin installation - Plugin correctly installed in SonarQube server
Key Questions
- What causes the NaN calculation in the SonarQube compute engine? Is this a plugin bug or configuration issue?
- Are there known compatibility issues between the v2.7.0 plugin and specific SonarQube versions?
- Is there additional configuration needed for the Quality Gate step to handle process test coverage metrics?
- Are there specific numeric values in the coverage JSON that could cause NaN calculations?
Expected Behavior
The SonarQube analysis should complete successfully and display process test coverage metrics alongside traditional code coverage metrics in the SonarQube dashboard.
Additional Context
The process test coverage library itself works correctly - generating valid HTML and JSON reports
The error specifically occurs during the SonarQube Quality Gate computation step
The plugin successfully imports reports (logs show “2 reports imported”) before failing
This appears to be a numeric calculation issue in the SonarQube plugin’s metric computation
Has anyone encountered this NaN error with the Process Test Coverage plugin? Any insights into what might cause invalid numeric calculations in the coverage metrics would be greatly appreciated.