- Notifications
You must be signed in to change notification settings - Fork 21
Description
Hi Team,
We are trying to do a Proof of Concept (PoC) to generate the code coverage for PLSQL code using utPLSQL. We are using the structure, code & tests from the reference repo here –
Reference repo url: https://github.com/utPLSQL/utPLSQL-demo-project/tree/develop
We are running the tests in Jenkins using shell scripts. All tests are shown to be successfully executed in Jenkins Console output but all the Coverage reports created (HTML, XML etc.) are created in Jenkins workspace as blank i.e 0% coverage.
Project Details
Versions:
utPLSQL --3.1.12
utPLSQL-cli--3.1.9
Oracle --19c
We have done UTPLSQL Headless installation as sysdba and UT3 user is created for executing the tests.
Project Structure: (We are using the same repo-utPLSQL-demo-project)
sources
award_bonus
R__award_bonus.prc
award_bonus.xml
v1.01_employees_test.sql
Install.sql
tests
award_bonus
test_award_bonus.pks
test_award_bonus.pkb
Install.sql
We are executing the below scripts in Jenkins Execute Shell to install the code, test cases and run the tests in the same sequence.
Script 1 – Load Sources
sqlplus ut3/ut3@<dbname/schema with port details> @sources/install.sql
Script 2 – Load Tests
sqlplus ut3/ut3@<dbname/schema with port details> @tests/install.sql
Script 3 – Run Unit Tests
utPLSQL-cli/bin/utplsql run ut3/ut3@<dbname/schema with port details>
-source_path=sources
-test_path=tests
-f=ut_documentation_reporter -c
-f=ut_coverage_html_reporter -o=coverage.html
-f=ut_sonar_test_reporter -o=test_results.xml
--failure-exit-code=0
Issue:
In the Jenkins console output, ut_documentation report showing 3 tests are executed successfully and there are no errors. But in the Jenkins workspace the coverage,html showing 0 lines. Same is case with coverage.xml report.
image
Note: For UT3 we have verified that it has the below access.
create any procedure, execute any procedure, create session, create procedure, create trigger, create type, create table, create sequence, create view, create any Trigger.
We even checked the PROFILER & DBMS tables i.e. DBMSPCC_BLOCKS,DBMSPCC_RUNS,DBMSPCC_UNITS,PLSQL_PROFILER_DATA,PLSQL_PROFILER_RUNS and PLSQL_PROFILER_UNITS and we can see these tables are getting populated with new data as soon as the Jenkins run is completed. In fact in the DBMSPCC_BLOCKS we can also see the field COVERED as 1 for few entries and 0 for few entries indicating some lines are covered using the tests executed.
Can anyone guide us on what we are missing here so that we can get the coverage report is populated. Any leads will be appreciated.