My E2E tests are running pretty slowly (25 minutes) as they call a bunch of services and wait for some data to be populated in the database. I want to run it concurrently. I'm using the following maven-failsafe-plugin
setup:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${plugin.failsave.version}</version>
<executions>
<execution>
<id>run-integration-tests</id>
<phase>integration-test</phase>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
And my test looks something like this (more information can be provided if it is needed):
@Stepwise
@DataJpaTest
@ContextConfiguration(classes = SomeControllerITConfig)
@AutoConfigureTestDatabase(replace = AutoConfigureTestDatabase.Replace.NONE)
class SomeControllerIT extends Specification {
// some variables definition
def "test1":
// some test
def "test2":
// some test
// some more tests
}
I tried to use threadCount
property along with parallel
or forkCount
but nothing works for me. Also I tried to force the following dependency in the maven-failsafe-plugin
dependencies:
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-junit47</artifactId>
<version>2.16</version>
</dependency>
Thanks in advance!
I ended up with the following issue on GitHub:
https://github.com/spockframework/spock/issues/691
Comment or whatever if you're also interested in parallel test execution in Spock.
In short, I've found a pull request with enabling parallel execution and it is even merged into one of the branches. However it is not merged into master yet. So the only way out I see for now is to write my own custom BaseSpecRunner
Looks like Spock team added support for parallel execution:
http://spockframework.org/spock/docs/2.0-M4/parallel_execution.html#parallel-execution
requires groovy: >3.0.6
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With