nail fei
nail fei

Reputation: 2329

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

based on Does Maven Surefire execute test cases sequentially by default?, I know that the surefire execute test cases sequentially, in other words, One by One.


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:

and So I want to make sure that whether the order that testCase executed is random

Upvotes: 1

Views: 1351

Answers (1)

Ivan
Ivan

Reputation: 3836

To verify that the ordering surefire used is the one you expect, run your build with debug enabled (-x flag). E.g. 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).

There are other available orderings which you can choose through surefire.runOrder property (one of which is random).

For more information see Surefire plugin runOrder

Upvotes: 2

Related Questions