Update Fuel CI script to use puppet 3.8

This change updates the scripts used by Fuel CI to pull in puppet 3.8
rather than 3.4.

In order to support testing under Puppet 3.8, we have to setup the
puppet settings as part of our overrides setup. This is due to a change
after 3.4 where these settings are no longer setup as part of the
TestHelper inititalize call. This was done as part of PUP-11118.
Without setting up up the settings, rspec may error when we attempt
to access the Puppet scope or functions.

Change-Id: I26c20036cc9a829fc5d7d351530ac358b1a5ace8
Related-Bug: 1500414
Closes-Bug: 1513969
This commit is contained in:
Alex Schultz 2015-11-06 15:19:58 -06:00
parent 8f2f65f2ed
commit a26619dc7a
4 changed files with 22 additions and 3 deletions

View File

@ -115,7 +115,26 @@ class Noop
end
end
# These settings are pullled from the Puppet TestHelper
# (See Puppet::Test::TestHelper.initialize_settings_before_each)
# These items used to be setup in puppet 3.4 but were moved to before tests
# which breaks our testing framework because we attempt to call
# PuppetlabsSpec::PuppetInternals.scope and
# Puppet::Parser::Function.autoload.load prior to the testing being run.
# This results in an rspec failure so we need to initialize the basic
# settings up front to prevent issues with test framework. See PUP-5601
def puppet_default_settings
Puppet.settings.initialize_app_defaults({
:logdir => '/dev/null',
:confdir => '/dev/null',
:vardir => '/dev/null',
:rundir => '/dev/null',
:hiera_config => '/dev/null',
})
end
def setup_overrides
puppet_default_settings
hiera_puppet_override
puppet_debug_override if ENV['SPEC_PUPPET_DEBUG']
puppet_resource_scope_override

View File

@ -24,7 +24,7 @@ module NoopTests
ASTUTE_YAML_VAR = 'SPEC_ASTUTE_FILE_NAME'
BUNDLE_DIR = '.bundled_gems'
BUNDLE_VAR = 'GEM_HOME'
PUPPET_GEM_VERSION = '~> 3.4.0'
PUPPET_GEM_VERSION = '~> 3.8.0'
TEST_LIBRARY_DIR = 'spec/hosts'
GLOBALS_YAML_FOLDER = 'globals'

View File

@ -43,7 +43,7 @@ export FUEL_LIBRARY_PATH=$(cd "${SCRIPT_PATH}/../.." && pwd -P)
cd $FUEL_LIBRARY_PATH
if [ -z "$PUPPET_GEM_VERSION" ] ; then
export PUPPET_GEM_VERSION='~> 3.4.0'
export PUPPET_GEM_VERSION='~> 3.8.0'
fi
# Check for bundle and exit if failed

View File

@ -37,7 +37,7 @@ if ! [ -d "$WORKSPACE" ] ; then
fi
if [ -z "$PUPPET_GEM_VERSION" ] ; then
export PUPPET_GEM_VERSION='~> 3.4.0'
export PUPPET_GEM_VERSION='~> 3.8.0'
fi
# Check for bundle and exit if failed