Sonar analysis for PL/SQL code coverage getting 0%

Hi
I am using sonarqube 9.9 LTS. And Using Z PL/SQL Analyzer 3.4.0
I have generated test report and code coverage report for PL/SQL code.
Below properties i am passing to read code covrage report.

sonar.projectKey=$PROJECT_KEY
sonar.projectBaseDir=$RELEASE_WORKSPACE
sonar.projectName=$PROJECT_NAME
sonar.projectVersion=$REPORT_VERSION
sonar.sources=$RELEASE_WORKSPACE/PLSQL
sonar.coverageReportPaths= /app/data/Sonar_Coverage/sonar_coverage.xml
sonar.organization=utplsql
sonar.testExecutionReportPaths=/app/data/Sonar_Coverage/sonar_test_results.xml
sonar.verbose=true
sonar.language=plsql
sonar.sourceEncoding=UTF-8

After sucessfully execution of sonar analysis getting 0% code coverage. Please help what to do.

Below warring also getting in sonar dashboard.

image

1 Like

What tool you’re using to generate the test and the coverage report? From my own experience, I know that generating the reports correctly with utPLSQL is a bit tricky.

Also, the scanner logs will probably show why the reports aren’t being imported.

1 Like

Hi Felipe
I am using utplsql to generate test and coverage report. And report are correct I verified manually.

Can you share the part of the scanner logs about the generic coverage and generic test reports?

It looks like this:

INFO: Sensor Generic Coverage Report
INFO: Parsing /github/workspace/coverage.xml
INFO: Imported coverage data for 3 files
INFO: Sensor Generic Coverage Report (done) | time=23ms
INFO: Sensor Generic Test Executions Report
INFO: Parsing /github/workspace/test_results.xml
INFO: Imported test execution data for 0 files
INFO: Test execution data ignored for 3 unknown files, including:
test_award_bonus
test_betwnstr
test_remove_rooms_by_name
INFO: Sensor Generic Test Executions Report (done) | time=3ms

(By the way, in this example due a configuration error the test execution report isn’t being imported, causing the “Test execution data ignored for…” in the logs)

Hi Felipe Thanks for your quick response.

Please see below logs.

