summaryrefslogtreecommitdiff
path: root/spec/commands/check_spec.rb
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/commands/check_spec.rb
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/commands/check_spec.rb')
-rw-r--r--spec/commands/check_spec.rb13
1 files changed, 6 insertions, 7 deletions
diff --git a/spec/commands/check_spec.rb b/spec/commands/check_spec.rb
index c755ef2804..0b5eae5d0b 100644
--- a/spec/commands/check_spec.rb
+++ b/spec/commands/check_spec.rb
@@ -18,8 +18,7 @@ RSpec.describe "bundle check" do
gem "rails"
G
- Dir.chdir tmp
- bundle "check --gemfile bundled_app/Gemfile"
+ bundle "check --gemfile bundled_app/Gemfile", :dir => tmp
expect(out).to include("The Gemfile's dependencies are satisfied")
end
@@ -29,11 +28,11 @@ RSpec.describe "bundle check" do
gem "rails"
G
- FileUtils.rm("Gemfile.lock")
+ FileUtils.rm(bundled_app_lock)
bundle "check"
- expect(bundled_app("Gemfile.lock")).to exist
+ expect(bundled_app_lock).to exist
end
it "does not create a Gemfile.lock if --dry-run was passed" do
@@ -42,11 +41,11 @@ RSpec.describe "bundle check" do
gem "rails"
G
- FileUtils.rm("Gemfile.lock")
+ FileUtils.rm(bundled_app_lock)
bundle "check --dry-run"
- expect(bundled_app("Gemfile.lock")).not_to exist
+ expect(bundled_app_lock).not_to exist
end
it "prints a generic error if the missing gems are unresolvable" do
@@ -232,7 +231,7 @@ RSpec.describe "bundle check" do
G
bundle! "install", forgotten_command_line_options(:deployment => true)
- FileUtils.rm(bundled_app("Gemfile.lock"))
+ FileUtils.rm(bundled_app_lock)
bundle :check
expect(last_command).to be_failure