Closed felipebz closed 3 months ago
With the the new sensor, importing utPLSQL test reports has been streamlined. The previous requirement for test file mapping in utplsql-cli will become obsolete. Users can exclusively rely on the newly introduced property sonar.zpa.utplsql.reportPaths
for seamless integration.
Example: https://github.com/felipebz/utPLSQL-demo-project/commit/503d333bc41037d0001febe5d1d1de2a013f0411
I am currently importing test and coverage data of the utPLSQL project to the SonarQube + ZPA demo instance.
The reports are generated using the following command, which does not include any object-file mapping argument:
utPLSQL-cli/bin/utplsql run UT3_TESTER_HELPER/ut3@${CONNECTION_STR} \
-p='ut3_tester,ut3_user' --coverage-schemes=ut3_develop \
-f=ut_coverage_sonar_reporter -o=coverage.xml \
-f=ut_sonar_test_reporter -o=test_results.xml
The data is imported correctly without any errors or warnings, confirming that the implementation works properly:
INFO: Sensor Z PL/SQL Analyzer - utPLSQL Report Importer [plsqlopen]
INFO: Processing test report /github/workspace/test_results.xml
INFO: Processing coverage report /github/workspace/coverage.xml
INFO: Sensor Z PL/SQL Analyzer - utPLSQL Report Importer [plsqlopen] (done)
This should be enough for most users.
Generating tests and coverage accurately with utPLSQL-cli can be quite challenging due to its mapping configuration, as illustrated in this guide.
Achieving accurate results can be challenging due to certain constraints, as outlined in the official documentation:
Generating a report without specifying any object-file mapping rule will return a report without file path. Examples:
The ZPA parser already parses all primary and test sources, and it can identify the file that declares the
function scott.betwnstr
. The core idea involves:sonar.zpa.tests.reportPaths
andsonar.zpa.coverage.reportPaths
into the plugin. These can be populated with the test and coverage reports, regardless of object-file mapping details.This approach should overcome all the current limitations.