20:15:49.473 DEBUG: Sensors : JaCoCo XML Report Importer → Z PL/SQL Analyzer → CSS Rules → C# Project Type Information → C# Analysis Log → C# Properties → HTML → TextAndSecretsSensor → VB.NET Project Type Information → VB.NET Analysis Log → VB.NET Properties → IaC Docker Sensor → Generic Test Executions Report
20:15:49.473 INFO: Sensor JaCoCo XML Report Importer [jacoco]
20:15:49.474 INFO: ‘sonar.coverage.jacoco.xmlReportPaths’ is not defined. Using default locations: target/site/jacoco/jacoco.xml,target/site/jacoco-it/jacoco.xml,build/reports/jacoco/test/jacocoTestReport.xml
20:15:49.474 INFO: No report imported, no coverage information will be imported by JaCoCo XML Report Importer
20:15:49.474 INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=1ms
20:15:49.474 INFO: Sensor Z PL/SQL Analyzer [plsqlopen]
20:15:49.514 INFO: 35 source files to be analyzed
20:15:49.515 INFO: Concurrent mode enabled
20:15:49.526 DEBUG: ‘1.SourceCode/PLSQL/TEMP_CL_QUALIFIEDBOMCONFIG.sql’ generated metadata with charset ‘UTF-8’
20:15:49.527 DEBUG: ‘1.SourceCode/PLSQL/T_CUSTOMDL_SUBMENU.sql’ generated metadata with charset ‘UTF-8’
20:15:49.528 DEBUG: ‘1.SourceCode/PLSQL/TEMP_CL_DMSDATACOLLECTION.sql’ generated metadata with charset ‘UTF-8’
20:15:49.530 DEBUG: ‘1.SourceCode/PLSQL/CUSTOMDL_SETUP.sql’ generated metadata with charset ‘UTF-8’
20:15:49.588 DEBUG: Not enough content in ‘1.SourceCode/PLSQL/T_CUSTOMDL_SUBMENU.sql’ to have CPD blocks, it will not be part of the duplication detection
20:15:49.593 DEBUG: Not enough content in ‘1.SourceCode/PLSQL/CUSTOMDL_SETUP.sql’ to have CPD blocks, it will not be part of the duplication detection
20:15:49.601 DEBUG: Not enough content in ‘1.SourceCode/PLSQL/TEMP_CL_QUALIFIEDBOMCONFIG.sql’ to have CPD blocks, it will not be part of the duplication detection
20:15:49.608 DEBUG: Not enough content in ‘1.SourceCode/PLSQL/TEMP_CL_DMSDATACOLLECTION.sql’ to have CPD blocks, it will not be part of the duplication detection
20:15:49.620 DEBUG: ‘1.SourceCode/PLSQL/TEMP_CL_CMMSSPAREPARTS.sql’ generated metadata with charset ‘UTF-8’
20:15:49.633 DEBUG: Not enough content in ‘1.SourceCode/PLSQL/TEMP_CL_CMMSSPAREPARTS.sql’ to have CPD blocks, it will not be part of the duplication detection
20:15:49.651 DEBUG: ‘1.SourceCode/PLSQL/TEMP_CL_EQPTOOL.sql’ generated metadata with charset ‘UTF-8’
20:15:49.664 DEBUG: Not enough content in ‘1.SourceCode/PLSQL/TEMP_CL_EQPTOOL.sql’ to have CPD blocks, it will not be part of the duplication detection
20:15:49.669 DEBUG: ‘1.SourceCode/PLSQL/TEMP_CL_XSITEEQPUSAGEMETER.sql’ generated metadata with charset ‘UTF-8’
20:15:49.675 DEBUG: Not enough content in ‘1.SourceCode/PLSQL/TEMP_CL_XSITEEQPUSAGEMETER.sql’ to have CPD blocks, it will not be part of the duplication detection
20:15:49.681 DEBUG: ‘1.SourceCode/PLSQL/TEMP_CL_DMSEMCSREASONCODE.sql’ generated metadata with charset ‘UTF-8’
20:15:49.690 DEBUG: Not enough content in ‘1.SourceCode/PLSQL/TEMP_CL_DMSEMCSREASONCODE.sql’ to have CPD blocks, it will not be part of the duplication detection
20:15:49.699 DEBUG: ‘1.SourceCode/PLSQL/TEMP_CL_MESQUERYOPTION.sql’ generated metadata with charset ‘UTF-8’
20:15:49.707 DEBUG: Not enough content in ‘1.SourceCode/PLSQL/TEMP_CL_MESQUERYOPTION.sql’ to have CPD blocks, it will not be part of the duplication detection
20:15:49.711 DEBUG: ‘1.SourceCode/PLSQL/TEMP_CL_INTEGRATEDEQUIPMENT.sql’ generated metadata with charset ‘UTF-8’
20:15:49.714 DEBUG: Not enough content in ‘1.SourceCode/PLSQL/TEMP_CL_INTEGRATEDEQUIPMENT.sql’ to have CPD blocks, it will not be part of the duplication detection
20:15:49.720 DEBUG: ‘1.SourceCode/PLSQL/TEMP_CL_PROCESSBRICKCONFIG.sql’ generated metadata with charset ‘UTF-8’
20:15:49.723 DEBUG: Not enough content in ‘1.SourceCode/PLSQL/TEMP_CL_PROCESSBRICKCONFIG.sql’ to have CPD blocks, it will not be part of the duplication detection
20:15:49.728 DEBUG: ‘1.SourceCode/PLSQL/T_CUSTOMDL_MENU.sql’ generated metadata with charset ‘UTF-8’
20:15:49.730 DEBUG: Not enough content in ‘1.SourceCode/PLSQL/T_CUSTOMDL_MENU.sql’ to have CPD blocks, it will not be part of the duplication detection
20:15:49.735 DEBUG: ‘1.SourceCode/PLSQL/TEMP_CL_MATERIALTYPEPRIORITY.sql’ generated metadata with charset ‘UTF-8’
20:15:49.737 DEBUG: Not enough content in ‘1.SourceCode/PLSQL/TEMP_CL_MATERIALTYPEPRIORITY.sql’ to have CPD blocks, it will not be part of the duplication detection
20:15:49.766 DEBUG: ‘1.SourceCode/PLSQL/T_CUSTOMDLTRACING.sql’ generated metadata with charset ‘UTF-8’
20:15:49.779 DEBUG: Not enough content in ‘1.SourceCode/PLSQL/T_CUSTOMDLTRACING.sql’ to have CPD blocks, it will not be part of the duplication detection
20:15:49.788 DEBUG: ‘1.SourceCode/PLSQL/PKG_CUSTOMDL.sql’ generated metadata with charset ‘UTF-8’
20:15:49.791 DEBUG: ‘1.SourceCode/PLSQL/TEMP_CL_DMSQUALIFIEDCAPABILITY.sql’ generated metadata with charset ‘UTF-8’
20:15:49.803 DEBUG: Not enough content in ‘1.SourceCode/PLSQL/TEMP_CL_DMSQUALIFIEDCAPABILITY.sql’ to have CPD blocks, it will not be part of the duplication detection
20:15:49.817 DEBUG: ‘1.SourceCode/PLSQL/TEMP_CL_PROCESSBRICKCREATION.sql’ generated metadata with charset ‘UTF-8’
20:15:49.831 DEBUG: Not enough content in ‘1.SourceCode/PLSQL/TEMP_CL_PROCESSBRICKCREATION.sql’ to have CPD blocks, it will not be part of the duplication detection
20:15:50.081 DEBUG: ‘1.SourceCode/PLSQL/Preload_Data.sql’ generated metadata with charset ‘UTF-8’
20:15:50.233 DEBUG: Not enough content in ‘1.SourceCode/PLSQL/Preload_Data.sql’ to have CPD blocks, it will not be part of the duplication detection
20:15:50.266 DEBUG: ‘1.SourceCode/PLSQL/X_TEMP_CL_FIRSTTRACKINDATACOLLCT.sql’ generated metadata with charset ‘UTF-8’
20:15:50.273 DEBUG: Not enough content in ‘1.SourceCode/PLSQL/X_TEMP_CL_FIRSTTRACKINDATACOLLCT.sql’ to have CPD blocks, it will not be part of the duplication detection
20:15:50.301 DEBUG: ‘1.SourceCode/PLSQL/TEMP_CL_CHECKLISTSTEPMTREXT.sql’ generated metadata with charset ‘UTF-8’
20:15:50.308 DEBUG: Not enough content in ‘1.SourceCode/PLSQL/TEMP_CL_CHECKLISTSTEPMTREXT.sql’ to have CPD blocks, it will not be part of the duplication detection
20:15:50.313 DEBUG: ‘1.SourceCode/PLSQL/T_CUSTOMDL_TEMPLATE_INFO.sql’ generated metadata with charset ‘UTF-8’
20:15:50.317 DEBUG: Not enough content in ‘1.SourceCode/PLSQL/T_CUSTOMDL_TEMPLATE_INFO.sql’ to have CPD blocks, it will not be part of the duplication detection
20:15:50.322 DEBUG: ‘1.SourceCode/PLSQL/TEMP_CL_DMSEMCSPETTH.sql’ generated metadata with charset ‘UTF-8’
20:15:50.327 DEBUG: Not enough content in ‘1.SourceCode/PLSQL/TEMP_CL_DMSEMCSPETTH.sql’ to have CPD blocks, it will not be part of the duplication detection
20:15:50.338 DEBUG: ‘1.SourceCode/PLSQL/TEMP_CL_DMSAVERAGECYCLETIME.sql’ generated metadata with charset ‘UTF-8’
20:15:50.340 DEBUG: Not enough content in ‘1.SourceCode/PLSQL/TEMP_CL_DMSAVERAGECYCLETIME.sql’ to have CPD blocks, it will not be part of the duplication detection
20:15:50.346 DEBUG: ‘1.SourceCode/PLSQL/TEMP_CL_DMSMAXPROCESSTIME.sql’ generated metadata with charset ‘UTF-8’
20:15:50.350 DEBUG: Not enough content in ‘1.SourceCode/PLSQL/TEMP_CL_DMSMAXPROCESSTIME.sql’ to have CPD blocks, it will not be part of the duplication detection
20:15:50.355 DEBUG: ‘1.SourceCode/PLSQL/TEMP_CL_MATERIALMATRIX.sql’ generated metadata with charset ‘UTF-8’
20:15:50.359 DEBUG: Not enough content in ‘1.SourceCode/PLSQL/TEMP_CL_MATERIALMATRIX.sql’ to have CPD blocks, it will not be part of the duplication detection
20:15:50.364 DEBUG: ‘1.SourceCode/PLSQL/CUSTOMDL_TYPES.sql’ generated metadata with charset ‘UTF-8’
20:15:50.368 DEBUG: Not enough content in ‘1.SourceCode/PLSQL/CUSTOMDL_TYPES.sql’ to have CPD blocks, it will not be part of the duplication detection
20:15:50.372 DEBUG: ‘1.SourceCode/PLSQL/T_REASONDESC.sql’ generated metadata with charset ‘UTF-8’
20:15:50.375 DEBUG: Not enough content in ‘1.SourceCode/PLSQL/T_REASONDESC.sql’ to have CPD blocks, it will not be part of the duplication detection
20:15:50.384 DEBUG: ‘1.SourceCode/PLSQL/TEMP_CL_DMSQUALIFIEDTOOL.sql’ generated metadata with charset ‘UTF-8’
20:15:50.388 DEBUG: Not enough content in ‘1.SourceCode/PLSQL/TEMP_CL_DMSQUALIFIEDTOOL.sql’ to have CPD blocks, it will not be part of the duplication detection
20:15:50.392 DEBUG: ‘1.SourceCode/PLSQL/TEMP_CL_PACKAGELINEMAPPING.sql’ generated metadata with charset ‘UTF-8’
20:15:50.395 DEBUG: Not enough content in ‘1.SourceCode/PLSQL/TEMP_CL_PACKAGELINEMAPPING.sql’ to have CPD blocks, it will not be part of the duplication detection
20:15:50.402 DEBUG: ‘1.SourceCode/PLSQL/T_PACKAGE_FAMILY.sql’ generated metadata with charset ‘UTF-8’
20:15:50.414 DEBUG: Not enough content in ‘1.SourceCode/PLSQL/T_PACKAGE_FAMILY.sql’ to have CPD blocks, it will not be part of the duplication detection
20:15:50.420 DEBUG: ‘1.SourceCode/PLSQL/CUSTOMDL.SETUP.sql’ generated metadata with charset ‘UTF-8’
20:15:50.422 DEBUG: Not enough content in ‘1.SourceCode/PLSQL/CUSTOMDL.SETUP.sql’ to have CPD blocks, it will not be part of the duplication detection
20:15:50.428 DEBUG: ‘1.SourceCode/PLSQL/T_SPC_PARAMETER.sql’ generated metadata with charset ‘UTF-8’
20:15:50.440 DEBUG: Not enough content in ‘1.SourceCode/PLSQL/T_SPC_PARAMETER.sql’ to have CPD blocks, it will not be part of the duplication detection
20:15:50.462 DEBUG: ‘1.SourceCode/PLSQL/T_CUSTOMDLTRACING_MESSAGE.sql’ generated metadata with charset ‘UTF-8’
20:15:50.466 DEBUG: Not enough content in ‘1.SourceCode/PLSQL/T_CUSTOMDLTRACING_MESSAGE.sql’ to have CPD blocks, it will not be part of the duplication detection
20:15:50.475 DEBUG: ‘1.SourceCode/PLSQL/TEMP_CL_VISUALINSPECTIONDEFECT.sql’ generated metadata with charset ‘UTF-8’
20:15:50.480 DEBUG: Not enough content in ‘1.SourceCode/PLSQL/TEMP_CL_VISUALINSPECTIONDEFECT.sql’ to have CPD blocks, it will not be part of the duplication detection
20:15:50.505 DEBUG: ‘1.SourceCode/PLSQL/T_CUSTOMDL_COLUMN_MAPPING.sql’ generated metadata with charset ‘UTF-8’
20:15:50.509 DEBUG: Not enough content in ‘1.SourceCode/PLSQL/T_CUSTOMDL_COLUMN_MAPPING.sql’ to have CPD blocks, it will not be part of the duplication detection
20:15:53.357 INFO: Sensor Z PL/SQL Analyzer [plsqlopen] (done) | time=3883ms
20:15:53.357 INFO: Sensor CSS Rules [javascript]
20:15:53.357 INFO: No CSS, PHP, HTML or VueJS files are found in the project. CSS analysis is skipped.
20:15:53.357 INFO: Sensor CSS Rules [javascript] (done) | time=0ms
20:15:53.357 INFO: Sensor C# Project Type Information [csharp]
20:15:53.358 INFO: 35/35 source files have been analyzed
20:15:53.358 INFO: Sensor C# Project Type Information [csharp] (done) | time=1ms
20:15:53.358 INFO: Sensor C# Analysis Log [csharp]
20:15:53.365 DEBUG: Project ‘FW2_TEST’: Property missing: ‘sonar.cs.analyzer.projectOutPaths’. No protobuf files will be loaded for this project.
20:15:53.365 INFO: Sensor C# Analysis Log [csharp] (done) | time=7ms
20:15:53.365 INFO: Sensor C# Properties [csharp]
20:15:53.365 DEBUG: Project ‘FW2_TEST’: Property missing: ‘sonar.cs.analyzer.projectOutPaths’. No protobuf files will be loaded for this project.
20:15:53.365 DEBUG: Project ‘FW2_TEST’: No Roslyn issues reports have been found.
20:15:53.366 INFO: Sensor C# Properties [csharp] (done) | time=1ms
20:15:53.366 INFO: Sensor HTML [web]
20:15:53.367 INFO: Sensor HTML [web] (done) | time=1ms
20:15:53.367 INFO: Sensor TextAndSecretsSensor [text]
20:15:53.375 INFO: 35 source files to be analyzed
20:15:53.597 INFO: 35/35 source files have been analyzed
20:15:53.597 INFO: Sensor TextAndSecretsSensor [text] (done) | time=230ms
20:15:53.597 INFO: Sensor VB.NET Project Type Information [vbnet]
20:15:53.598 INFO: Sensor VB.NET Project Type Information [vbnet] (done) | time=0ms
20:15:53.598 INFO: Sensor VB.NET Analysis Log [vbnet]
20:15:53.608 DEBUG: Project ‘FW2_TEST’: Property missing: ‘sonar.vbnet.analyzer.projectOutPaths’. No protobuf files will be loaded for this project.
20:15:53.609 INFO: Sensor VB.NET Analysis Log [vbnet] (done) | time=10ms
20:15:53.609 INFO: Sensor VB.NET Properties [vbnet]
20:15:53.609 DEBUG: Project ‘FW2_TEST’: Property missing: ‘sonar.vbnet.analyzer.projectOutPaths’. No protobuf files will be loaded for this project.
20:15:53.609 DEBUG: Project ‘FW2_TEST’: No Roslyn issues reports have been found.
20:15:53.609 INFO: Sensor VB.NET Properties [vbnet] (done) | time=0ms
20:15:53.609 INFO: Sensor IaC Docker Sensor [iac]
20:15:53.611 INFO: 0 source files to be analyzed
20:15:53.639 INFO: 0/0 source files have been analyzed
20:15:53.640 INFO: Sensor IaC Docker Sensor [iac] (done) | time=31ms
20:15:53.640 INFO: Sensor Generic Test Executions Report
20:15:53.640 INFO: Parsing /app/industrialisation/data/Sonar_Coverage/sonar_test_results.xml
20:15:53.653 INFO: Imported test execution data for 0 files
20:15:53.653 INFO: Test execution data ignored for 4 unknown files, including:
alltests.test_test_cnt
alltests.test_pkg_fwstm2_housekeeping
alltests.test_pkg_customdl
alltests.test_p_getinfo
20:15:53.653 INFO: Sensor Generic Test Executions Report (done) | time=13ms
20:15:53.655 INFO: ------------- Run sensors on project
20:15:53.700 DEBUG: ‘CXX verify analysis parameters’ skipped because there is no related file in current project
20:15:53.700 DEBUG: ‘XSL transformation(s)’ skipped because one of the required properties is missing
20:15:53.700 DEBUG: ‘CXX’ skipped because there is no related file in current project
20:15:53.701 DEBUG: ‘CXX RATS report import’ skipped because there is no related file in current project
20:15:53.701 DEBUG: ‘CXX Cppcheck report import’ skipped because there is no related file in current project
20:15:53.701 DEBUG: ‘CXX Infer report import’ skipped because there is no related file in current project
20:15:53.701 DEBUG: ‘CXX PC-lint report import’ skipped because there is no related file in current project
20:15:53.702 DEBUG: ‘CXX Dr. Memory report import’ skipped because there is no related file in current project
20:15:53.702 DEBUG: ‘CXX GCC compiler report import’ skipped because there is no related file in current project
20:15:53.702 DEBUG: ‘CXX Visual C++ compiler report import’ skipped because there is no related file in current project
20:15:53.702 DEBUG: ‘CXX Vera++ report import’ skipped because there is no related file in current project
20:15:53.703 DEBUG: ‘CXX Valgrind report import’ skipped because there is no related file in current project
20:15:53.703 DEBUG: ‘CXX Clang-Tidy report import’ skipped because there is no related file in current project
20:15:53.703 DEBUG: ‘CXX Clang Static Analyzer report import’ skipped because there is no related file in current project
20:15:53.703 DEBUG: ‘CXX other analyser report import’ skipped because there is no related file in current project
20:15:53.703 DEBUG: ‘CXX xUnit Test report import’ skipped because one of the required properties is missing
20:15:53.704 DEBUG: ‘CXX VSTest/NUnit Test report import’ skipped because there is no related file in current project
20:15:53.704 DEBUG: ‘CXX Bullseye coverage report import’ skipped because there is no related file in current project
20:15:53.704 DEBUG: ‘CXX Cobertura XML coverage report import’ skipped because there is no related file in current project
20:15:53.704 DEBUG: ‘CXX Testwell CTC++ TXT coverage report import’ skipped because there is no related file in current project
20:15:53.704 DEBUG: ‘CXX Visual Studio XML coverage report import’ skipped because there is no related file in current project
20:15:53.704 DEBUG: ‘C#’ skipped because there is no related file in current project
20:15:53.705 DEBUG: ‘C# File Caching Sensor’ skipped because there is no related file in current project
20:15:53.705 DEBUG: ‘C# Tests Coverage Report Import’ skipped because there is no related file in current project
20:15:53.705 DEBUG: ‘[Deprecated] C# Integration Tests Coverage Report Import’ skipped because there is no related file in current project
20:15:53.705 DEBUG: ‘C# Unit Test Results Import’ skipped because there is no related file in current project
20:15:53.705 DEBUG: ‘VB.NET’ skipped because there is no related file in current project
20:15:53.705 DEBUG: ‘VB.NET File Caching Sensor’ skipped because there is no related file in current project
20:15:53.706 DEBUG: ‘VB.NET Tests Coverage Report Import’ skipped because there is no related file in current project
20:15:53.706 DEBUG: ‘[Deprecated] VB.NET Integration Tests Coverage Report Import’ skipped because there is no related file in current project
20:15:53.706 DEBUG: ‘VB.NET Unit Test Results Import’ skipped because there is no related file in current project
20:15:53.706 DEBUG: ‘Java CPD Block Indexer’ skipped because there is no related file in current project
20:15:53.706 DEBUG: Sensors : Generic Coverage Report → Analysis Warnings import → Zero Coverage Sensor
20:15:53.706 INFO: Sensor Generic Coverage Report
20:15:53.706 INFO: Parsing /app/industrialisation/data/Sonar_Coverage/sonar_coverage.xml
20:15:53.917 INFO: Imported coverage data for 0 files
20:15:53.917 INFO: Coverage data ignored for 158 unknown files, including:
function fwstm2.f_gettracecode
function fwstm2.f_noofbuntemp
function fwstm2.f_travelloghistlottype
function fwstm2.f_travelloghistlottypeinst
function fwstm2.streamcheck
20:15:53.917 INFO: Sensor Generic Coverage Report (done) | time=211ms
20:15:53.918 INFO: Sensor Analysis Warnings import [csharp]
20:15:53.918 INFO: Sensor Analysis Warnings import [csharp] (done) | time=0ms
20:15:53.918 INFO: Sensor Zero Coverage Sensor
20:15:53.973 INFO: Sensor Zero Coverage Sensor (done) | time=55ms
20:15:53.975 INFO: SCM Publisher SCM provider for this project is: git
20:15:53.975 INFO: SCM Publisher 35 source files to be analyzed
20:15:53.978 DEBUG: Collecting committed files
20:15:53.985 DEBUG: Thread[JGit-FileStoreAttributeReader-1,5,main]: start measure timestamp resolution /mfg_indus_storage (amkfiler15v807:/mfg_indus_storage) in /mfg_indus_storage/node_jenkins_plsql/workspace/FW2_DM_CUSTOMDL_PLSQL_2024.00.00_BUILD/.git
20:15:53.988 DEBUG: Thread[JGit-FileStoreAttributeReader-1,5,main]: end measure timestamp resolution /mfg_indus_storage (amkfiler15v807:/mfg_indus_storage) in /mfg_indus_storage/node_jenkins_plsql/workspace/FW2_DM_CUSTOMDL_PLSQL_2024.00.00_BUILD/.git; got PT0.000003245S
20:15:53.988 DEBUG: Thread[JGit-FileStoreAttributeReader-1,5,main]: start measure minimal racy interval in /mfg_indus_storage/node_jenkins_plsql/workspace/FW2_DM_CUSTOMDL_PLSQL_2024.00.00_BUILD/.git
20:15:54.085 DEBUG: Thread[main,5,main]: use fallback timestamp resolution for directory /mfg_indus_storage/node_jenkins_plsql/workspace/FW2_DM_CUSTOMDL_PLSQL_2024.00.00_BUILD/.git
20:15:54.095 DEBUG: Collecting committed files (done) | time=117ms
20:15:54.102 DEBUG: Blame file (native) 1.SourceCode/PLSQL/TEMP_CL_MATERIALMATRIX.sql
20:15:54.102 DEBUG: Blame file (native) 1.SourceCode/PLSQL/TEMP_CL_DMSQUALIFIEDTOOL.sql
20:15:54.103 DEBUG: Blame file (native) 1.SourceCode/PLSQL/X_TEMP_CL_FIRSTTRACKINDATACOLLCT.sql
20:15:54.104 DEBUG: Blame file (native) 1.SourceCode/PLSQL/TEMP_CL_DMSEMCSPETTH.sql
20:15:54.132 DEBUG: Blame file (native) 1.SourceCode/PLSQL/TEMP_CL_DMSDATACOLLECTION.sql
20:15:54.135 DEBUG: Blame file (native) 1.SourceCode/PLSQL/TEMP_CL_DMSEMCSREASONCODE.sql
20:15:54.137 DEBUG: Blame file (native) 1.SourceCode/PLSQL/T_CUSTOMDL_MENU.sql
20:15:54.140 DEBUG: Blame file (native) 1.SourceCode/PLSQL/TEMP_CL_DMSQUALIFIEDCAPABILITY.sql
20:15:54.148 DEBUG: Blame file (native) 1.SourceCode/PLSQL/TEMP_CL_MESQUERYOPTION.sql
20:15:54.150 DEBUG: Blame file (native) 1.SourceCode/PLSQL/TEMP_CL_MATERIALTYPEPRIORITY.sql
20:15:54.156 DEBUG: Blame file (native) 1.SourceCode/PLSQL/T_CUSTOMDL_SUBMENU.sql
20:15:54.159 DEBUG: Blame file (native) 1.SourceCode/PLSQL/TEMP_CL_CMMSSPAREPARTS.sql
20:15:54.162 DEBUG: Blame file (native) 1.SourceCode/PLSQL/CUSTOMDL_TYPES.sql
20:15:54.172 DEBUG: Blame file (native) 1.SourceCode/PLSQL/TEMP_CL_PACKAGELINEMAPPING.sql
20:15:54.177 DEBUG: Blame file (native) 1.SourceCode/PLSQL/TEMP_CL_PROCESSBRICKCREATION.sql
20:15:54.179 DEBUG: Blame file (native) 1.SourceCode/PLSQL/TEMP_CL_CHECKLISTSTEPMTREXT.sql
20:15:54.180 DEBUG: Blame file (native) 1.SourceCode/PLSQL/TEMP_CL_DMSAVERAGECYCLETIME.sql
20:15:54.183 DEBUG: Blame file (native) 1.SourceCode/PLSQL/T_REASONDESC.sql
20:15:54.189 DEBUG: Blame file (native) 1.SourceCode/PLSQL/T_PACKAGE_FAMILY.sql
20:15:54.192 DEBUG: Blame file (native) 1.SourceCode/PLSQL/T_CUSTOMDL_TEMPLATE_INFO.sql
20:15:54.195 DEBUG: Blame file (native) 1.SourceCode/PLSQL/TEMP_CL_DMSMAXPROCESSTIME.sql
20:15:54.197 DEBUG: Blame file (native) 1.SourceCode/PLSQL/TEMP_CL_QUALIFIEDBOMCONFIG.sql
20:15:54.201 DEBUG: Blame file (native) 1.SourceCode/PLSQL/TEMP_CL_XSITEEQPUSAGEMETER.sql
20:15:54.204 DEBUG: Blame file (native) 1.SourceCode/PLSQL/Preload_Data.sql
20:15:54.207 DEBUG: Blame file (native) 1.SourceCode/PLSQL/TEMP_CL_PROCESSBRICKCONFIG.sql
20:15:54.210 DEBUG: Blame file (native) 1.SourceCode/PLSQL/T_CUSTOMDLTRACING.sql
20:15:54.217 DEBUG: Blame file (native) 1.SourceCode/PLSQL/T_CUSTOMDLTRACING_MESSAGE.sql
20:15:54.226 DEBUG: Blame file (native) 1.SourceCode/PLSQL/T_CUSTOMDL_COLUMN_MAPPING.sql
20:15:54.229 DEBUG: Blame file (native) 1.SourceCode/PLSQL/CUSTOMDL.SETUP.sql
20:15:54.233 DEBUG: Blame file (native) 1.SourceCode/PLSQL/TEMP_CL_VISUALINSPECTIONDEFECT.sql
20:15:54.237 DEBUG: Blame file (native) 1.SourceCode/PLSQL/TEMP_CL_EQPTOOL.sql
20:15:54.249 DEBUG: Blame file (native) 1.SourceCode/PLSQL/T_SPC_PARAMETER.sql
20:15:54.252 DEBUG: Blame file (native) 1.SourceCode/PLSQL/TEMP_CL_INTEGRATEDEQUIPMENT.sql
20:15:54.254 DEBUG: Blame file (native) 1.SourceCode/PLSQL/PKG_CUSTOMDL.sql
20:15:54.582 INFO: SCM Publisher 34/35 source files have been analyzed (done) | time=607ms
20:15:54.582 WARN: Missing blame information for the following files:
20:15:54.583 WARN: * 1.SourceCode/PLSQL/CUSTOMDL_SETUP.sql
20:15:54.583 WARN: This may lead to missing/broken features in SonarQube
20:15:54.589 INFO: CPD Executor 34 files had no CPD blocks
20:15:54.589 INFO: CPD Executor Calculating CPD for 1 file
20:15:54.589 DEBUG: Detection of duplications for /mfg_indus_storage/node_jenkins_plsql/workspace/FW2_DM_CUSTOMDL_PLSQL_2024.00.00_BUILD/1.SourceCode/PLSQL/PKG_CUSTOMDL.sql

