From 7e98f7db3bd79775377439d41dd21ed12d10f105 Mon Sep 17 00:00:00 2001 From: Paula Muir Date: Mon, 24 Sep 2018 17:02:25 +0100 Subject: [PATCH] (FM-7392) - Puppet 6 Testing Changes --- .rubocop.yml | 4 ++++ .travis.yml | 15 +++++++++------ Gemfile | 22 +++++++--------------- metadata.json | 2 +- spec/default_facts.yml | 2 +- 5 files changed, 22 insertions(+), 23 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index ef3b9a5..b25405c 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -21,6 +21,10 @@ AllCops: Metrics/LineLength: Description: People have wide screens, use them. Max: 200 +GetText/DecorateString: + Description: We don't want to decorate test output. + Exclude: + - spec/* RSpec/BeforeAfterAll: Description: Beware of using after(:all) as it may cause state to leak between tests. A necessary evil in acceptance testing. diff --git a/.travis.yml b/.travis.yml index e0df4ea..f427aa5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,26 +13,26 @@ script: - 'bundle exec rake $CHECK' bundler_args: --without system_tests rvm: - - 2.4.4 + - 2.5.0 env: global: - - BEAKER_PUPPET_COLLECTION=puppet5 PUPPET_GEM_VERSION="~> 5.0" + - BEAKER_PUPPET_COLLECTION=puppet6 PUPPET_GEM_VERSION="~> 6.0" matrix: fast_finish: true include: - bundler_args: dist: trusty - env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_set=docker/debian-8 BEAKER_TESTMODE=apply - rvm: 2.4.4 + env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_set=docker/debian-8 BEAKER_TESTMODE=apply + rvm: 2.5.0 script: bundle exec rake beaker services: docker sudo: required - bundler_args: dist: trusty - env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_set=docker/ubuntu-14.04 BEAKER_TESTMODE=apply - rvm: 2.4.4 + env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_set=docker/ubuntu-14.04 BEAKER_TESTMODE=apply + rvm: 2.5.0 script: bundle exec rake beaker services: docker sudo: required @@ -40,6 +40,9 @@ matrix: env: CHECK="syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop" - env: CHECK=parallel_spec + - + env: PUPPET_GEM_VERSION="~> 5.0" CHECK=parallel_spec + rvm: 2.4.4 - env: PUPPET_GEM_VERSION="~> 4.0" CHECK=parallel_spec rvm: 2.1.9 diff --git a/Gemfile b/Gemfile index 1aff7a8..d85a609 100644 --- a/Gemfile +++ b/Gemfile @@ -1,22 +1,15 @@ source ENV['GEM_SOURCE'] || 'https://rubygems.org' def location_for(place_or_version, fake_version = nil) - if place_or_version =~ %r{\A(git[:@][^#]*)#(.*)} - [fake_version, { git: Regexp.last_match(1), branch: Regexp.last_match(2), require: false }].compact - elsif place_or_version =~ %r{\Afile:\/\/(.*)} - ['>= 0', { path: File.expand_path(Regexp.last_match(1)), require: false }] - else - [place_or_version, { require: false }] - end -end + git_url_regex = %r{\A(?(https?|git)[:@][^#]*)(#(?.*))?} + file_url_regex = %r{\Afile:\/\/(?.*)} -def gem_type(place_or_version) - if place_or_version =~ %r{\Agit[:@]} - :git - elsif !place_or_version.nil? && place_or_version.start_with?('file:') - :file + if place_or_version && (git_url = place_or_version.match(git_url_regex)) + [fake_version, { git: git_url[:url], branch: git_url[:branch], require: false }].compact + elsif place_or_version && (file_url = place_or_version.match(file_url_regex)) + ['>= 0', { path: File.expand_path(file_url[:path]), require: false }] else - :gem + [place_or_version, { require: false }] end end @@ -42,7 +35,6 @@ group :system_tests do end puppet_version = ENV['PUPPET_GEM_VERSION'] -puppet_type = gem_type(puppet_version) facter_version = ENV['FACTER_GEM_VERSION'] hiera_version = ENV['HIERA_GEM_VERSION'] diff --git a/metadata.json b/metadata.json index b8b9518..57c939c 100644 --- a/metadata.json +++ b/metadata.json @@ -41,6 +41,6 @@ } ], "template-url": "https://github.com/puppetlabs/pdk-templates", - "template-ref": "1.7.0-0-g57412ed", + "template-ref": "heads/master-0-g8fc95db", "pdk-version": "1.7.0" } diff --git a/spec/default_facts.yml b/spec/default_facts.yml index 3248be5..e10d991 100644 --- a/spec/default_facts.yml +++ b/spec/default_facts.yml @@ -2,7 +2,7 @@ # # Facts specified here will override the values provided by rspec-puppet-facts. --- -concat_basedir: "/tmp" +concat_basedir: "" ipaddress: "172.16.254.254" is_pe: false macaddress: "AA:AA:AA:AA:AA:AA" -- 2.32.3