Toad World® Forums

Code Coverage


#1

I’m trying to get the code coverage reports to work, but I am only seeing the following in my generated reports:
No code coverage/profile data exists for VIDEO.TTS_GENERATOR.

I have a suite, with 1 test. The 1 test has “Gather code coverage data” checked.

After recompiling the test, it succeeds, however my report shows that there is no profile data available.

I have rollback checked before the test execution and nothing checked for after execution (default).

Thanks for any advice,
Matthew


#2

I will look into this. If you run the test definition outside of the suite, do you then see coverage data?

And could you please check the contents of your underlying PLSQL_PROFILER* tables to see if data is in THEM?


#3

I just ran my test definition both independently and within a suite, both ways I got code coverage information.

So…assuming you cannot see anything even after running the test separately, please create a support bundle, specifying that program unit, and then send it to me to take a closer look:

steven.feuerstein@quest.com

Regards, SF


#4

As always, thanks so much for your quick attention Steven.

I’ll create the support bundle, but I want to make sure I am doing this right first.

There appears to be two seperate “Code Coverage” selection options.

  1. opening up a test from the “Program Tested” pane.
    right click -> Test Editor
    Tested Edtior (with “Test Definition” (top level selected) choose "Gather code coverage data.
  2. Further down the tree (in the left-hand pane of the Test Editor)
    Choose -> Unit Tests -> GETVEHICELTYPE (FUNCTION) -> Test Cases -> POSTIIVE_SUV (my test).
    Select "Gather code coverage data

With both of these checked, I get data into plsql_profiler_data and plsql_profiler_units, but it looks like coverage numbers on the test framework (eg: QU_RESULT_EXP, QU_RUNTIME, Q##TTS_GENERATOR ), but no coverage numbers on the program being tested (VIDEO.TTS_GENERATOR)

In your product, is the code coverage report supposed to focus on the test coverage of the tested program or the testing program?


#5

NM, that was a silly question. THe profile records all interactions. So, it would appear that my code is not being called or the profiler would have caught it. I’ll trace through the excution of the test case and see if I can figure out why.

Edit: After looking at it, I can’t see why my code isn’t profiled. The suite has the qu_result_xp.profile_all_unit_tests() call in the suite setup and the configure should turn it on. I’ll submit a issue.

Message was edited by: DwarF


#6

Solution, for anyone else that runs into this issue:
I created a new user “qctester” to store all the schema objects and test cases. I granted this user permission to execute other code in the database. However, oracle requires the executing user to have “create” permissions on the executed object in order to record profiling data for the session.

Solution: grant “execute any procedure to qctester”, and now my reports work.


#7

Thanks for sharing your experience, Matthew. This has been added to the FAQ for 1.8.3.

SF