Test report and coverage both are ignored.

I used below properties file.

must be unique in a given SonarQube instance

sonar.projectKey=$PROJECT_KEY

this is the name displayed in the SonarQube UI

sonar.projectBaseDir=$RELEASE_WORKSPACE

sonar.projectName=$PROJECT_NAME

sonar.projectVersion=$REPORT_VERSION

sonar.sources=$RELEASE_WORKSPACE/1.SourceCode/PLSQL

#sonar.inclusions=**/*.sql

sonar.coverageReportPaths= /app/data/Sonar_Coverage/sonar_coverage.xml

sonar.organization=utplsql
#sonar.tests=./test
sonar.testExecutionReportPaths=/app/data/Sonar_Coverage/sonar_test_results.xml

sonar.verbose=true

Encoding of the source code. Default is default system encoding

sonar.language=plsql

sonar.sourceEncoding=UTF-8

Please confirm if i need to change the configration

As suspected, both reports lack the paths to the source files.

This occurs because utPLSQL executes unit tests with the source code compiled in the database and doesn’t know anything about how the source code is stored. However, SonarQube requires that these reports include the path to the corresponding files.

To generate the reports correctly with the file paths, utPLSQL offers a feature that maps database object names to project files. The proper configuration, however, depends on the file naming conventions and requires a complex combination of mapping parameters.

