diff options
| author | Bundlerbot <bot@bundler.io> | 2018-11-06 09:23:46 +0000 |
|---|---|---|
| committer | Bundlerbot <bot@bundler.io> | 2018-11-06 09:23:46 +0000 |
| commit | 98040394795a8e5fd03d7e893f1a060041cd6777 (patch) | |
| tree | 00721871774dbafbdf34c61f387c249e4c861a1b /spec/install | |
| parent | 905dce42705d0e92fa5c74ce4b9133c7d77a6fb1 (diff) | |
| parent | 7289aadc249e361a4b4fb97b59289ad105048028 (diff) | |
| download | bundler-98040394795a8e5fd03d7e893f1a060041cd6777.tar.gz | |
Merge #6714
6714: Spec reset state and refactorings r=deivid-rodriguez a=deivid-rodriguez
### What was the end-user problem that led to this PR?
The problem was that while working on #6713, I noticed several issues like order dependent failures, situations hard to debug, or specs doing too much and taking longer than they should.
### What was your diagnosis of the problem?
My diagnosis was that:
* Sometimes specs leak settings and env variable modifications.
* When a hang happens inside a subprocess, it's hard to debug because logging is not printed out anywhere.
* Some specs create unnecessary gemfiles and run `bundle install` multiple times unnecessarily.
### What is your fix for the problem, implemented in this PR?
My fix for state leaks is to reset state after each spec, for the hangs is to reorder some lines in the `sys_exec` helper (https://github.com/bundler/bundler/commit/b305a5b2524a6457b05a9d39e9526f75c98a0752), and for the unnecessary operations, to refactor the specs to avoid them.
### Why did you choose this fix out of the possible options?
I chose this fix because it seems like the best way to alleviate the issues found.
Co-authored-by: David RodrÃguez <deivid.rodriguez@riseup.net>
Diffstat (limited to 'spec/install')
| -rw-r--r-- | spec/install/gemfile/git_spec.rb | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/spec/install/gemfile/git_spec.rb b/spec/install/gemfile/git_spec.rb index 651deb3265..beb5335fe4 100644 --- a/spec/install/gemfile/git_spec.rb +++ b/spec/install/gemfile/git_spec.rb @@ -922,12 +922,11 @@ RSpec.describe "bundle install with git sources" do build_git "foo", :path => lib_path("nested") build_git "bar", :path => lib_path("nested") - gemfile <<-G + install_gemfile <<-G gem "foo", :git => "#{lib_path("nested")}" gem "bar", :git => "#{lib_path("nested")}" G - bundle "install" expect(File.read(bundled_app("Gemfile.lock")).scan("GIT").size).to eq(1) end @@ -1010,13 +1009,11 @@ RSpec.describe "bundle install with git sources" do install_gemfile <<-G gem "foo", :git => "file://#{lib_path("foo-1.0")}", :ref => "#{revision}" G - bundle "install" expect(out).to_not match(/Revision.*does not exist/) install_gemfile <<-G gem "foo", :git => "file://#{lib_path("foo-1.0")}", :ref => "deadbeef" G - bundle "install" expect(out).to include("Revision deadbeef does not exist in the repository") end end @@ -1423,7 +1420,6 @@ In Gemfile: end G - bundle :install expect(last_command.stdboth).to_not include("password1") expect(last_command.stdout).to include("Fetching https://user1@github.com/company/private-repo") end @@ -1439,7 +1435,6 @@ In Gemfile: end G - bundle :install expect(last_command.stdboth).to_not include("oauth_token") expect(last_command.stdout).to include("Fetching https://x-oauth-basic@github.com/company/private-repo") end |
