vscode-java-test
vscode-java-test copied to clipboard
Feature Req: Support filtering tests by JUnit 5 tags
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.
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.