Repository navigation
Exclude set of Procs From Code Coverage report #1348
Unanswered ntubati asked this question in Q&A Exclude set of Procs From Code Coverage report #1348Uh oh!
There was an error while loading. Please reload this page.
{{title}}
Something went wrong.Uh oh!
There was an error while loading. Please reload this page.
ntubati
May 2, 2025
|
Describe the bug When I run the below command I am getting the coverage report all on the lines one code. I only wrote test cases for 2 procs and sonar report is showing 2.5% coverage I am trying to exclude the other procs except the two procs that i wrote test cases. I tried to exclude one proc with following command utplsql run -c "apps/****@db" -p="apps.TEST_XXGCO_BRIDGE_SAAS_INTG_PKG" -f=ut_coverage_sonar_reporter -o="utplsql_coverage.xml" --coverage-schemes=APPS -include=APPS.XXGCO_BRIDGE_SAAS_INTG_PKG -exclude=APPS.XXGCO_BRIDGE_SAAS_INTG_PKG.PROCESS_SALES_ORDER_EXTRACT But it is giving me blank coverage report like below Provide version info Running on utPLSQL v3.1.14.4197 utPLSQL-cli 3.1.9.localutPLSQL-java-api 3.1.9.localJava-Version: 1.8.0_431ORACLE_HOME: nullNLS_LANG: nullThanks for testing!
|
Replies: 3 comments
Comment optionsUh oh!
There was an error while loading. Please reload this page.
{{title}}
Something went wrong.Uh oh!
There was an error while loading. Please reload this page.
jgebal
May 2, 2025
Maintainer
|
Hello @ntubati The code coverage is a metric that indicates the percentage of code that is executed during a test run. utPLSQL provides line coverage and a block coverage (branches per line of code). It is not possible to exclude/include individual functions of a single package from a coverage report. That would also be very much confusing as the percentage of coverage is presented for the whole compiled program unit (package) not for the fragments of that program unit. I am not sure what is the goal that you are trying to achieve. In my opinion, since the coverage report says that 2.5% of code is covered with tests, than it is clear that the remaining part is not tested. |
Uh oh!
There was an error while loading. Please reload this page.
{{title}}
Something went wrong.Uh oh!
There was an error while loading. Please reload this page.
ntubati
May 2, 2025
Author
|
Thanks for the detailed reply. We have never done unit testing cover for PLSQL in our application and we have lot of legacy code. we are planning to start using this and doing a poc. One of the ask is to see how we can calculate the code coverage only for incremental code not for the legacy code. I guess in this case first we have to upload as is code coverage which will show 0 and then look for coverage for incremental code. Ba based on what you explained , if i have custom package procedure which calls the standard oracle procedure , I can't exclude it from coverage report , but i can exclude it from testing? |
Uh oh!
There was an error while loading. Please reload this page.
{{title}}
Something went wrong.Uh oh!
There was an error while loading. Please reload this page.
jgebal
May 3, 2025
Maintainer
|
You can exclude separate units of compiled code. I suspect that you do not change oracle supplied packages by adding your custom code into their program units. So you should be able to exclude program units that you do not own and only measure coverage on program units that you own and are responsible for. I hope this answers your questions. |
This discussion was converted from issue #1302 on May 09, 2026 18:41.
Heading Bold Italic Quote Code LinkNumbered list Unordered list Task list
Attach files Mention Reference Menu
Select a reply
LoadingUh oh!
There was an error while loading. Please reload this page.
Create a new saved reply reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji