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

Skip to content

Commit 273962b

Browse files
committed
Fixing issue with a non visible tests.
1 parent ce4df28 commit 273962b

1 file changed

Lines changed: 11 additions & 162 deletions

File tree

source/core/ut_suite_manager.pkb

Lines changed: 11 additions & 162 deletions
Original file line numberDiff line numberDiff line change
@@ -253,121 +253,6 @@ create or replace package body ut_suite_manager is
253253
return l_result;
254254
end;
255255

256-
function get_logical_suite(
257-
a_rows ut_suite_cache_rows,
258-
a_idx pls_integer,
259-
a_level pls_integer,
260-
a_prev_level pls_integer,
261-
a_items_at_level t_item_levels
262-
) return ut_suite_item is
263-
l_result ut_suite_item;
264-
begin
265-
case a_rows( a_idx ).self_type
266-
when 'UT_SUITE' then
267-
l_result :=
268-
case when a_prev_level > a_level then
269-
ut_suite(
270-
self_type => a_rows( a_idx ).self_type,
271-
object_owner => a_rows( a_idx ).object_owner, object_name => lower( a_rows( a_idx ).object_name),
272-
name => lower( a_rows( a_idx ).name), description => a_rows( a_idx ).description, path => a_rows( a_idx ).path,
273-
rollback_type => a_rows( a_idx ).rollback_type, disabled_flag => a_rows( a_idx ).disabled_flag, disabled_reason => a_rows(a_idx).disabled_reason,
274-
line_no => a_rows( a_idx ).line_no, parse_time => a_rows( a_idx ).parse_time,
275-
start_time => null, end_time => null, result => null, warnings => a_rows( a_idx ).warnings,
276-
results_count => ut_results_counter(), transaction_invalidators => ut_varchar2_list(),
277-
items => a_items_at_level(a_prev_level),
278-
before_all_list => sort_by_seq_no( a_rows( a_idx ).before_all_list), after_all_list => sort_by_seq_no(
279-
a_rows( a_idx ).after_all_list), tags => a_rows(a_idx).tags
280-
)
281-
else
282-
ut_suite(
283-
self_type => a_rows( a_idx ).self_type,
284-
object_owner => a_rows( a_idx ).object_owner, object_name => lower( a_rows( a_idx ).object_name),
285-
name => lower( a_rows( a_idx ).name), description => a_rows( a_idx ).description, path => a_rows( a_idx ).path,
286-
rollback_type => a_rows( a_idx ).rollback_type, disabled_flag => a_rows( a_idx ).disabled_flag, disabled_reason => a_rows(a_idx).disabled_reason,
287-
line_no => a_rows( a_idx ).line_no, parse_time => a_rows( a_idx ).parse_time,
288-
start_time => null, end_time => null, result => null, warnings => a_rows( a_idx ).warnings,
289-
results_count => ut_results_counter(), transaction_invalidators => ut_varchar2_list(),
290-
items => ut_suite_items(),
291-
before_all_list => sort_by_seq_no( a_rows( a_idx ).before_all_list), after_all_list => sort_by_seq_no(
292-
a_rows( a_idx ).after_all_list), tags => a_rows(a_idx).tags
293-
)
294-
end;
295-
when 'UT_SUITE_CONTEXT' then
296-
l_result :=
297-
case when a_prev_level > a_level then
298-
ut_suite_context(
299-
self_type => a_rows( a_idx ).self_type,
300-
object_owner => a_rows( a_idx ).object_owner, object_name => lower( a_rows( a_idx ).object_name),
301-
name => lower( a_rows( a_idx ).name), description => a_rows( a_idx ).description, path => a_rows( a_idx ).path,
302-
rollback_type => a_rows( a_idx ).rollback_type, disabled_flag => a_rows( a_idx ).disabled_flag, disabled_reason => a_rows(a_idx).disabled_reason,
303-
line_no => a_rows( a_idx ).line_no, parse_time => a_rows( a_idx ).parse_time,
304-
start_time => null, end_time => null, result => null, warnings => a_rows( a_idx ).warnings,
305-
results_count => ut_results_counter(), transaction_invalidators => ut_varchar2_list(),
306-
items => a_items_at_level(a_prev_level),
307-
before_all_list => sort_by_seq_no( a_rows( a_idx ).before_all_list), after_all_list => sort_by_seq_no(
308-
a_rows( a_idx ).after_all_list), tags => a_rows(a_idx).tags
309-
)
310-
else
311-
ut_suite_context(
312-
self_type => a_rows( a_idx ).self_type,
313-
object_owner => a_rows( a_idx ).object_owner, object_name => lower( a_rows( a_idx ).object_name),
314-
name => lower( a_rows( a_idx ).name), description => a_rows( a_idx ).description, path => a_rows( a_idx ).path,
315-
rollback_type => a_rows( a_idx ).rollback_type, disabled_flag => a_rows( a_idx ).disabled_flag, disabled_reason => a_rows(a_idx).disabled_reason,
316-
line_no => a_rows( a_idx ).line_no, parse_time => a_rows( a_idx ).parse_time,
317-
start_time => null, end_time => null, result => null, warnings => a_rows( a_idx ).warnings,
318-
results_count => ut_results_counter(), transaction_invalidators => ut_varchar2_list(),
319-
items => ut_suite_items(),
320-
before_all_list => sort_by_seq_no( a_rows( a_idx ).before_all_list), after_all_list => sort_by_seq_no(
321-
a_rows( a_idx ).after_all_list), tags => a_rows(a_idx).tags
322-
)
323-
end;
324-
when 'UT_LOGICAL_SUITE' then
325-
l_result :=
326-
case when a_prev_level > a_level then
327-
ut_logical_suite(
328-
self_type => a_rows( a_idx ).self_type,
329-
object_owner => a_rows( a_idx ).object_owner, object_name => lower( a_rows( a_idx ).object_name),
330-
name => lower( a_rows( a_idx ).name), description => a_rows( a_idx ).description, path => a_rows( a_idx ).path,
331-
rollback_type => a_rows( a_idx ).rollback_type, disabled_flag => a_rows( a_idx ).disabled_flag, disabled_reason => a_rows(a_idx).disabled_reason,
332-
line_no => a_rows( a_idx ).line_no, parse_time => a_rows( a_idx ).parse_time,
333-
start_time => null, end_time => null, result => null, warnings => a_rows( a_idx ).warnings,
334-
results_count => ut_results_counter(), transaction_invalidators => ut_varchar2_list(),
335-
items => a_items_at_level(a_prev_level), tags => null
336-
)
337-
else
338-
ut_logical_suite(
339-
self_type => a_rows( a_idx ).self_type,
340-
object_owner => a_rows( a_idx ).object_owner, object_name => lower( a_rows( a_idx ).object_name),
341-
name => lower( a_rows( a_idx ).name), description => a_rows( a_idx ).description, path => a_rows( a_idx ).path,
342-
rollback_type => a_rows( a_idx ).rollback_type, disabled_flag => a_rows( a_idx ).disabled_flag, disabled_reason => a_rows(a_idx).disabled_reason,
343-
line_no => a_rows( a_idx ).line_no, parse_time => a_rows( a_idx ).parse_time,
344-
start_time => null, end_time => null, result => null, warnings => a_rows( a_idx ).warnings,
345-
results_count => ut_results_counter(), transaction_invalidators => ut_varchar2_list(),
346-
items => ut_suite_items(), tags => null
347-
)
348-
end;
349-
when 'UT_TEST' then
350-
l_result :=
351-
ut_test(
352-
self_type => a_rows(a_idx).self_type,
353-
object_owner => a_rows(a_idx).object_owner, object_name => lower(a_rows(a_idx).object_name),
354-
name => lower(a_rows(a_idx).name), description => a_rows(a_idx).description, path => a_rows(a_idx).path,
355-
rollback_type => a_rows(a_idx).rollback_type, disabled_flag => a_rows(a_idx).disabled_flag, disabled_reason => a_rows(a_idx).disabled_reason,
356-
line_no => a_rows(a_idx).line_no, parse_time => a_rows(a_idx).parse_time,
357-
start_time => null, end_time => null, result => null, warnings => a_rows(a_idx).warnings,
358-
results_count => ut_results_counter(), transaction_invalidators => ut_varchar2_list(),
359-
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),
360-
item => a_rows(a_idx).item,
361-
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),
362-
all_expectations => ut_expectation_results(), failed_expectations => ut_expectation_results(),
363-
parent_error_stack_trace => null, expected_error_codes => a_rows(a_idx).expected_error_codes,
364-
tags => a_rows(a_idx).tags
365-
);
366-
end case;
367-
l_result.results_count.warnings_count := l_result.warnings.count;
368-
return l_result;
369-
end;
370-
371256
procedure reconstruct_from_cache(
372257
a_suites in out nocopy ut_suite_items,
373258
a_suite_data_cursor sys_refcursor
@@ -414,47 +299,7 @@ create or replace package body ut_suite_manager is
414299
close a_suite_data_cursor;
415300
end reconstruct_from_cache;
416301

417-
procedure reconstruct_from_cache(
418-
a_suites in out nocopy ut_suite_items,
419-
a_suite_data_cursor ut_suite_cache_rows
420-
) is
421-
c_bulk_limit constant pls_integer := 1000;
422-
l_items_at_level t_item_levels;
423-
l_rows ut_suite_cache_rows := a_suite_data_cursor;
424-
l_level pls_integer;
425-
l_prev_level pls_integer;
426-
l_idx integer;
427-
begin
428-
l_idx := l_rows.first;
429-
while l_idx is not null loop
430-
l_level := length(l_rows(l_idx).path) - length( replace(l_rows(l_idx).path, '.') ) + 1;
431-
if l_level > 1 then
432-
if not l_items_at_level.exists(l_level) then
433-
l_items_at_level(l_level) := ut_suite_items();
434-
end if;
435-
l_items_at_level(l_level).extend;
436-
pragma inline(get_logical_suite, 'YES');
437-
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 );
438-
else
439-
a_suites.extend;
440-
pragma inline(get_logical_suite, 'YES');
441-
a_suites(a_suites.last) := get_logical_suite(l_rows, l_idx, l_level,l_prev_level, l_items_at_level );
442-
end if;
443-
if l_prev_level > l_level then
444-
l_items_at_level(l_prev_level).delete;
445-
end if;
446-
l_prev_level := l_level;
447-
l_idx := l_rows.next(l_idx);
448-
end loop;
449-
450-
reverse_list_order( a_suites );
451-
452-
for i in 1 .. a_suites.count loop
453-
a_suites( i ).set_rollback_type( a_suites( i ).get_rollback_type );
454-
end loop;
455-
end reconstruct_from_cache;
456-
457-
302+
458303
function get_cached_suite_data(
459304
a_object_owner varchar2,
460305
a_path varchar2 := null,
@@ -529,9 +374,6 @@ create or replace package body ut_suite_manager is
529374
a_schema_paths ut_path_items,
530375
a_filtered_rows ut_suite_cache_rows
531376
) is
532-
l_rows_tmp tt_cached_suites:= tt_cached_suites();
533-
l_rows tt_cached_suites := tt_cached_suites();
534-
l_limit number := 5000;
535377
begin
536378
for i in ( select /*+ no_parallel */ sp.schema_name,sp.object_name,sp.procedure_name,
537379
sp.suite_path,sc.path
@@ -556,16 +398,23 @@ create or replace package body ut_suite_manager is
556398
a_schema_paths ut_path_items,
557399
a_random_seed positive,
558400
a_tags ut_varchar2_rows := null
559-
) return ut_suite_cache_rows is
401+
) return t_cached_suites_cursor is
560402
l_unfiltered_rows ut_suite_cache_rows;
403+
l_filtered_rows ut_suite_cache_rows;
404+
l_result t_cached_suites_cursor;
561405
begin
562406
l_unfiltered_rows := ut_suite_cache_manager.get_cached_suite_rows(
563407
a_schema_paths,
564408
a_random_seed,
565409
a_tags
566410
);
567-
reconcile_paths_and_suites(a_schema_paths,get_filtered_cursor(l_unfiltered_rows));
568-
return get_filtered_cursor(l_unfiltered_rows);
411+
412+
l_filtered_rows := get_filtered_cursor(l_unfiltered_rows);
413+
reconcile_paths_and_suites(a_schema_paths,l_filtered_rows);
414+
415+
open l_result for
416+
select * from table(l_filtered_rows);
417+
return l_result;
569418
end;
570419

571420
function can_skip_all_objects_scan(

0 commit comments

Comments
 (0)