Update development steps (#1623)

Ensure the development steps can be successfully executed with system
ruby on Fedora 36 to try and help new contributors have an easier
on-ramp.

Support running acceptance tests locally, though note that it may
require rvm if vagrant doesn't support the ruby version used by the
distro.
This commit is contained in:
Darragh Bailey
2022-10-01 15:53:00 +01:00
committed by GitHub
parent 54853d1d3d
commit 6d5ad2b87c
5 changed files with 25 additions and 12 deletions

View File

@@ -41,10 +41,18 @@ end
RSpec.configure do |config|
require 'tmpdir'
# 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
if ENV['VAGRANT_LIBVIRT_VAGRANT_HOME'].nil?
# 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
else
ENV['VAGRANT_HOME'] = ENV['VAGRANT_LIBVIRT_VAGRANT_HOME']
end
# acceptance tests need the boxes dir to exist to allow symlinking of isolated
# environments while allowing the boxes to be cached.
FileUtils.mkdir_p(File.join(ENV['VAGRANT_HOME'], 'boxes'))
# 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

View File

@@ -30,7 +30,7 @@ module VagrantPlugins
# Execute, logging out the stdout/stderr as we get it
@logger.info("Executing: #{[command].concat(args).inspect}")
Vagrant::Spec::Subprocess.execute(command, *args, **options) do |type, data|
Vagrant::Spec::Subprocess.new(command, *args, **options).execute do |type, data|
@logger.debug("#{type}: #{data}") if type == :stdout || type == :stderr
yield type, data if block_given?
end

View File

@@ -22,7 +22,7 @@ shared_context 'libvirt_acceptance' do
before(:each) do
# allow execution environment to cache boxes used
symlink_boxes(ENV.fetch('VAGRANT_HOME', nil), environment)
symlink_boxes(ENV.fetch('VAGRANT_HOME', File.expand_path('~/.vagrant.d')), environment)
end
after(:each) do