Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
86d4d0a
Initial check-in.
lwasylow Mar 18, 2022
f1f6d71
Tidy up code to make sure we got distinct set of expanded tests.
lwasylow Mar 19, 2022
1454221
Adding extra fields.
lwasylow Mar 23, 2022
ce4df28
Stage 3. Fixing error calls.
lwasylow Mar 29, 2022
273962b
Fixing issue with a non visible tests.
lwasylow Mar 29, 2022
a753e66
Fixing ORA-600
lwasylow Mar 30, 2022
0d8d34d
Cleanup Phase1.
lwasylow Mar 30, 2022
95ddec1
Adding tests.
lwasylow Mar 31, 2022
83dbdaa
Updating documentation.
lwasylow Mar 31, 2022
52c0307
Addresing sonar issues
lwasylow Mar 31, 2022
8f8d257
Extra tests and cleanup of old code.
lwasylow Apr 1, 2022
12be123
Adding extra tests
lwasylow Apr 1, 2022
d5ee6ca
Updating SQL to expand paths and extract suites.
lwasylow Apr 1, 2022
2db8d63
Addressing issue with reconstruct_cache knocking off other levels.
lwasylow Apr 6, 2022
d3396fe
Update tests for random order
lwasylow Apr 7, 2022
02d41a6
Removing a hash function from api into utils package which is more su…
lwasylow Apr 7, 2022
274d80a
Fixing ordering
lwasylow Apr 7, 2022
3937737
Fixing a documentation
lwasylow Apr 7, 2022
9296f38
Fixing indent
lwasylow Apr 7, 2022
6ff7f38
Peer review changes
lwasylow Apr 12, 2022
ee7a98b
Moving a SQL to be more readable.
lwasylow Apr 12, 2022
a53cefa
Apply suggestions from code review
jgebal Apr 13, 2022
011970f
Apply suggestions from code review
jgebal Apr 13, 2022
71e07f9
Merge remote-tracking branch 'origin/develop' into feature/call_tests…
jgebal Apr 15, 2022
221c2de
Address issue of not recognizing a correct nested level of suitepath.
lwasylow Apr 16, 2022
870cfe4
Merge branch 'feature/call_tests_by_part_of_name' of https://github.c…
lwasylow Apr 16, 2022
51439d8
Update documentation
lwasylow Apr 16, 2022
0fc7ff6
Fixing issue where parition by only path caused a duplicate level 1 a…
lwasylow Apr 16, 2022
647b830
Fixed issue with suites getting duplicated when running tests across …
jgebal Apr 17, 2022
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
Fixing issue with a non visible tests.
  • Loading branch information
lwasylow committed Mar 29, 2022
commit 273962b39c864cfcc38616f3827d434e6fc4879b
173 changes: 11 additions & 162 deletions source/core/ut_suite_manager.pkb
Original file line number Diff line number Diff line change
Expand Up @@ -253,121 +253,6 @@ create or replace package body ut_suite_manager is
return l_result;
end;

function get_logical_suite(
a_rows ut_suite_cache_rows,
a_idx pls_integer,
a_level pls_integer,
a_prev_level pls_integer,
a_items_at_level t_item_levels
) return ut_suite_item is
l_result ut_suite_item;
begin
case a_rows( a_idx ).self_type
when 'UT_SUITE' then
l_result :=
case when a_prev_level > a_level then
ut_suite(
self_type => a_rows( a_idx ).self_type,
object_owner => a_rows( a_idx ).object_owner, object_name => lower( a_rows( a_idx ).object_name),
name => lower( a_rows( a_idx ).name), description => a_rows( a_idx ).description, path => a_rows( a_idx ).path,
rollback_type => a_rows( a_idx ).rollback_type, disabled_flag => a_rows( a_idx ).disabled_flag, disabled_reason => a_rows(a_idx).disabled_reason,
line_no => a_rows( a_idx ).line_no, parse_time => a_rows( a_idx ).parse_time,
start_time => null, end_time => null, result => null, warnings => a_rows( a_idx ).warnings,
results_count => ut_results_counter(), transaction_invalidators => ut_varchar2_list(),
items => a_items_at_level(a_prev_level),
before_all_list => sort_by_seq_no( a_rows( a_idx ).before_all_list), after_all_list => sort_by_seq_no(
a_rows( a_idx ).after_all_list), tags => a_rows(a_idx).tags
)
else
ut_suite(
self_type => a_rows( a_idx ).self_type,
object_owner => a_rows( a_idx ).object_owner, object_name => lower( a_rows( a_idx ).object_name),
name => lower( a_rows( a_idx ).name), description => a_rows( a_idx ).description, path => a_rows( a_idx ).path,
rollback_type => a_rows( a_idx ).rollback_type, disabled_flag => a_rows( a_idx ).disabled_flag, disabled_reason => a_rows(a_idx).disabled_reason,
line_no => a_rows( a_idx ).line_no, parse_time => a_rows( a_idx ).parse_time,
start_time => null, end_time => null, result => null, warnings => a_rows( a_idx ).warnings,
results_count => ut_results_counter(), transaction_invalidators => ut_varchar2_list(),
items => ut_suite_items(),
before_all_list => sort_by_seq_no( a_rows( a_idx ).before_all_list), after_all_list => sort_by_seq_no(
a_rows( a_idx ).after_all_list), tags => a_rows(a_idx).tags
)
end;
when 'UT_SUITE_CONTEXT' then
l_result :=
case when a_prev_level > a_level then
ut_suite_context(
self_type => a_rows( a_idx ).self_type,
object_owner => a_rows( a_idx ).object_owner, object_name => lower( a_rows( a_idx ).object_name),
name => lower( a_rows( a_idx ).name), description => a_rows( a_idx ).description, path => a_rows( a_idx ).path,
rollback_type => a_rows( a_idx ).rollback_type, disabled_flag => a_rows( a_idx ).disabled_flag, disabled_reason => a_rows(a_idx).disabled_reason,
line_no => a_rows( a_idx ).line_no, parse_time => a_rows( a_idx ).parse_time,
start_time => null, end_time => null, result => null, warnings => a_rows( a_idx ).warnings,
results_count => ut_results_counter(), transaction_invalidators => ut_varchar2_list(),
items => a_items_at_level(a_prev_level),
before_all_list => sort_by_seq_no( a_rows( a_idx ).before_all_list), after_all_list => sort_by_seq_no(
a_rows( a_idx ).after_all_list), tags => a_rows(a_idx).tags
)
else
ut_suite_context(
self_type => a_rows( a_idx ).self_type,
object_owner => a_rows( a_idx ).object_owner, object_name => lower( a_rows( a_idx ).object_name),
name => lower( a_rows( a_idx ).name), description => a_rows( a_idx ).description, path => a_rows( a_idx ).path,
rollback_type => a_rows( a_idx ).rollback_type, disabled_flag => a_rows( a_idx ).disabled_flag, disabled_reason => a_rows(a_idx).disabled_reason,
line_no => a_rows( a_idx ).line_no, parse_time => a_rows( a_idx ).parse_time,
start_time => null, end_time => null, result => null, warnings => a_rows( a_idx ).warnings,
results_count => ut_results_counter(), transaction_invalidators => ut_varchar2_list(),
items => ut_suite_items(),
before_all_list => sort_by_seq_no( a_rows( a_idx ).before_all_list), after_all_list => sort_by_seq_no(
a_rows( a_idx ).after_all_list), tags => a_rows(a_idx).tags
)
end;
when 'UT_LOGICAL_SUITE' then
l_result :=
case when a_prev_level > a_level then
ut_logical_suite(
self_type => a_rows( a_idx ).self_type,
object_owner => a_rows( a_idx ).object_owner, object_name => lower( a_rows( a_idx ).object_name),
name => lower( a_rows( a_idx ).name), description => a_rows( a_idx ).description, path => a_rows( a_idx ).path,
rollback_type => a_rows( a_idx ).rollback_type, disabled_flag => a_rows( a_idx ).disabled_flag, disabled_reason => a_rows(a_idx).disabled_reason,
line_no => a_rows( a_idx ).line_no, parse_time => a_rows( a_idx ).parse_time,
start_time => null, end_time => null, result => null, warnings => a_rows( a_idx ).warnings,
results_count => ut_results_counter(), transaction_invalidators => ut_varchar2_list(),
items => a_items_at_level(a_prev_level), tags => null
)
else
ut_logical_suite(
self_type => a_rows( a_idx ).self_type,
object_owner => a_rows( a_idx ).object_owner, object_name => lower( a_rows( a_idx ).object_name),
name => lower( a_rows( a_idx ).name), description => a_rows( a_idx ).description, path => a_rows( a_idx ).path,
rollback_type => a_rows( a_idx ).rollback_type, disabled_flag => a_rows( a_idx ).disabled_flag, disabled_reason => a_rows(a_idx).disabled_reason,
line_no => a_rows( a_idx ).line_no, parse_time => a_rows( a_idx ).parse_time,
start_time => null, end_time => null, result => null, warnings => a_rows( a_idx ).warnings,
results_count => ut_results_counter(), transaction_invalidators => ut_varchar2_list(),
items => ut_suite_items(), tags => null
)
end;
when 'UT_TEST' then
l_result :=
ut_test(
self_type => a_rows(a_idx).self_type,
object_owner => a_rows(a_idx).object_owner, object_name => lower(a_rows(a_idx).object_name),
name => lower(a_rows(a_idx).name), description => a_rows(a_idx).description, path => a_rows(a_idx).path,
rollback_type => a_rows(a_idx).rollback_type, disabled_flag => a_rows(a_idx).disabled_flag, disabled_reason => a_rows(a_idx).disabled_reason,
line_no => a_rows(a_idx).line_no, parse_time => a_rows(a_idx).parse_time,
start_time => null, end_time => null, result => null, warnings => a_rows(a_idx).warnings,
results_count => ut_results_counter(), transaction_invalidators => ut_varchar2_list(),
before_each_list => sort_by_seq_no(a_rows(a_idx).before_each_list), before_test_list => sort_by_seq_no(a_rows(a_idx).before_test_list),
item => a_rows(a_idx).item,
after_test_list => sort_by_seq_no(a_rows(a_idx).after_test_list), after_each_list => sort_by_seq_no(a_rows(a_idx).after_each_list),
all_expectations => ut_expectation_results(), failed_expectations => ut_expectation_results(),
parent_error_stack_trace => null, expected_error_codes => a_rows(a_idx).expected_error_codes,
tags => a_rows(a_idx).tags
);
end case;
l_result.results_count.warnings_count := l_result.warnings.count;
return l_result;
end;

