-
Notifications
You must be signed in to change notification settings - Fork 186
Exclude set of Procs From Code Coverage report #1302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
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. |
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? |
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. |
Describe the bug
I have package that has 11 functions .
I am trying to get the sonar coverage report for this and when I run
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
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
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.local
utPLSQL-java-api 3.1.9.local
Java-Version: 1.8.0_431
ORACLE_HOME: null
NLS_LANG: null
Thanks for testing!
The text was updated successfully, but these errors were encountered: