简体   繁体   English

surefire-plugin执行测试用例的顺序是什么?

[英]what's the order surefire-plugin execute test case?

based on Does Maven Surefire execute test cases sequentially by default? 根据默认情况下,Maven Surefire是否按顺序执行测试用例? , I know that the surefire execute test cases sequentially, in other words, One by One. ,我知道surefire会按顺序执行测试用例,换句话说就是一对一地执行。


I want to know which test cases executed first and which next, Through output information of surefire, I find that the order maybe random, for example: 我想知道哪个测试用例首先执行,然后哪个执行,通过surefire的输出信息,我发现顺序可能是随机的,例如:

  • test 测试
  • boyTest.java boyTest.java

  • subdir 子目录

    • girlTest.java girlTest.java
  • parentTest.java the test directory has three test case: and the testcase execute order is girlTest.java, parentTest.java,boyTest.java parentTest.java测试目录具有三个测试用例:测试用例的执行顺序是girlTest.java,parentTest.java,boyTest.java

and So I want to make sure that whether the order that testCase executed is random 因此,我想确保testCase执行的顺序是否是random

To verify that the ordering surefire used is the one you expect, run your build with debug enabled ( -x flag). 要验证所使用的命令surefire是否符合您的期望,请在启用调试的情况下运行构建( -x标志)。 Eg in my case I see the following: 例如,对于我来说,我看到以下内容:

mvn clean install -X | grep runOrder
   ...
<runOrder default-value="filesystem">hourly</runOrder>
[DEBUG]   (s) runOrder = hourly

By default order is not random but defined through how the file system returns the list of the tests ( filesystem in surefire terms). 默认情况下,为了不是随机的,而是通过文件系统如何返回测试的列表(定义filesystem中万无一失的条件)。

There are other available orderings which you can choose through surefire.runOrder property (one of which is random ). 您还可以通过surefire.runOrder属性选择其他可用的顺序(其中之一是random )。

For more information see Surefire plugin runOrder 有关更多信息,请参见Surefire插件runOrder。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 通过surefire-plugin更改要加载的类路径上的位置顺序 - Changing order of locations on classpath to be loaded up by surefire-plugin 有没有一种简单的方法可以在surefire-plugin测试类路径上添加jar - Is there an easy way to add jars on surefire-plugin test classpath Maven 为surefire-plugin 2.22.2构建 - Maven build for surefire-plugin 2.22.2 JACoCo/surefire-plugin 找不到要运行的测试 - JACoCo/surefire-plugin does not find tests to run Maven 使用 surefire-plugin 编译并提供 JPMS 模块的单元测试范围 - Maven compile and provided scopes for unit testing of JPMS module with surefire-plugin “Maven Surefire 插件”在测试您的构建时意味着什么? - What does the "Maven Surefire plugin" means when it test your build? 由于surefire插件的forkmode,单元测试失败 - Unit test failing due to surefire plugin's forkmode 升级后,得到“无法执行目标org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test”和“找不到测试&lt;[]&gt;” - After upgrading, getting “Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test” and “test(s) <[]> cannot be found” 无法执行目标org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test - Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test 无法执行目标org.apache.maven.plugins:maven-surefire-plugin:2.16:SAKAI中的测试错误 - Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.16:test error in SAKAI
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM