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

Support when clauses for test configurations. #1627

Closed
ReubenFrankel opened this issue Oct 26, 2023 · 1 comment · Fixed by #1638
Closed

Support when clauses for test configurations. #1627

ReubenFrankel opened this issue Oct 26, 2023 · 1 comment · Fixed by #1638
Milestone

Comments

@ReubenFrankel
Copy link
Contributor

Is there a way to control what configurations are available to select when running tests in a specific package, class or method? I am aware there is a filters property, but as far as I can see this only supports JUnit tags (filters.tags) at the moment. I want to be able to filter by patterns (inspired by the Maven Surefire Plugin) - something like this:

settings.json

{
    "java.test.config": [
        {
            "name": "tests in specific package"
            "filters": {
                "pattern": "com.example.test"
            }
        },
        {
            "name": "tests not in specific package"
            "filters": {
                "pattern": "!com.example.test"
            }
        },
        {
            "name": "tests in specific class"
            "filters": {
                "pattern": "com.example.test.ExampleTests"
            }
        },
        {
            "name": "tests not in specific class"
            "filters": {
                "pattern": "!com.example.test.ExampleTests"
            }
        },
        {
            "name": "tests in a class of this name"
            "filters": {
                "pattern": "testExample"
            }
        },
        {
            "name": "not tests in a class of this name"
            "filters": {
                "pattern": "!ExampleTests"
            }
        },
        {
            "name": "this specific test"
            "filters": {
                "pattern": "com.example.test.ExampleTests#testExample"
            }
        },
        {
            "name": "not this specific test"
            "filters": {
                "pattern": "!com.example.test.ExampleTests#testExample"
            }
        }
    ]
}
@jdneo
Copy link
Member

jdneo commented Oct 27, 2023

Sorry, it's not supported so far. I marked this issue as a feature request.

@jdneo jdneo added this to the 0.40.2 milestone Dec 21, 2023
@jdneo jdneo changed the title Filter by test pattern in config? Support when clauses for test configurations. Jan 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants