Conversation
Adding a types required to support block coverage Updated html reporter Changed name of get raw data coverage for profiler to allow execution of block one. Get coverage data have now logical block to allow run type of proftab or block coverage (block will be added in next iteration). Signed-off-by: lwasylow <lwasylow@gmail.com>
Add block coverage
Moved get raw coverage into dynamic cursors to minimize impact on compilation
Added Some more tests for test block coverage.
Fixes to cycle dependancies
Added test to cover for block coverage in regression
Update block to be called from dynamic sql to avoid a compilation issues. Updated documentation
Amended install script to not fail when block coverage not present
Block Coverage for 12.2 Oracle
split block and proftab for better visibility.
Moved HTML reporters stable version Introduced constant for easier maintain. Signed-off-by: lwasylow <lwasylow@gmail.com>
Feature/12cblockcoverage
Revert "Feature/12cblockcoverage"
Split block and profiler Added conditional blocks for version less than 12.2 Split html reporter
Split block and profiler Added conditional blocks for version less than 12.2 Split html reporter
…L into feature/12cblockcoverage
Refactor Coverage: test passed
| $if dbms_db_version.version = 12 and dbms_db_version.release >= 2 or dbms_db_version.version > 12 $then | ||
| return ut_coverage_block.get_coverage_data_block(a_coverage_options => a_coverage_options); | ||
| $else | ||
| return null; |
There was a problem hiding this comment.
Its something we could consider. However if we want to warn then probably at the coverage_start function.
I could create a new type of error and raise an error at the start of the coverage something like:
Requested reporter is not available, please check you install and documentation.
that would stop running rest of test which is probably valid as when you request coverage you don't want to continue without it.
Another option would be to force user to switch to profiler instead however some information would have to be displayed not a really big fan of forcing solutions.
| procedure run_autonomous( | ||
| a_paths ut_varchar2_list, a_reporter ut_reporter_base, a_color_console integer, | ||
| a_coverage_schemes ut_varchar2_list := null, a_source_file_mappings ut_file_mappings, a_test_file_mappings ut_file_mappings, | ||
| a_coverage_schemes ut_varchar2_list := null,a_coverage_type varchar2:=null, a_source_file_mappings ut_file_mappings, a_test_file_mappings ut_file_mappings, |
There was a problem hiding this comment.
The new parameter should be added as last to avoid breaking changes to API.
| procedure run_autonomous( | ||
| a_paths ut_varchar2_list, a_reporter ut_reporter_base, a_color_console integer, | ||
| a_coverage_schemes ut_varchar2_list := null, a_source_files ut_varchar2_list, a_test_files ut_varchar2_list, | ||
| a_coverage_schemes ut_varchar2_list := null,a_coverage_type varchar2:=null, a_source_files ut_varchar2_list, a_test_files ut_varchar2_list, |
| @@ -0,0 +1,89 @@ | |||
| create or replace package body ut_block_helper is | |||
There was a problem hiding this comment.
maybe name it ut_block_coverage_helper - easier to understand
|
|
||
| type t_proftab_rows is table of t_proftab_row; | ||
|
|
||
| type t_block_row is record( |
There was a problem hiding this comment.
I would transform the not-so-good Oracle results into:
- start_line binary_integer
- end_line binary_integer - (
lead(line,1) over(order by line)from coverage data - null if no next line) - blocks binary_integer
- covered_blocks binary_integer
I assume that there is no situation where we have more than 1 block spanning across more than one line.
That is:
only when start_line = end_line we can get blocks>1
There was a problem hiding this comment.
I’m afraid it might be possible for complex multi line if Statement
There was a problem hiding this comment.
Even when simple if and bad beutifier we would have one block in single line.
There was a problem hiding this comment.
That will skew the results. Block is not necessary span across mutliple lines, using start and end line will result in showing execution on multiple lines that are not part of block.
Unfortunately block coverage is not including things like LOOP etc. That will give a wrong impression of loop not being executed etc.
| -- The subquery is optimized by: | ||
| -- - COALESCE function -> it will execute only for TRIGGERS | ||
| -- - scalar subquery cache -> it will only execute once for one trigger source code. | ||
| function get_cov_sources_sql(a_coverage_options ut_coverage_options) return varchar2 is |
There was a problem hiding this comment.
Isn't that function duplicated in two packages now?
There was a problem hiding this comment.
Not exactly, I block coverage we do not skip any lines. I tried to keep to minimum number of places where there is a If decision. What I might do is to move it to generic helper and in profiler coverage package put some code to apply case statement for skipping lines before execution. So that main query will be maintained in one place.
Fixes to order of new attribute. Rename package to more meaningful name Introduce an raise an error for non existing coverage type Update tests
12.2 coverage
Fixes to order of new attribute. Rename package to more meaningful name Introduce an raise an error for non existing coverage type Update tests
…L into feature/12cblockcoverage
Feature/12cblockcoverage
…sing block coverage.
…/utPLSQL into feature/12cov_extended
…ture/12cov_extended
Feature/12cov extended
Fixes to new asso array during mock coverage id.
… into feature/12cblockcoverage
…ed lines by displaying a covered not covered blocks.
|
Changes has been added for extended coverage and fixes implemented as per recommendation when required. |
jgebal
left a comment
There was a problem hiding this comment.
Once conflicts are resolved, we're good to merge the changes.
Added a support for running cover coverage from Oracle Block Coverage.
Changes includes,update to html reporter for presentation of data,update to core types to support new coverage type option as well as few minor changes.
Default option remains profiler. The queries are in sys refcursors to avoid a compilation issues on older version of databases.
Fixes #476