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

Skip to content

Commit e575404

Browse files
committed
Fixes to PR comments
1 parent 4544240 commit e575404

2 files changed

Lines changed: 12 additions & 19 deletions

File tree

source/core/ut_suite_builder.pkb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -320,14 +320,15 @@ create or replace package body ut_suite_builder is
320320
while l_annotation_pos is not null loop
321321
if a_tags_ann_text(l_annotation_pos) is null then
322322
a_suite.put_warning(
323-
'"--%tag" annotation requires a tag value populated. Annotation ignored.'
323+
'"--%tags" annotation requires a tag value populated. Annotation ignored.'
324324
|| chr( 10 ) || 'at "' || get_qualified_object_name(a_suite, a_procedure_name) || '", line ' || l_annotation_pos
325325
);
326326
else
327327
l_tag_list := l_tag_list multiset union distinct ut_utils.trim_list_elements(
328328
ut_utils.string_to_table(a_tags_ann_text(l_annotation_pos),',')
329329
);
330330
end if;
331+
--remove empty strings from table list e.g. tag1,,tag2
331332
a_list := ut_utils.table_to_clob(
332333
ut_utils.filter_list(l_tag_list,'^(\w|\S)+$'),
333334
',');
@@ -632,7 +633,7 @@ create or replace package body ut_suite_builder is
632633
while l_annotation_pos is not null loop
633634
if a_tags_ann_text(l_annotation_pos) is null then
634635
a_suite.put_warning(
635-
'"--%tag" annotation requires a tag value populated. Annotation ignored, line ' || l_annotation_pos
636+
'"--%tags" annotation requires a tag value populated. Annotation ignored, line ' || l_annotation_pos
636637
);
637638
else
638639
l_tag_list := l_tag_list multiset union distinct ut_utils.trim_list_elements(
@@ -641,6 +642,7 @@ create or replace package body ut_suite_builder is
641642
end if;
642643
l_annotation_pos := a_tags_ann_text.next(l_annotation_pos);
643644
end loop;
645+
--remove empty strings from table list e.g. tag1,,tag2
644646
a_suite.tags := ut_utils.table_to_clob(
645647
ut_utils.filter_list(l_tag_list,'^(\w|\S)+$'),
646648
',');
@@ -657,7 +659,6 @@ create or replace package body ut_suite_builder is
657659
l_after_all_list tt_executables;
658660
l_rollback_type ut_utils.t_rollback_type;
659661
l_annotation_text t_annotation_text;
660-
l_suite_tags ut_varchar2_rows;
661662
begin
662663
if a_annotations.by_name.exists(gc_displayname) then
663664
l_annotation_text := trim(a_annotations.by_name(gc_displayname)(a_annotations.by_name(gc_displayname).first));

source/core/ut_suite_manager.pkb

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ create or replace package body ut_suite_manager is
194194
results_count => ut_results_counter(), transaction_invalidators => ut_varchar2_list(),
195195
items => a_items_at_level(a_prev_level),
196196
before_all_list => sort_by_seq_no( a_rows( a_idx ).before_all_list), after_all_list => sort_by_seq_no(
197-
a_rows( a_idx ).after_all_list), tags => a_rows(a_idx).tags --TODO : Should be share or separate
197+
a_rows( a_idx ).after_all_list), tags => a_rows(a_idx).tags
198198
)
199199
else
200200
ut_suite(
@@ -207,7 +207,7 @@ create or replace package body ut_suite_manager is
207207
results_count => ut_results_counter(), transaction_invalidators => ut_varchar2_list(),
208208
items => ut_suite_items(),
209209
before_all_list => sort_by_seq_no( a_rows( a_idx ).before_all_list), after_all_list => sort_by_seq_no(
210-
a_rows( a_idx ).after_all_list), tags => a_rows(a_idx).tags --TODO : Should be share or separate
210+
a_rows( a_idx ).after_all_list), tags => a_rows(a_idx).tags
211211
)
212212
end;
213213
when 'UT_SUITE_CONTEXT' then
@@ -223,7 +223,7 @@ create or replace package body ut_suite_manager is
223223
results_count => ut_results_counter(), transaction_invalidators => ut_varchar2_list(),
224224
items => a_items_at_level(a_prev_level),
225225
before_all_list => sort_by_seq_no( a_rows( a_idx ).before_all_list), after_all_list => sort_by_seq_no(
226-
a_rows( a_idx ).after_all_list), tags => a_rows(a_idx).tags --TODO : Should be share or separate
226+
a_rows( a_idx ).after_all_list), tags => a_rows(a_idx).tags
227227
)
228228
else
229229
ut_suite_context(
@@ -236,7 +236,7 @@ create or replace package body ut_suite_manager is
236236
results_count => ut_results_counter(), transaction_invalidators => ut_varchar2_list(),
237237
items => ut_suite_items(),
238238
before_all_list => sort_by_seq_no( a_rows( a_idx ).before_all_list), after_all_list => sort_by_seq_no(
239-
a_rows( a_idx ).after_all_list), tags => a_rows(a_idx).tags --TODO : Should be share or separate
239+
a_rows( a_idx ).after_all_list), tags => a_rows(a_idx).tags
240240
)
241241
end;
242242
when 'UT_LOGICAL_SUITE' then
@@ -371,7 +371,6 @@ create or replace package body ut_suite_manager is
371371
l_ut_owner varchar2(250) := ut_utils.ut_owner;
372372
l_sql varchar2(32767);
373373
l_suite_item_name varchar2(20);
374-
l_tag_list varchar2(4000) := a_tags;
375374
begin
376375
if a_path is null and a_object_name is not null then
377376
execute immediate 'select min(path)
@@ -383,11 +382,8 @@ create or replace package body ut_suite_manager is
383382
else
384383
l_path := lower( a_path );
385384
end if;
386-
l_suite_item_name := case when l_tag_list is not null then 'suite_items_tags' else 'suite_items' end;
385+
l_suite_item_name := case when a_tags is not null then 'suite_items_tags' else 'suite_items' end;
387386

388-
389-
390-
/* Rewrite that as tags should be put on whats left not on full suite item cache */
391387
l_sql :=
392388
q'[with
393389
suite_items as (
@@ -417,7 +413,7 @@ create or replace package body ut_suite_manager is
417413
)
418414
)
419415
),]'
420-
||case when l_tag_list is not null then
416+
||case when a_tags is not null then
421417
q'[ filter_tags as (
422418
select s.* from suite_items s
423419
where exists
@@ -501,7 +497,7 @@ create or replace package body ut_suite_manager is
501497
c.path, :a_random_seed
502498
) desc nulls last'
503499
end;
504-
open l_result for l_sql using l_path, l_path, upper(a_object_name), upper(a_procedure_name), l_tag_list, a_random_seed;
500+
open l_result for l_sql using l_path, l_path, upper(a_object_name), upper(a_procedure_name), a_tags, a_random_seed;
505501
return l_result;
506502
end;
507503

@@ -739,11 +735,7 @@ create or replace package body ut_suite_manager is
739735
resolve_schema_names(l_paths);
740736

741737
l_schema_paths := group_paths_by_schema(l_paths);
742-
743-
-- TODO : use a_tags to filter out path. Should we do it before ? we dont know suites, if we do it after
744-
-- we running into danger of filtering out to null value and raising wrong message. I reckon we should resolve that
745-
-- before loop and l_th_items is set or after filter it out.
746-
738+
747739
l_schema := l_schema_paths.first;
748740
while l_schema is not null loop
749741
l_path_items := l_schema_paths(l_schema);

0 commit comments

Comments
 (0)