Dmi*_*ich 5 spring integration-testing spock maven-failsafe-plugin e2e-testing
我的E2E测试运行得非常缓慢(25分钟),因为他们调用了大量服务并等待在数据库中填充一些数据.我想同时运行它.我正在使用以下maven-failsafe-plugin设置:
<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>
Run Code Online (Sandbox Code Playgroud)
我的测试看起来像这样(如果需要可以提供更多信息):
@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
}
Run Code Online (Sandbox Code Playgroud)
我试图使用threadCount属性parallel或者forkCount但对我来说没有任何作用.我还尝试在依赖项中强制执行以下maven-failsafe-plugin依赖项:
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-junit47</artifactId>
<version>2.16</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)
提前致谢!
我最终在GitHub上遇到了以下问题:
https://github.com/spockframework/spock/issues/691
如果您对Spock中的并行测试执行感兴趣,请发表评论或其他任何内容.
简而言之,我发现了一个启用并行执行的pull请求,它甚至被合并到一个分支中.但是它尚未合并为主人.因此,我现在唯一的出路就是编写自己的自定义BaseSpecRunner
| 归档时间: |
|
| 查看次数: |
3289 次 |
| 最近记录: |