-
Notifications
You must be signed in to change notification settings - Fork 542
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SUREFIRE-1405] Allows user to extend RunOrder & RunOrderCalculator #169
base: master
Are you sure you want to change the base?
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/junit5#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 |
Fixes: https://issues.apache.org/jira/browse/SUREFIRE-1405
Implementation Details
How to create new RunOrder?
To create new
runOrder
user has to implementRunOrder
interface.How to define custom RunOrderCalculator?
Implement
RunOrderCalculator
interface with logic you want to order test classes.e.g.
How to tell surefire to use custom
RunOrder
&RunOrderCalculator
?We have
RunOrderProvider
spi to overwrite default runOrders &RunOrderCalculator
provided by surefire.You need to registrar impl of RunOrderProvider in the file named
META-INF/services/org.apache.maven.plugin.surefire.runorder.spi.RunOrderProvider
in main resources.File should contain fully qualified name of RunOrderProvider impl.
e.g.
com.surefire.YourRunOrderProviderImpl
Implementation of YourRunOrderProviderImpl is as follows: