(FM-7392) - Puppet 6 Testing Changes
This commit is contained in:
@@ -19,6 +19,10 @@ AllCops:
|
|||||||
Metrics/LineLength:
|
Metrics/LineLength:
|
||||||
Description: People have wide screens, use them.
|
Description: People have wide screens, use them.
|
||||||
Max: 200
|
Max: 200
|
||||||
|
GetText/DecorateString:
|
||||||
|
Description: We don't want to decorate test output.
|
||||||
|
Exclude:
|
||||||
|
- spec/*
|
||||||
RSpec/BeforeAfterAll:
|
RSpec/BeforeAfterAll:
|
||||||
Description: Beware of using after(:all) as it may cause state to leak between tests.
|
Description: Beware of using after(:all) as it may cause state to leak between tests.
|
||||||
A necessary evil in acceptance testing.
|
A necessary evil in acceptance testing.
|
||||||
|
|||||||
15
.travis.yml
15
.travis.yml
@@ -13,26 +13,26 @@ script:
|
|||||||
- 'bundle exec rake $CHECK'
|
- 'bundle exec rake $CHECK'
|
||||||
bundler_args: --without system_tests
|
bundler_args: --without system_tests
|
||||||
rvm:
|
rvm:
|
||||||
- 2.4.4
|
- 2.5.0
|
||||||
env:
|
env:
|
||||||
global:
|
global:
|
||||||
- BEAKER_PUPPET_COLLECTION=puppet5 PUPPET_GEM_VERSION="~> 5.0"
|
- BEAKER_PUPPET_COLLECTION=puppet6 PUPPET_GEM_VERSION="~> 6.0"
|
||||||
matrix:
|
matrix:
|
||||||
fast_finish: true
|
fast_finish: true
|
||||||
include:
|
include:
|
||||||
-
|
-
|
||||||
bundler_args:
|
bundler_args:
|
||||||
dist: trusty
|
dist: trusty
|
||||||
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_set=docker/centos-7 BEAKER_TESTMODE=apply
|
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_set=docker/centos-7 BEAKER_TESTMODE=apply
|
||||||
rvm: 2.4.4
|
rvm: 2.5.0
|
||||||
script: bundle exec rake beaker
|
script: bundle exec rake beaker
|
||||||
services: docker
|
services: docker
|
||||||
sudo: required
|
sudo: required
|
||||||
-
|
-
|
||||||
bundler_args:
|
bundler_args:
|
||||||
dist: trusty
|
dist: trusty
|
||||||
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_set=docker/ubuntu-14.04 BEAKER_TESTMODE=apply
|
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_set=docker/ubuntu-14.04 BEAKER_TESTMODE=apply
|
||||||
rvm: 2.4.4
|
rvm: 2.5.0
|
||||||
script: bundle exec rake beaker
|
script: bundle exec rake beaker
|
||||||
services: docker
|
services: docker
|
||||||
sudo: required
|
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="syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop"
|
||||||
-
|
-
|
||||||
env: CHECK=parallel_spec
|
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
|
env: PUPPET_GEM_VERSION="~> 4.0" CHECK=parallel_spec
|
||||||
rvm: 2.1.9
|
rvm: 2.1.9
|
||||||
|
|||||||
22
Gemfile
22
Gemfile
@@ -1,25 +1,18 @@
|
|||||||
source ENV['GEM_SOURCE'] || 'https://rubygems.org'
|
source ENV['GEM_SOURCE'] || 'https://rubygems.org'
|
||||||
|
|
||||||
def location_for(place_or_version, fake_version = nil)
|
def location_for(place_or_version, fake_version = nil)
|
||||||
if place_or_version =~ %r{\A(git[:@][^#]*)#(.*)}
|
git_url_regex = %r{\A(?<url>(https?|git)[:@][^#]*)(#(?<branch>.*))?}
|
||||||
[fake_version, { git: Regexp.last_match(1), branch: Regexp.last_match(2), require: false }].compact
|
file_url_regex = %r{\Afile:\/\/(?<path>.*)}
|
||||||
elsif place_or_version =~ %r{\Afile:\/\/(.*)}
|
|
||||||
['>= 0', { path: File.expand_path(Regexp.last_match(1)), require: false }]
|
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
|
else
|
||||||
[place_or_version, { require: false }]
|
[place_or_version, { require: false }]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
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
|
|
||||||
else
|
|
||||||
:gem
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
ruby_version_segments = Gem::Version.new(RUBY_VERSION.dup).segments
|
ruby_version_segments = Gem::Version.new(RUBY_VERSION.dup).segments
|
||||||
minor_version = ruby_version_segments[0..1].join('.')
|
minor_version = ruby_version_segments[0..1].join('.')
|
||||||
|
|
||||||
@@ -41,7 +34,6 @@ group :system_tests do
|
|||||||
end
|
end
|
||||||
|
|
||||||
puppet_version = ENV['PUPPET_GEM_VERSION']
|
puppet_version = ENV['PUPPET_GEM_VERSION']
|
||||||
puppet_type = gem_type(puppet_version)
|
|
||||||
facter_version = ENV['FACTER_GEM_VERSION']
|
facter_version = ENV['FACTER_GEM_VERSION']
|
||||||
hiera_version = ENV['HIERA_GEM_VERSION']
|
hiera_version = ENV['HIERA_GEM_VERSION']
|
||||||
|
|
||||||
|
|||||||
@@ -88,6 +88,6 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"template-url": "https://github.com/puppetlabs/pdk-templates",
|
"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"
|
"pdk-version": "1.7.0"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# Facts specified here will override the values provided by rspec-puppet-facts.
|
# Facts specified here will override the values provided by rspec-puppet-facts.
|
||||||
---
|
---
|
||||||
concat_basedir: "/tmp"
|
concat_basedir: ""
|
||||||
ipaddress: "172.16.254.254"
|
ipaddress: "172.16.254.254"
|
||||||
is_pe: false
|
is_pe: false
|
||||||
macaddress: "AA:AA:AA:AA:AA:AA"
|
macaddress: "AA:AA:AA:AA:AA:AA"
|
||||||
|
|||||||
Reference in New Issue
Block a user