mirror of
https://github.com/vagrant-libvirt/vagrant-libvirt.git
synced 2025-02-25 18:55:27 -06:00
Remove need to explicitly set VAGRANT_HOME before running tests (#1580)
Ensure that the tests always set VAGRANT_HOME into the environment to prevent the global plugin manager from trying to load the plugins under this directory.
This commit is contained in:
parent
316ca8e1d4
commit
1db6618f76
@ -2,7 +2,9 @@
|
||||
|
||||
require 'log4r'
|
||||
|
||||
require 'vagrant-libvirt/util/erb_template'
|
||||
require 'vagrant-libvirt/util/resolvers'
|
||||
require 'vagrant-libvirt/util/storage_util'
|
||||
|
||||
module VagrantPlugins
|
||||
module ProviderLibvirt
|
||||
|
@ -8,6 +8,8 @@ rescue LoadError
|
||||
require 'rexml/rexml'
|
||||
end
|
||||
|
||||
require 'vagrant-libvirt/util/domain_flags'
|
||||
|
||||
module VagrantPlugins
|
||||
module ProviderLibvirt
|
||||
module Action
|
||||
|
@ -5,6 +5,8 @@ require 'open3'
|
||||
require 'json'
|
||||
|
||||
require 'vagrant-libvirt/util/byte_number'
|
||||
require 'vagrant-libvirt/util/storage_util'
|
||||
require 'vagrant-libvirt/util/ui'
|
||||
|
||||
module VagrantPlugins
|
||||
module ProviderLibvirt
|
||||
|
@ -3,6 +3,7 @@
|
||||
require 'fileutils'
|
||||
require 'log4r'
|
||||
|
||||
require 'vagrant-libvirt/util/ui'
|
||||
require 'vagrant-libvirt/util/unindent'
|
||||
|
||||
module VagrantPlugins
|
||||
|
@ -7,7 +7,9 @@ require 'digest/md5'
|
||||
|
||||
require 'vagrant/util/subprocess'
|
||||
require 'vagrant/errors'
|
||||
|
||||
require 'vagrant-libvirt/errors'
|
||||
require 'vagrant-libvirt/util/erb_template'
|
||||
|
||||
module VagrantPlugins
|
||||
module SyncedFolder9P
|
||||
|
@ -5,9 +5,11 @@ require 'ostruct'
|
||||
require 'nokogiri'
|
||||
require 'digest/md5'
|
||||
|
||||
require 'vagrant/util/subprocess'
|
||||
require 'vagrant/errors'
|
||||
require 'vagrant/util/subprocess'
|
||||
|
||||
require 'vagrant-libvirt/errors'
|
||||
require 'vagrant-libvirt/util/erb_template'
|
||||
|
||||
module VagrantPlugins
|
||||
module SyncedFolderVirtioFS
|
||||
|
@ -38,13 +38,12 @@ rescue LoadError
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
require 'vagrant-libvirt'
|
||||
require 'vagrant-spec/unit'
|
||||
|
||||
Dir[File.dirname(__FILE__) + '/support/**/*.rb'].each { |f| require f }
|
||||
|
||||
RSpec.configure do |config|
|
||||
# set VAGRANT_HOME before any thing that requires vagrant is loaded to prevent
|
||||
# the global plugin manager from trying to use the default VAGRANT_HOME.
|
||||
temp_dir = Dir.mktmpdir("rspec-")
|
||||
ENV['VAGRANT_HOME'] = temp_dir
|
||||
|
||||
# ensure that setting of LIBVIRT_DEFAULT_URI in the environment is not picked
|
||||
# up directly by tests, instead they must set as needed. Some build envs will
|
||||
# may have it set to 'qemu:///session'.
|
||||
@ -52,6 +51,10 @@ RSpec.configure do |config|
|
||||
ENV.delete('LIBVIRT_DEFAULT_URI')
|
||||
end
|
||||
|
||||
config.after(:suite) do
|
||||
FileUtils.remove_entry temp_dir
|
||||
end
|
||||
|
||||
config.mock_with :rspec do |mocks|
|
||||
mocks.verify_partial_doubles = true
|
||||
end
|
||||
@ -59,3 +62,7 @@ RSpec.configure do |config|
|
||||
# don't run acceptance tests by default
|
||||
config.filter_run_excluding :acceptance => true
|
||||
end
|
||||
|
||||
require 'vagrant-spec/unit'
|
||||
|
||||
Dir[File.dirname(__FILE__) + '/support/**/*.rb'].each { |f| require f }
|
||||
|
@ -3,6 +3,7 @@
|
||||
require 'spec_helper'
|
||||
require 'support/sharedcontext'
|
||||
|
||||
require 'vagrant-libvirt'
|
||||
require 'vagrant-libvirt/plugin'
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user