Skip to content

tags filtering incorrect on suites with context #1324

@jgebal

Description

@jgebal

Describe the bug
When a tag is at suite level and suite has context (contexts), the tag is not correctly propagated down to context items.

Provide version info
utPLSQL 3.2.01 Database 19c,

To reproduce:

create or replace package test_tags as

    -- %suite
    -- %tags(slow)
    
    -- %beforeall
    procedure slow_setup;

    -- %context(tags_are_applied_in_contexts)

        -- %test
        procedure create_new_mapping;

    -- %endcontext
end;
/

create or replace package body test_tags as

    procedure slow_setup is
    begin
        dbms_output.put_line('slow_setup executed');
    end;

    procedure create_new_mapping is
    begin
        dbms_output.put_line('create_new_mapping executed');
    end;

end;
/

When excluding the slow suite, everything is excluded - good.

begin
    ut.run('test_tags', a_tags=>'!slow');
end;
/

Output:

Finished in .000011 seconds
0 tests, 0 failed, 0 errored, 0 disabled, 0 warning(s)

When including the slow tag, contexts inside slow tag are not included - error.

begin
    ut.run('test_tags', a_tags=>'slow');
end;
/

Output:

test_tags
  slow_setup executed

Finished in .002728 seconds
0 tests, 0 failed, 0 errored, 0 disabled, 0 warning(s)

When running the suite without exclusion or inclusion - all is OK.

begin
    ut.run('test_tags');
end;
/

Output:

test_tags
  slow_setup executed
  tags_are_applied_in_contexts
    create_new_mapping [.002 sec]
    create_new_mapping executed

Finished in .005451 seconds
1 tests, 0 failed, 0 errored, 0 disabled, 0 warning(s)

Information about client software
Running from SQL client.

Expected behavior
When including a tag, all elements from a tagged suite should be included.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions