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
RSpec doesn't display seed anymore #100
Comments
The seed is not printed if it is not used. Are you running things in defined order (e.g. |
Thanks for the explanation. However I am not sure this is intended behaviour:
Does not seem random enough to me
|
Thought it should be |
It must be something in your environment. I get 20 different seeds when running specs 20 different times:
While RSpec will default a random seed, it lets you set it so you can troubleshoot problems from a particular seed. Maybe you set it somewhere for a prior troubleshooting session and left that in place? Check |
Actually, here's a little monkey patch that should help you track down what is setting the seed. Put this in module TrackSeedSetter
def seed=(value)
puts "seed= called from:"
puts caller.join("\n")
puts
super
end
end
RSpec::Core::Configuration.prepend TrackSeedSetter Then run |
That's funny:
|
Odd. Are you using a pre-loader like zeus or spring? It's possible that with one of those running, the seed gets setup during the initial setup, and then each time you run You can see how RSpec sets the seed by default: https://github.com/rspec/rspec-core/blob/v3.1.7/lib/rspec/core/ordering.rb#L109 To confirm that that works on your machine, try running this:
It should print a different seed each time. |
Spring! Good one, thanks. Do you think RSpec can be amended so it works under spring? Change the randomizer to lambda or something?
|
We've exposed RSpec is blissfully unaware of Spring and we'd like to keep it that way. We've exposed public APIs that spring or other alternate runners can use to initialize and clear config and other state when they want. Alternate runners are in control of when that happens, not RSpec, so the fix would need to be there. In the meantime, you can set |
I haven't noticed when it started but now it is hard to pinpoint a failing test since RSpec does not show the seed it was running with. I remember before it was showing the seed value for the test run.
The text was updated successfully, but these errors were encountered: