Merge pull request #9659 from chrisroberts/f-checkpoint-disable
Properly respect environment variable on checkpoint setup
This commit is contained in:
commit
53ed5948f5
|
@ -39,6 +39,10 @@ module Vagrant
|
|||
rescue LoadError
|
||||
@logger.warn("checkpoint library not found. disabling.")
|
||||
end
|
||||
if ENV["VAGRANT_CHECKPOINT_DISABLE"]
|
||||
@logger.debug("checkpoint disabled via explicit user request")
|
||||
@enabled = false
|
||||
end
|
||||
@files = {
|
||||
signature: env.data_dir.join("checkpoint_signature"),
|
||||
cache: env.data_dir.join("checkpoint_cache")
|
||||
|
|
|
@ -23,7 +23,8 @@ describe Vagrant::Util::CheckpointClient do
|
|||
end
|
||||
|
||||
describe "#setup" do
|
||||
before{ subject.setup(env) }
|
||||
let(:environment){ {} }
|
||||
before{ with_temp_env(environment){ subject.setup(env) } }
|
||||
|
||||
it "should enable after setup" do
|
||||
expect(subject.enabled).to be(true)
|
||||
|
@ -32,6 +33,14 @@ describe Vagrant::Util::CheckpointClient do
|
|||
it "should generate required paths" do
|
||||
expect(subject.files).not_to be_empty
|
||||
end
|
||||
|
||||
context "with VAGRANT_CHECKPOINT_DISABLE set" do
|
||||
let(:environment){ {"VAGRANT_CHECKPOINT_DISABLE" => "1"} }
|
||||
|
||||
it "should not be enabled after setup" do
|
||||
expect(subject.enabled).to be(false)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe "#check" do
|
||||
|
|
Loading…
Reference in New Issue