Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a possibility to group Google Test using regexes on the test suite name #231

Closed
crotaphytus opened this issue Oct 29, 2020 · 6 comments

Comments

@crotaphytus
Copy link

crotaphytus commented Oct 29, 2020

Is your feature request related to a problem? Please describe.
I'd like to group multiple test suites together when working with Google Test. For Google Test, the test suite name ends up as a tag. So, I can either group by tags (where I need to specify the full tag name), or by regex (which is only checked for the test name, without the test suite information.

Describe the solution you'd like
Add the possibility to use regexes when grouping by tags. Every test where the regex matches any of the tags should be grouped together.

Describe alternatives you've considered
Within groupByRegex, one could match the regex on testNameAsId instead of testName. This works well for Google Test, but not sure whether it will be bad for the other frameworks.

Additional context
None

@matepek
Copy link
Owner

matepek commented Oct 29, 2020

Example please ^^

@crotaphytus
Copy link
Author

Sure. :-)

I tried to think of a nice real-world example, but I will just do it with placeholders, as I think it gets clearer that way...

What I have is the following:

  • SomeTestSuite
    • OneTest
    • AnotherTest
  • SomeOtherTestSuite
    • WithOneTest
    • AndMoreTests
  • CompletelyOtherTestSuite
    • TotallyUnrelatedTest

It is no problem to grop them via Regex based on the test name, e.g., everything with "One":

  • One
    • OneTest
    • WithOneTest
  • Ungrouped
    • ...

But I'd like to do the same based on the test suite name, e.g., "Some":

  • Some
    • OneTest
    • AnotherTest
    • WithOneTest
    • AndMoreTests
  • Ungrouped
    • TotallyUnrelatedTest

So, basically, I want to filter on recurring patterns that are only in the test suite name, not in the test name. If it is taking both into consideration I personally would not care, but I am not sure what would be more useful for other users.

Thanks for considering this! :-)

@matepek
Copy link
Owner

matepek commented Oct 29, 2020

You want something like this then.

"gtest": {
        "testGrouping": {
          "groupByTagRegex": {
            "regexes": ["Param", "Cas[0-9]"],
            "label": "x",
            "groupByTags": {
              "label": "${tags}",
              "tagFormat": "${tag}"
            },
          }
        }
      }

@crotaphytus
Copy link
Author

Exactly.

@matepek
Copy link
Owner

matepek commented Oct 30, 2020

v3.5.1

@matepek matepek closed this as completed Oct 30, 2020
@crotaphytus
Copy link
Author

Thanks for the super fast implementation, really helpful!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants