微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Maven 不会并行运行 Cucumber 测试

如何解决Maven 不会并行运行 Cucumber 测试

我在完成教程后尝试并行运行我的 Cucumber 测试,但在我的调试中它不断返回 MavenParallelExecution = false

我的插件pom.xml文件如下

<plugin> 
            <groupId>org.apache.maven.plugins</groupId> 
            <artifactId>maven-failsafe-plugin</artifactId> 
            <version>3.0.0-M5</version>
            <executions> 
                <execution> 
                    <goals> 
                        <goal>integration-test</goal> 
                    </goals> 
                    
                    <configuration> 
                        <!--UNCOMMENT - To add any exclusions if required--> 
                        <!--<excludes> <exclude>**/*IT*.java</exclude> </excludes>--> 
                    
                        <includes>
                     
                            <!-- UNCOMMENT BELOW LINE - To execute feature files with a single runner -->
                            <include>**/MyTestRunner.java</include> 
                            <!-- UNCOMMENT BELOW LINE - To execute feature files with multiple runners-->
                            <!--<include>**/*MyTestRunner.java</include> -->
                        </includes> 
                        <!-- UNCOMMENT BELOW 3 LInes - To execute using parallel or combination option -->
                        <parallel>both</parallel> 
                        <threadCount>4</threadCount> 
                        <!--  <perCoreThreadCount>true</perCoreThreadCount> -->
                        <!-- UNCOMMENT BELOW 3 LInes - To execute using forking or combination option-->
                        <!-- <forkCount>2</forkCount><reuseForks>true</reuseForks><reportsDirectory>${project.build.directory}/failsafe-reports_${surefire.forkNumber}</reportsDirectory>--> 
                    </configuration>
                </execution> 
            </executions>

我的调试日志返回:

[DEBUG]   (f) excludedEnvironmentvariables = []
[DEBUG]   (f) forkCount = 1
[DEBUG]   (s) forkMode = once
[DEBUG]   (s) forkedProcessExitTimeoutInSeconds = 30
[DEBUG]   (s) includes = [**/MyTestRunner.java]
[DEBUG]   (s) junitArtifactName = junit:junit
[DEBUG]   (s) parallel = both
[DEBUG]   (f) parallelMavenExecution = false
[DEBUG]   (s) parallelOptimized = true
[DEBUG]   (s) perCoreThreadCount = true 

我的Runner类如下:


import org.junit.runner.RunWith;

import io.cucumber.junit.Cucumber;
import io.cucumber.junit.CucumberOptions;

@RunWith(Cucumber.class)
@CucumberOptions(
        features = {"src/test/resources/AppFeatures"},glue = {"stepdeFinitions","AppHooks"},monochrome = true,plugin = {"pretty","com.aventstack.extentreports.cucumber.adapter.ExtentCucumberAdapter:"
        }
        
        )

public class MyTestRunner {

}

在这里做错了吗?我现在把它改成和教程一模一样,但还是坏了

感谢您的帮助

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。