procedure reconstruct_from_cache(
a_suites in out nocopy ut_suite_items,
a_suite_data_cursor sys_refcursor
Expand Down Expand Up @@ -414,47 +299,7 @@ create or replace package body ut_suite_manager is
close a_suite_data_cursor;
end reconstruct_from_cache;

procedure reconstruct_from_cache(
a_suites in out nocopy ut_suite_items,
a_suite_data_cursor ut_suite_cache_rows
) is
c_bulk_limit constant pls_integer := 1000;
l_items_at_level t_item_levels;
l_rows ut_suite_cache_rows := a_suite_data_cursor;
l_level pls_integer;
l_prev_level pls_integer;
l_idx integer;
begin
l_idx := l_rows.first;
while l_idx is not null loop
l_level := length(l_rows(l_idx).path) - length( replace(l_rows(l_idx).path, '.') ) + 1;
if l_level > 1 then
if not l_items_at_level.exists(l_level) then
l_items_at_level(l_level) := ut_suite_items();
end if;
l_items_at_level(l_level).extend;
pragma inline(get_logical_suite, 'YES');
l_items_at_level(l_level)(l_items_at_level(l_level).last) := get_logical_suite(l_rows, l_idx, l_level,l_prev_level, l_items_at_level );
else
a_suites.extend;
pragma inline(get_logical_suite, 'YES');
a_suites(a_suites.last) := get_logical_suite(l_rows, l_idx, l_level,l_prev_level, l_items_at_level );
end if;
if l_prev_level > l_level then
l_items_at_level(l_prev_level).delete;
end if;
l_prev_level := l_level;
l_idx := l_rows.next(l_idx);
end loop;

reverse_list_order( a_suites );

for i in 1 .. a_suites.count loop
a_suites( i ).set_rollback_type( a_suites( i ).get_rollback_type );
end loop;
end reconstruct_from_cache;



function get_cached_suite_data(
a_object_owner varchar2,
a_path varchar2 := null,
Expand Down Expand Up @@ -529,9 +374,6 @@ create or replace package body ut_suite_manager is
a_schema_paths ut_path_items,
a_filtered_rows ut_suite_cache_rows
) is
l_rows_tmp tt_cached_suites:= tt_cached_suites();
l_rows tt_cached_suites := tt_cached_suites();
l_limit number := 5000;
begin
for i in ( select /*+ no_parallel */ sp.schema_name,sp.object_name,sp.procedure_name,
sp.suite_path,sc.path
Expand All @@ -556,16 +398,23 @@ create or replace package body ut_suite_manager is
a_schema_paths ut_path_items,
a_random_seed positive,
a_tags ut_varchar2_rows := null
) return ut_suite_cache_rows is
) return t_cached_suites_cursor is
l_unfiltered_rows ut_suite_cache_rows;
l_filtered_rows ut_suite_cache_rows;
l_result t_cached_suites_cursor;
begin
l_unfiltered_rows := ut_suite_cache_manager.get_cached_suite_rows(
a_schema_paths,
a_random_seed,
a_tags
);
reconcile_paths_and_suites(a_schema_paths,get_filtered_cursor(l_unfiltered_rows));
return get_filtered_cursor(l_unfiltered_rows);

l_filtered_rows := get_filtered_cursor(l_unfiltered_rows);
reconcile_paths_and_suites(a_schema_paths,l_filtered_rows);

open l_result for
select * from table(l_filtered_rows);
return l_result;
end;

function can_skip_all_objects_scan(
Expand Down