Reputation: 63201
Given a class following the ScalaTest
signature:
class GEMTests extends FunSuite with Matchers with BeforeAndAfterAll {
And inside of it we have some enabled tests like this:
test("GEMFullPostal") {
// logic, logic, ..
}
Why would a certain Test Suite not be executed? Other test suites are being run correctly.
When I run the test suite through Intellij it does run that given test - which promptly fails due to an incorrect sql statement. But both
mvn test
and the Jenkins CI/CD build allows the entire application to pass scalatest . I can see in the output no mention of that particular class.
So .. intellij recognizes the class as a ScalaTest but it is being skipped by maven
command line (including jenkins). What might be "special" about this test suite? Note it is in the same directory as other Test Suites that are being run automatically.
Upvotes: 0
Views: 133
Reputation: 63201
Found the issue: inside the pom.xml
there is a filtering mechanism happening for the scalatest
plugin
<plugin>
<groupId>org.scalatest</groupId>
<executions>
<execution>
<id>test</id>
<goals>
<goal>test</goal>
</goals>
<configuration>
<suffixes>(?<!Integration)(Test|Spec)</suffixes>
</configuration>
</execution>
So the fix is to add the Tests
extensions to that filter:
<suffixes>(?<!Integration)(Test|Tests|Spec)</suffixes>
Upvotes: 0