[英]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的输出信息,我发现顺序可能是随机的,例如:
boyTest.java boyTest.java
subdir 子目录
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.