-
-
Notifications
You must be signed in to change notification settings - Fork 102
WIP: Update shared context to minimize loaded stdlibs. #179
Conversation
4d098af
to
68f700d
Compare
Seems... complex? Not sure I grok it atm |
Which parts are you confused about? I adapted most of this from https://github.com/rspec/rspec-support/blob/master/lib/rspec/support/spec/prevent_load_time_warnings.rb which we'll be removing once core/expectations/mocks have been updated to use this new example group. Notable changes from that are:
Does that explain it better? |
5ba43eb
to
f3d3c6c
Compare
f3d3c6c
to
aefe3aa
Compare
Previously it was required by rspec-core so we didn’t notice failures due to not requiring it.
Ah ok, I didn't realise Ruby tracked requires in that way... TIL.. :D |
So the appveyor build is failing and I'm not sure how to fix it. The new "loads only a known set of stdlibs" spec fails with:
The "issues no warnings when loaded" spec fails with:
Does anyone have any ideas for how to fix this? I'll probably just tag these as |
@@ -1,3 +1,5 @@ | |||
require 'rbconfig' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The irony of adding an additional piece of standard library while detecting usage of the standard library amuses me ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, I noticed that rspec-core loads rbconfig:
https://github.com/rspec/rspec-core/blob/v3.2.0/lib/rspec/core.rb#L5
...but it's not used in rspec-core anywhere. Originally it was used for the OS detection that got moved here but the require never got moved. It should be here since it is used here. I will be removing it from rspec-core soon.
Trying that now... |
Hmm, nope, maybe we should create the full path with |
Failures: 1) RSpec::Support behaves like library wide checks issues no warnings when loaded Failure/Error: expect(lib_file_results).to have_successful_no_warnings_output expected: ["", "", 0] got: ["", "", 5] (compared using ==) Shared Example Group: "library wide checks" called from ./spec/rspec/support_spec.rb:8 2) RSpec::Support behaves like library wide checks only loads a known set of stdlibs so gem authors are forced to load libs they use to have passing specs Failure/Error: loaded_features = File.read(loaded_features_outfile).split("\n") Errno::ENOENT: No such file or directory - loaded_features.txt Shared Example Group: "library wide checks" called from ./spec/rspec/support_spec.rb:8
020b4d1
to
4e1f0a6
Compare
I don't care enough to put effort into the slow trial-and-error feedback loop of AppVeyor. I just marked them as |
WIP: Update shared context to minimize loaded stdlibs.
LGTM then... |
Fixes #177.
More to come here -- I have some other ideas -- but I ran out of time this morning and wanted to push what I had to get travis builds going.
/cc @JonRowe