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

Group by regex example - dot separated names #396

Open
csorvagep opened this issue Sep 16, 2023 · 0 comments
Open

Group by regex example - dot separated names #396

csorvagep opened this issue Sep 16, 2023 · 0 comments
Labels
enhancement New feature or request test-grouping

Comments

@csorvagep
Copy link

Our tests names contains some kind of grouping, the group names are separated by dots. For example the following tests are reported by catch2:

group1.subgroup1.testname1
group1.subgroup1.testname2
group1.subgroup2.testname3
group2.testname4
group2.testname5

And we would like to see something similar:

  • group1
    • subgroup1
      • testname1
      • testname2
    • subgroup2
      • testname3
  • group2
    • testname4
    • testname5

Is there a way to reach this or similar?
The best I got is this:

"groupByRegex": {
    "regexes": [
        "(\\w+)"
    ],
    "groupByRegex": {
        "regexes": [
            "\\w+\\.(\\w+)\\..*"
        ]
    },
    "groupUngroupedTo": "<Empty Namespace>"
}

The problem is, the final element in the tree will always contain the full name of the test.
If there would be a way to pass down only the rest of the name to the internal groupByRegex that would solve the issue and also clean up the regex pattern.

Note: Although it's catch2, I don't think that's framework dependent.

Thanks!

@matepek matepek added the enhancement New feature or request label Sep 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request test-grouping
Projects
None yet
Development

No branches or pull requests

2 participants