← 输入框|github.com|刷新
Skip to content

Tags for tests and suites #66

Closed

Description

@Pazus

Introduce annotations to tag tests and suites.
Implement filters on execution procedures to include/exclude suites/tests by tags.

We should discuss if "tag" should be assigned to a suite or "suite_type" with predetermined values fits bettet.

Activity

  1. added this to the milestone on Oct 2, 2016
  2. modified the milestones: , on Dec 7, 2016
  3. removed this from the v3.1.0 milestone on Feb 8, 2018
  4. self-assigned this
    on Mar 21, 2019
  5. pesse commented on Mar 22, 2019

    @pesse
    Member

    If we introduce tags we should probably also give a way to say "run all tests except tag 'x'".
    Use-case: "run all tests except tag 'very long-running integration test'"

    What do you think?

  6. jgebal commented on Mar 22, 2019

    @jgebal
    Member

    Absolutely.
    With current implementation we can do negative for all:
    Run scema except path
    Run path except subpath
    That should be a seperate feature request probably

  7. lwasylow commented on Apr 4, 2019

    @lwasylow
    Member

    How we would like to invoke it? New parameter? That's simplest option probably. As a path? But then we would need to include a keyword to differeniate between real database object etc.
    Maybe something like tag:batch

  8. jgebal commented on Apr 4, 2019

    @jgebal
    Member

    We currently use:
    :path or name how about *tag or some other start character.
    I wouldn't want to have separate parameter for it.

  9. jgebal commented on Apr 4, 2019

    @jgebal
    Member

    Tags would be just amotjlher way of expressing suitepaths to include.
    We should have a separate issue for exclusions like:
    -name,-:path,-*tag

  10. Pazus commented on Apr 5, 2019

    @Pazus
    MemberAuthor

    I vote for providing tags as a separate parameter. I think it’s ortogonal to the scope of tests to search and execute. With path we set a scope of tests, with tags we filter it further. So I vote for another overload with tags parameter accepting a single/list of values that are applied on provided path.

  11. lwasylow commented on Apr 5, 2019

    @lwasylow
    Member

    It's a valid point that address a name uniqueness domain as well.

  12. jgebal commented on Apr 5, 2019

    @jgebal
    Member

    I was thonking a bit differently.
    Tags and suites are both used for inclusion of tests just lile we use paths and package/procedure names interchangeably today.

    Exclusion would come as a separate feature and would be applicable to all three patterns for specifying elements to run.

    Exclusuin could be applied by adding - to element that needs to be excluded.

    Tags could be identified in input list by special leading character % just like suitepaths are today :
    That way I can specify:

    • ut.run('%payment , -%slow');
    • ut.run(':org.utplsql.stuff, -org.utplsql.stuff.not_this, %utils, %clob');

    Maybe we should start by writing potential input param combinations and describe how it should behave before we make final decission on combining it into path parameter or making it separate parameter.

  13. lwasylow commented on Apr 5, 2019

    @lwasylow
    Member

    It's a great idea but I'm worried about complexity of syntax. New parameter is it extra option indeed but is easier to remember than a special keyword.

  14. lwasylow commented on Apr 13, 2019

    @lwasylow
    Member

    Happy with a special character I think the common one is hash so I'm thinking

    ut.run('#nightlybatch,#customer_services') run all tests with tag nighltybatch and customer_services

    ut.run(':core.batch,#nightlybatch') run all tests on suitepath core.batch with tag nightlybatch

    This however can lead to ambiguity when package start with hash.

  15. lwasylow commented on Apr 16, 2019

    @lwasylow
    Member

    Possible options to callout the tags are below.

    1.

    • ut.run('ut3$user#.test_expectations_cursor ,#contain')
    • ut.run('ut3$user#,#cursor')
    • ut.run('ut3$user#:utplsql.test_user.expectations,#cursor')

    2.

    • ut.run(a_path => 'ut3$user#.test_expectations_cursor',a_tags => 'contain')
    • ut.run(a_path =>'ut3$user#',a_tags =>'cursor')
    • ut.run(a_path =>'ut3$user#:utplsql.test_user.expectations',a_tags =>'cursor')

    Option 1

    Pros

    • No new parameter, easier call

    Cons

    • Complicated syntax, user require more education
    • Possible false positive when we using a schema or package that starts with # and interpretation as tag

    Option 2

    Pros

    • Simpler syntax and clear identification of option which means user with minimum knowledge can run it
    • Clear differentiate between tag and other objects

    Cons

    • Extra parameter , makes a call a bit more complex and require call by name

    Given that tags are treated as a way to filter down a execution path to certain area I'm leaning towards the option 2 as better one.

  16. Pazus commented on Apr 16, 2019

    @Pazus
    MemberAuthor

    I also prefer the second one. It’s simpler and clearer for reading and we read code much more then we write it.
    Are there any issues with backwards compatibility for existing scripts?

    Just an idea: we have an increasing number of parameter combinations for ut.run procedure. Maybe we can creation ut.run_builder function which returns Object Type implementing a builder pattern with all the defaults set? I wonder how modern IDEs provide code completion for nested object type calls.

  17. jgebal commented on Apr 16, 2019

    @jgebal
    Member

    After some thinking...
    Option 2 is best from my perspective too.

    Builder could be an option to go with but I would separate it from this issue.
    Change of invocation pattern will require change in every possible consumer. That is a major breaking change.

    We could embed the builder in ut_run type directly.
    Builder pattern will be however very unnatural to use for most db engineers.

  18. added this to the v3.1.7 milestone on Apr 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions