Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Improved coverage reporting on suite manager.
Fixed issue with test package not getting dropped after tests.
Adding spooling of tests results.
  • Loading branch information
jgebal committed Jul 12, 2017
commit 453fbff310348aa2fd56d52684fc7cfe9fb0f586
2 changes: 1 addition & 1 deletion .travis/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ alter user $UT3_OWNER identified by $UT3_OWNER_PASSWORD;
--needed for Mystats script to work
grant select any dictionary to $UT3_OWNER;
--Needed for testing a coverage outside ut3_owner.
grant create any procedure, execute any procedure to $UT3_OWNER;
grant create any procedure, drop any procedure, execute any procedure to $UT3_OWNER;

set feedback off
@../source/create_utplsql_owner.sql $UT3_USER $UT3_USER_PASSWORD $UT3_TABLESPACE
Expand Down
38 changes: 14 additions & 24 deletions source/core/ut_suite_manager.pkb
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,11 @@ create or replace package body ut_suite_manager is

if l_annotation_data.package_annotations.exists('rollback') then
l_suite_rollback_annotation := l_annotation_data.package_annotations('rollback').text;
l_suite_rollback := case lower(l_suite_rollback_annotation)
when 'manual' then
ut_utils.gc_rollback_manual
when 'auto' then
ut_utils.gc_rollback_auto
else
ut_utils.gc_rollback_auto
end;
if lower(l_suite_rollback_annotation) = 'manual' then
l_suite_rollback := ut_utils.gc_rollback_manual;
else
l_suite_rollback := ut_utils.gc_rollback_auto;
end if;
else
l_suite_rollback := ut_utils.gc_rollback_auto;
end if;
Expand Down Expand Up @@ -158,16 +155,13 @@ create or replace package body ut_suite_manager is

if l_proc_annotations.exists('rollback') then
l_rollback_annotation := l_proc_annotations('rollback').text;
l_rollback_type := case lower(l_rollback_annotation)
when 'manual' then
ut_utils.gc_rollback_manual
when 'auto' then
ut_utils.gc_rollback_auto
--when 'on-error' then
-- ut_utils.gc_rollback_on_error
else
l_suite_rollback
end;
if lower(l_rollback_annotation) = 'manual' then
l_rollback_type := ut_utils.gc_rollback_manual;
elsif lower(l_rollback_annotation) = 'auto' then
l_rollback_type := ut_utils.gc_rollback_auto;
else
l_rollback_type := l_suite_rollback;
end if;
end if;

l_test := ut_test(a_object_owner => l_owner_name
Expand Down Expand Up @@ -333,9 +327,8 @@ create or replace package body ut_suite_manager is
begin
-- Currently cache invalidation on DDL is not implemented so schema is rescaned each time
l_schema_info := get_schema_info(a_schema_name);
if not g_schema_suites.exists(a_schema_name) or g_schema_suites(a_schema_name)
.changed_at <= l_schema_info.changed_at
or g_schema_suites(a_schema_name).obj_cnt != l_schema_info.obj_cnt then
if not g_schema_suites.exists(a_schema_name) or g_schema_suites(a_schema_name).changed_at <= l_schema_info.changed_at or
g_schema_suites(a_schema_name).obj_cnt != l_schema_info.obj_cnt then
ut_utils.debug_log('Rescanning schema ' || a_schema_name);
config_schema(a_schema_name);
end if;
Expand All @@ -354,9 +347,6 @@ create or replace package body ut_suite_manager is
procedure populate_suite_ut_packages(a_suite ut_logical_suite, a_packages in out nocopy ut_object_names) is
l_sub_suite ut_logical_suite;
begin
if a_packages is null then
a_packages := ut_object_names();
end if;
if a_suite is of (ut_suite) then
a_packages.extend;
a_packages(a_packages.last) := ut_object_name(a_suite.object_owner, a_suite.object_name);
Expand Down
8 changes: 7 additions & 1 deletion tests/RunAll.sql
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ set longchunksize 1000000
set serveroutput on size unlimited format truncated
@@lib/RunVars.sql

@@lib/mystats/mystats start

spool RunAll.log

--Global setup
@@helpers/ut_example_tests.pks
@@helpers/ut_example_tests.pkb
Expand All @@ -32,7 +36,6 @@ create table ut$test_table (val varchar2(1));
--Start coverage in develop mode (coverage for utPLSQL framework)
--Regular coverage excludes the framework
exec ut_coverage.coverage_start_develop();
@@lib/mystats/mystats start

@@lib/RunTest.sql ut_annotations/ut_annotations.parse_package_annotations.IgnoreWrappedPackageAndDoesNotRaiseException.sql
@@lib/RunTest.sql ut_annotations/ut_annotations.parse_package_annotations.ParseAnnotationMixedWithWrongBeforeProcedure.sql
Expand Down Expand Up @@ -263,6 +266,8 @@ exec ut_coverage.coverage_start_develop();
--Finally
@@lib/RunSummary

spool off

--Global cleanup
--removing objects that should not be part of coverage report
drop package ut_example_tests;
Expand All @@ -276,6 +281,7 @@ drop package test_package_2;
drop package test_package_3;
drop type utplsql_test_reporter;
drop package test_reporters;
drop package ut3$user#.html_coverage_test;

set timing on
prompt Generating coverage data to reporter outputs
Expand Down