I’ve wrote a guide here with detailed instructions on generating reports correctly. I hope you’ll find it useful.

As I am using SonarQube community edition so is there any restriction from communtiy edition.
because i have checked code coverage and test report both are correct.

This issue isn’t due to a restriction from the community edition; it happens because the reports are incorrect.

When you open the “sonar_coverage.xml” file in a text editor, you might notice lines such as:

<file path="function fwstm2.f_gettracecode">

However, the file should actually include the disk paths to the files, like so:

<file path="source/f_gettracecode.sql">

The guide I referenced in my previous comment details how to configure the utPLSQL-cli tool to generate the reports correctly.

I’m looking to an option to simplify this process in the future to facilitate easier report generation, but for now, there are no alternatives.

Hi Felipe,
Thanks For you quick response.

Below are the project structure.

1.SourceCode (PLSQL Source code)
├── PLSQL
├── CUSTOMDL.SETUP.sql
├── CUSTOMDL_TYPES.sql

Test (Unit test files)
├── test_pkg_customdl.sql
├── test_pkg_customdl.sql

Below command using to generate coverage and test report. but code coverage getting blank for all .sql files.

utplsql run -d FWST/****@server:port/MES21 -f=ut_coverage_sonar_reporter -o=coverage.xml -f=ut_sonar_test_reporter -o=test.xml -source_path=1.SourceCode/PLSQL -test_path=/test

NOTE:- When i used .pkb extension in same project structure that time i am getting code coverage with .pkb files.

Please let me know is there any solution to get code coverage using .sql files because in my application we are using .sql extension.

** When i skipped (not passing path parameter) “-source_path=1.SourceCode/PLSQL” that time i am getting code coverage for .sql files **

If all your packages are .sql, I think these parameters should work for your case:

-f=ut_coverage_sonar_reporter -o=coverage.xml -f=ut_sonar_test_reporter -o=test.xml -source_path=1.SourceCode/PLSQL -type_mapping="sql=PACKAGE BODY" -test_path=/test -type_mapping="sql=PACKAGE BODY"

Does your project also include standalone procedures and functions? If so, is there a way to distinguish whether a file is a package, procedure, or function (such as a different file extension or a specific subfolder)?

Hi Felipe

Thanks for your response.

Now code coverage is working with .sql files.