Ability to specify no parallelism on the environment
This commit is contained in:
parent
4bb5da7232
commit
f3cf23e873
|
@ -197,9 +197,11 @@ module Vagrant
|
|||
#
|
||||
# This handles the case where batch actions are disabled by the
|
||||
# VAGRANT_NO_PARALLEL environmental variable.
|
||||
def batch
|
||||
def batch(disable_parallel=false)
|
||||
disable_parallel ||= !!ENV["VAGRANT_NO_PARALLEL"]
|
||||
|
||||
@batch_lock.synchronize do
|
||||
BatchAction.new(!!ENV["VAGRANT_NO_PARALLEL"]).tap do |b|
|
||||
BatchAction.new(disable_parallel).tap do |b|
|
||||
# Yield it so that the caller can setup actions
|
||||
yield b
|
||||
|
||||
|
|
|
@ -64,6 +64,15 @@ describe Vagrant::Environment do
|
|||
instance.batch {}
|
||||
end
|
||||
end
|
||||
|
||||
it "should run with disabling parallelization if explicit" do
|
||||
with_temp_env("VAGRANT_NO_PARALLEL" => nil) do
|
||||
Vagrant::BatchAction.should_receive(:new).with(true).and_return(batch)
|
||||
batch.should_receive(:run)
|
||||
|
||||
instance.batch(true) {}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context "with the disabling env var" do
|
||||
|
|
Loading…
Reference in New Issue