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

Feature Req: Support filtering tests by JUnit 5 tags #1092

Closed
Tracked by #1050
Skynet0 opened this issue Nov 5, 2020 · 1 comment
Closed
Tracked by #1050

Feature Req: Support filtering tests by JUnit 5 tags #1092

Skynet0 opened this issue Nov 5, 2020 · 1 comment
Milestone

Comments

@Skynet0
Copy link

Skynet0 commented Nov 5, 2020

https://junit.org/junit5/docs/current/user-guide/#running-tests-tag-expressions

A lot of our existing tests are identified by tags, in addition to being in different files. As far as I'm aware, there's no way to run all tests in a workspace that match a tag expression. I would like to be able to create and run test configurations that filter tests based on tags.

@Skynet0 Skynet0 changed the title Support filtering tests by JUnit 5 tags Feature Req: Support filtering tests by JUnit 5 tags Nov 5, 2020
@jdneo jdneo added this to the 0.37.0 milestone Aug 26, 2022
@jdneo
Copy link
Member

jdneo commented Aug 29, 2022

To enable the tags filter, you need to add following sections into your java.test.configuration:

"testKind": "junit",
"filters": {
    "tags": [
        "foo",    // ---> include tag 'foo'
        "!bar"    // ---> exclude tag 'bar'
    ]
}

Endgame note:

To verify the feature, https://github.com/microsoft/vscode-java-test/blob/main/test/test-projects/junit/src/test/java/junit5/tags/TagTest.java can be used.

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

No branches or pull requests

2 participants