[ https://jira.codehaus.org/browse/SUREFIRE-839?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=315266#comment-315266 ]
Andreas Gudian commented on SUREFIRE-839: ----------------------------------------- @Kristian, that is actually the part that you should have kept as it was. I now changed it, so that the canRunClass-check will be performed only during {{getSuites()}}. That way, the list of classes will not contain any no-ops. Passing the classes one-by-one or all at once as a list to JUnit would not solve the problem, I guess. It would only hide it better, as we would probaply get that exceptioin puked on us anyway, if all the classes in the list are filtered out. However, the onceperthread forkmode _requires_ the tests to be passed to JUnit once at a time, as the forked process needs to _ask_ for a new test class after it executed the last one (that's what the Iterator in {{LazyTestsToRun}} does on {{hasNext()}}). I've sent a pull request for my changes... :) > If no tests are found that would match a given JUnit category, mvn test > should not fail in multi-module project > --------------------------------------------------------------------------------------------------------------- > > Key: SUREFIRE-839 > URL: https://jira.codehaus.org/browse/SUREFIRE-839 > Project: Maven Surefire > Issue Type: Improvement > Components: Junit 4.7+ (parallel) support > Affects Versions: 2.12 > Reporter: Martin Burger > Assignee: Kristian Rosenvold > Fix For: 2.13 > > > In a multi-module project, I configured Surefire to execute tests of a > selected JUnit category only. Unfortunately, not all modules contain tests in > that category, which makes mvn test fail: > Tests in error: > initializationError(org.junit.runner.manipulation.Filter): No tests found > matching *foo.junit.categories.SlowTests from org.junit.runner.Request$1@15a > If a module does not contain any test that would match the given category, > Surefire should continue instead. Note that specifying -DfailIfNoTests=false > does not help in that case. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira