[SUREFIRE-1405] Allows user to extend RunOrder & RunOrderCalculator#169
[SUREFIRE-1405] Allows user to extend RunOrder & RunOrderCalculator#169dipak-pawar wants to merge 1 commit intoapache:masterfrom
Conversation
|
Thx for your effort but we have to wait for this till the version 3.0. |
|
Sure, we will be happy to move it forward. Please keep this PR open and let us know by commenting here when it will make sense to resume the effort. I really hope we can make it upstream. |
|
@dipak-pawar Any chance to resurrect this? @Tibor17 Or is something different planned for the next milestone(s)? |
No, not at all, but we have to dig into this again and review this. That's the whole problem. |
|
@Tibor17 I noticed that JUnit 5 will have some kind test class ordering in 5.8.0: junit-team/junit-framework#2488 I'm wondering whether this is going to just work with surefire? |
@famod So this was wrong question. You must see the pipeline in order to understand what config parameter and how to use. |
Ok, thanks for confirming that this is still the case for JUnit5. I am well aware of this implication from previous projects using JUnit4 but I wasn't sure the same applies to the way surefire handles JUnit5. This also applies to single-fork mode (the default), right? |
@famod |
|
@dipak-pawar |
|
@Tibor17 I'm interested in helping out to move this forward. Given that the master branch has moved on significantly since this @dipak-pawar submitted this PR, I think it would be easier to create a new pull request from the master branch, and manually bring in the changes. Please let me know what you think. |
|
@aslakhellesoy |
|
Additionally, we should not use |
|
Resolve #2283 |
Fixes: https://issues.apache.org/jira/browse/SUREFIRE-1405
Implementation Details
How to create new RunOrder?
To create new
runOrderuser has to implementRunOrderinterface.How to define custom RunOrderCalculator?
Implement
RunOrderCalculatorinterface with logic you want to order test classes.e.g.
How to tell surefire to use custom
RunOrder&RunOrderCalculator?We have
RunOrderProviderspi to overwrite default runOrders &RunOrderCalculatorprovided by surefire.You need to registrar impl of RunOrderProvider in the file named
META-INF/services/org.apache.maven.plugin.surefire.runorder.spi.RunOrderProviderin main resources.File should contain fully qualified name of RunOrderProvider impl.
e.g.
com.surefire.YourRunOrderProviderImplImplementation of YourRunOrderProviderImpl is as follows: