summaryrefslogtreecommitdiff
path: root/spec/update
diff options
context:
space:
mode:
authorBundlerbot <bot@bundler.io>2020-01-13 08:45:23 +0000
committerBundlerbot <bot@bundler.io>2020-01-13 08:45:23 +0000
commitcb96a16c9b7ffbb50c9929be7058ab1f4a552ca3 (patch)
treee532f1f4eb42a0b9f438ef40380a1ab9ae810975 /spec/update
parent971d39b32d3ec8bfcdc951061c88e364f864423e (diff)
parent7dc38a75680f991bf32320cca850c32d1dcd90ca (diff)
downloadbundler-cb96a16c9b7ffbb50c9929be7058ab1f4a552ca3.tar.gz
Merge #7568
7568: Make parallel tests more stable r=deivid-rodriguez a=deivid-rodriguez ### What was the end-user problem that led to this PR? The problem was that since we run parallel tests by default, our CI is much less stable even though specs are faster. ### What was your diagnosis of the problem? My diagnosis was that our specs change folders back and forth for every test, and that's not thread safe. ### What is your fix for the problem, implemented in this PR? My fix is to stop changing folders in the main process during our specs. ### Why did you choose this fix out of the possible options? I chose this fix because it should improve stability of our specs. Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
Diffstat (limited to 'spec/update')
-rw-r--r--spec/update/gemfile_spec.rb8
-rw-r--r--spec/update/git_spec.rb18
2 files changed, 10 insertions, 16 deletions
diff --git a/spec/update/gemfile_spec.rb b/spec/update/gemfile_spec.rb
index 8c2bd9ccbf..4a902e59e2 100644
--- a/spec/update/gemfile_spec.rb
+++ b/spec/update/gemfile_spec.rb
@@ -38,12 +38,10 @@ RSpec.describe "bundle update" do
it "uses the gemfile while in a subdirectory" do
bundled_app("subdir").mkpath
- Dir.chdir(bundled_app("subdir")) do
- bundle! "update", :all => true
- bundle "list"
+ bundle! "update", :all => true, :dir => bundled_app("subdir")
+ bundle "list", :dir => bundled_app("subdir")
- expect(out).to include("rack (1.0.0)")
- end
+ expect(out).to include("rack (1.0.0)")
end
end
end
diff --git a/spec/update/git_spec.rb b/spec/update/git_spec.rb
index 752033c842..58cf18bba0 100644
--- a/spec/update/git_spec.rb
+++ b/spec/update/git_spec.rb
@@ -131,10 +131,8 @@ RSpec.describe "bundle update" do
s.add_dependency "submodule"
end
- Dir.chdir(lib_path("has_submodule-1.0")) do
- sys_exec "git submodule add #{lib_path("submodule-1.0")} submodule-1.0"
- `git commit -m "submodulator"`
- end
+ sys_exec "git submodule add #{lib_path("submodule-1.0")} submodule-1.0", :dir => lib_path("has_submodule-1.0")
+ sys_exec "git commit -m \"submodulator\"", :dir => lib_path("has_submodule-1.0")
end
it "it unlocks the source when submodules are added to a git source" do
@@ -259,14 +257,12 @@ RSpec.describe "bundle update" do
bundle "update --source foo"
- in_app_root do
- run <<-RUBY
- require 'foo'
- puts "WIN" if defined?(FOO_PREV_REF)
- RUBY
+ run <<-RUBY
+ require 'foo'
+ puts "WIN" if defined?(FOO_PREV_REF)
+ RUBY
- expect(out).to eq("WIN")
- end
+ expect(out).to eq("WIN")
end
it "unlocks gems that were originally pulled in by the source" do