与 Maven 故障安全插件并行运行测试

发布于 2025-01-13 11:48:05 字数 1377 浏览 1 评论 0原文

我正在尝试让我们的集成 api 测试与 Maven 故障安全插件并行运行。

但是当我运行测试时,在 POM 中添加了故障安全插件的参数后,我遇到了这样的步骤问题

 Run 1: Expected step: "A" got step: "B"
 Run 2: Expected step: "C" got step: "D"
 Run 3: Expected step: "E" got step: "F"

This is the POM.有人可以建议吗?谢谢。

            <plugin>
            <artifactId>maven-failsafe-plugin</artifactId>
            <version>${maven.failsafe.plugin.version}</version>
            <configuration>
                <parallel>classesAndMethods</parallel>
                <threadCount>4</threadCount>
                <perCoreThreadCount>false</perCoreThreadCount>
                <includes>
                    <include>runner/TestRunner.java</include>
                </includes>
                <encoding>${project.build.sourceEncoding}</encoding>
                <failIfNoTests>true</failIfNoTests>
            </configuration>
            <executions>
                <execution>
                    <goals>
                        <goal>integration-test</goal>
                        <goal>verify</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>

I'm trying to get our integration api tests to run in parallel with maven failsafe plugin.

But when I run the tests, with this added parameters for failsafe plugin in POM, I have a problem with steps like this

 Run 1: Expected step: "A" got step: "B"
 Run 2: Expected step: "C" got step: "D"
 Run 3: Expected step: "E" got step: "F"

This is the POM. Can anyone advise please? Thanks.

            <plugin>
            <artifactId>maven-failsafe-plugin</artifactId>
            <version>${maven.failsafe.plugin.version}</version>
            <configuration>
                <parallel>classesAndMethods</parallel>
                <threadCount>4</threadCount>
                <perCoreThreadCount>false</perCoreThreadCount>
                <includes>
                    <include>runner/TestRunner.java</include>
                </includes>
                <encoding>${project.build.sourceEncoding}</encoding>
                <failIfNoTests>true</failIfNoTests>
            </configuration>
            <executions>
                <execution>
                    <goals>
                        <goal>integration-test</goal>
                        <goal>verify</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文