From a9b567eadfde8ed6dc74923a1fde68ae1389defa Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Sat, 18 Nov 2017 15:08:23 -0800 Subject: [PATCH] Cap rake below 12.3.0 New rake version 12.3.0 needs ruby 2.0 or greater which is not available on our trusty test nodes. Cap to under rake 12.3.0 so that we use older rake until we can stop using trusty and have more modern ruby. The test runner script updates the installation path for this helper lib to point back at itself when running local tests. Unfortunately it was doing so with a buggy sed that no longer matched the contents of the Gemfile that needed updating. Fix this by updating the sed command to properly point to this lib for local testing. Note this is fixed here because we need both fixes in together in order to get gate jobs to pass. Change-Id: Iddbbab9ea5996df4922bf7927deb8f0354378ab7 --- puppet-openstack_infra_spec_helper.gemspec | 4 ++++ run_unit_tests.sh | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/puppet-openstack_infra_spec_helper.gemspec b/puppet-openstack_infra_spec_helper.gemspec index a2881c0..061bd84 100644 --- a/puppet-openstack_infra_spec_helper.gemspec +++ b/puppet-openstack_infra_spec_helper.gemspec @@ -16,6 +16,10 @@ Gem::Specification.new do |spec| spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = ["lib"] + # This is a transitive dep that we define early so that the version + # that works for us is found. + # rake 12.3.0 requires Ruby version ~> 2.0 + spec.add_dependency 'rake', ['< 12.3.0'] # dependencies that are needed to run puppet-lint spec.add_dependency 'puppet', [ '~> 3.8'] spec.add_dependency 'puppetlabs_spec_helper' diff --git a/run_unit_tests.sh b/run_unit_tests.sh index 4f76a2e..3387875 100755 --- a/run_unit_tests.sh +++ b/run_unit_tests.sh @@ -32,7 +32,10 @@ cd openstack-infra/puppet-openstackci # Modify Gemfile to use local library and not the one on git # so we can actually test the current state of the gem. -sed -i "s/.*git => 'https:\/\/git.openstack.org\/openstack-infra\/puppet-openstack_infra_spec_helper.*/ :path => '..\/..',/" Gemfile +# Note this is largely belts and suspenders for local test runs. +# puppet-openstackci already attempts to determine if it is running +# under Zuul and will do the correct thing in that case. +sed -i "s/:git => 'https:\/\/git.openstack.org\/openstack-infra\/puppet-openstack_infra_spec_helper'}/:path => '..\/..'}/" Gemfile # Install dependencies gem install bundler --no-rdoc --no-ri --verbose