-
-
Notifications
You must be signed in to change notification settings - Fork 765
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
Use random order by default #2929
Conversation
RSpec project initializer ( # The settings below are suggested to provide a good initial experience
# with RSpec, but feel free to customize to your heart's content.
=begin
config.order = :random
I think it makes sense for RubyGems to at least provide the same
Would you accept a PR updating the RubyGems Note. Some options that presently appear in RSpec 3.x, like e.g. |
That makes sense to me, yeah! |
@santib Thanks for bringing this problem up. Whether to trust our users' or force-feed them best practices by uncommenting those lines is a different topic. To me it's an improvement to give them choice and unburden from looking up all those options in other projects or on GitHub. |
@pirj My question is, why does RSpec not provide this "good initial experience" by default? |
@deivid-rodriguez We trust our users to be able to make a good choice if we give them an easy way to do so? We prefer not to push anything to our users, as there certainly are cases when the opposite defaults matter. For example, Puppet infra specs:
See the official RSpec style guide ticket discussion:
What we've already seen this concern in reality 😄
It would not be effective to "count the setup time in minutes" if Puppet specs would go with |
Sorry, I couldn't understand the point of your links. You certainly provide some defaults, but it feels weird to me that you recommend different settings than your own defaults in your generated helper. I believe it's great that you provide a self-contained helper with a lot of comments explaining the different options that users can tweak. But if feels weird to me to recommend some settings (specifically with the " The settings below are suggested to provide a good initial experience" wording) that you don't enable by default. |
FWIW I'd support changing to random as the default in RSpec 4. |
Would you like to contribute such a change to
An additional pull request might be needed to warn users who don't explicitly set the global order that it has changed (see e.g. #2880), to |
Sure @pirj, I will do it |
@pirj I just pushed a first version, but I have some questions:
When things are ok I can work on the deprecation warning and maybe we could also say it in some doc? |
For our spec suite changes, you should be able to tag the specs / groups |
I tried this but it didn't work 🤔 Any ideas? |
7eb3c3c
to
7dccf87
Compare
Can you please push the failing changes? Any luck with pushing your changes to RubyGems? |
Can you rebase this or bump commit it to see if we can get this to build? Github actions seems to be MIA |
@JonRowe CI is waiting for approval |
Merging because the build failurs are not related to this PR, and |
Hi, in rubygems/rubygems#5296 I proposed using
--order random
on gem creation by default to help prevent introducing order dependant tests. But it might not make sense to havebundler
do that if it's not a default onrspec
.So this PR is actually to ask what do you think about it. Have you discussed this in the past? Assuming that this is a best practice in the community, wouldn't it help everyone to have
--order random
by default?