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

Comma separated excludedGroups in surefire plugin configuration #1238

Closed
johnathana opened this issue Jul 3, 2023 · 1 comment
Closed

Comma separated excludedGroups in surefire plugin configuration #1238

johnathana opened this issue Jul 3, 2023 · 1 comment

Comments

@johnathana
Copy link
Contributor

Comma separated excludedGroups in surefure plugin configuration is not parsed correctly. A sample configuration:
https://maven.apache.org/surefire/maven-surefire-plugin/examples/junit-platform.html#filtering-by-tags

<build>
    <plugins>
        ...
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>3.1.2</version>
            <configuration>
                <excludedGroups>integration, regression</excludedGroups>
            </configuration>
        </plugin>
    </plugins>
</build>

org.pitest.maven.SurefireConfigConverter#extractStrings will parse it as ["integration,", "regression"] (mind the comma as last character), causing the following exception:

2:47:29 PM PIT >> INFO : MINION : 2:47:29 PM PIT >> INFO : Checking environment
2:47:31 PM PIT >> FINE : MINION : java.lang.IllegalArgumentException: Error creating tag filter
2:47:31 PM PIT >> FINE : MINION :       at org.pitest.junit5.JUnit5TestUnitFinder.findTestUnits(JUnit5TestUnitFinder.java:78)
2:47:31 PM PIT >> FINE : MINION :       at org.pitest.mutationtest.config.PrioritisingTestUnitFinder.findTestUnits(PrioritisingTestUnitFinder.java:20)
2:47:31 PM PIT >> FINE : MINION :       at org.pitest.testapi.execute.FindTestUnits.findTestUnits(FindTestUnits.java:64)
2:47:31 PM PIT >> FINE : MINION :       at org.pitest.testapi.execute.FindTestUnits.getTestUnits(FindTestUnits.java:47)
2:47:31 PM PIT >> FINE : MINION :       at org.pitest.testapi.execute.FindTestUnits.findTestUnitsForAllSuppliedClasses(FindTestUnits.java:36)
2:47:31 PM PIT >> FINE : MINION :       at org.pitest.coverage.execute.CoverageMinion.discoverTests(CoverageMinion.java:165)
2:47:31 PM PIT >> FINE : MINION :       at org.pitest.coverage.execute.CoverageMinion.getTestsFromParent(CoverageMinion.java:151)
2:47:31 PM PIT >> FINE : MINION :       at org.pitest.coverage.execute.CoverageMinion.main(CoverageMinion.java:82)
2:47:31 PM PIT >> FINE : MINION : Caused by: org.junit.platform.commons.PreconditionViolationException: Tag name [integration,] must be syntactically valid
@hcoles
Copy link
Owner

hcoles commented Aug 16, 2023

Closing at #1239 was released in 1.14.3

@hcoles hcoles closed this as completed Aug 16, 2023
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