-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Enable Random order in cucumber engine #2849
Comments
I would be happy to accept a pull request for this! You can add a step to the Lines 46 to 51 in edf09f1
To randomize the pickles, be aware that the JUnit Platform represents tests in a tree. For implementation hints, please have a look at JUnit Jupiter: And specifically the comments at: Note that currently we don't use the |
And pulling #2835 back into memory I see that I already had to implement some ordering and stalled there. So you may want to consider building on that PR instead. But I would accept either one of these solutions. |
🤔 What's the problem you're trying to solve?
I'm a team lead on a team currently implementing cucumber, and one of our usecases is being able to run individual features and scenarios. This is well supported, but to ensure this will work for any items, the features should be ran in a random (probably seeded) order, to highlight scenario dependencies. This is available in most versions of cucumber across languages, as well as in the cucumber core for java, but there is no way to access it in cucumber engine.
✨ What's your proposed solution?
Based on the existing property names and namespace for cucumber engine, and this feature in other environments that have it, introduce property cucumber.execution.order into cucumber engine. Cucumber engine already forwards all properties starting with "cucumber." from all sources so getting it should be smooth. From there its value should be mapped onto the correct PickleOrder value. Default should preserve existing behavior (lexical). Other options are random, random(seeded) and reverse lexical. I need random at least, but random(seeded) would be better.
⛏ Have you considered any alternatives or workarounds?
It's not usually recommended to hack into 3rd party libraries from your testcode, which leaves only hightened manual vigilance as an option.
📚 Any additional context?
Would be happy to try implementing it myself if your team will have the PR.
This text was originally generated from a template, then edited by hand. You can modify the template here.
The text was updated successfully, but these errors were encountered: