This repository has been archived by the owner on Jan 10, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Fix beaker version to ~>3.13"
This reverts commit c405331.
- Loading branch information
Showing
4 changed files
with
241 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,71 @@ | ||
--- | ||
sudo: false | ||
dist: trusty | ||
language: ruby | ||
bundler_args: --without system_tests | ||
install: ["travis_retry ./.travis.sh"] | ||
script: ["bundle exec rake validate", "bundle exec rake lint", "AUGEAS_LENS_LIB=files/lenses bundle exec rake spec SPEC_OPTS='--format documentation'", "bundle exec rake metadata"] | ||
cache: bundler | ||
addons: | ||
apt: | ||
packages: | ||
- libaugeas-dev | ||
before_install: | ||
- rm -f Gemfile.lock | ||
script: | ||
- 'bundle exec rake $CHECK' | ||
matrix: | ||
fast_finish: true | ||
include: | ||
- rvm: 2.1.9 | ||
env: PUPPET_GEM_VERSION="~> 4.0" | ||
- rvm: 2.4.1 | ||
env: PUPPET_GEM_VERSION="~> 5.0" | ||
bundler_args: --without system_tests development release | ||
env: PUPPET_VERSION="~> 4.0" CHECK=test PARALLEL_TEST_PROCESSORS=12 | ||
- rvm: 2.4.4 | ||
bundler_args: --without system_tests development release | ||
env: PUPPET_VERSION="~> 5.0" CHECK=test | ||
- rvm: 2.5.1 | ||
bundler_args: --without system_tests development release | ||
env: PUPPET_VERSION="~> 5.0" CHECK=test_with_coveralls | ||
- rvm: 2.4.4 | ||
bundler_args: --without system_tests development release | ||
env: PUPPET_VERSION="~> 5.0" CHECK=rubocop | ||
- rvm: 2.5.1 | ||
bundler_args: --without system_tests development release | ||
env: PUPPET_VERSION="~> 5.0" CHECK=build DEPLOY_TO_FORGE=yes | ||
- rvm: 2.4.0 | ||
sudo: required | ||
services: docker | ||
env: BEAKER_set="docker/debian-7" PUPPET_INSTALL_TYPE="agent" CHECK="beaker" BEAKER_IS_PE=no | ||
bundler_args: | ||
env: BEAKER_set="docker/debian-7" PUPPET_INSTALL_TYPE="agent" CHECK="beaker" BEAKER_IS_PE=no | ||
script: bundle exec rspec spec/acceptance/*_spec.rb | ||
- rvm: 2.4.0 | ||
sudo: required | ||
services: docker | ||
env: BEAKER_set="docker/centos-6" PUPPET_INSTALL_TYPE="agent" CHECK="beaker" BEAKER_IS_PE=no | ||
sudo: required | ||
- rvm: 2.4.0 | ||
bundler_args: | ||
env: BEAKER_set="docker/centos-6" PUPPET_INSTALL_TYPE="agent" CHECK="beaker" BEAKER_IS_PE=no | ||
script: bundle exec rspec spec/acceptance/*_spec.rb | ||
- rvm: 2.4.0 | ||
sudo: required | ||
services: docker | ||
env: BEAKER_set="docker/centos-7" PUPPET_INSTALL_TYPE="agent" CHECK="beaker" BEAKER_IS_PE=no | ||
sudo: required | ||
- rvm: 2.4.0 | ||
bundler_args: | ||
env: BEAKER_set="docker/centos-7" PUPPET_INSTALL_TYPE="agent" CHECK="beaker" BEAKER_IS_PE=no | ||
script: bundle exec rspec spec/acceptance/*_spec.rb | ||
- rvm: default | ||
sudo: required | ||
dist: trusty | ||
services: docker | ||
env: BEAKER_set="centos-6" | ||
bundler_args: | ||
script: sudo service docker restart ; sleep 10 && bundle exec rspec spec/acceptance/*_spec.rb | ||
- rvm: default | ||
sudo: required | ||
dist: trusty | ||
services: docker | ||
env: BEAKER_set="centos-7" | ||
bundler_args: | ||
script: sudo service docker restart ; sleep 10 && bundle exec rspec spec/acceptance/*_spec.rb | ||
branches: | ||
only: | ||
- master | ||
- /^v\d/ | ||
notifications: | ||
email: false | ||
irc: | ||
on_success: always | ||
on_failure: always | ||
channels: | ||
- "chat.freenode.org#voxpupuli-notifications" | ||
deploy: | ||
provider: puppetforge | ||
user: puppet | ||
password: | ||
secure: "etCGQI0hjcKLcm7WcdUONSCh3TWM+SSoqCVMdMsulcVKeAR2CWPSi2nga7TKsDAlKQ2XxXPVYcBpFf+p0gxbAvV4jCFNU96KTtHAMkJbIASYhtHr9Ixk/ToG6hhdywvjAZRS7xvAOwUgWEoA6gA0jJy5nNu+hUZRpvdPreM/DgE=" | ||
on: | ||
tags: true | ||
# all_branches is required to use tags | ||
all_branches: true | ||
# Only publish the build marked with "DEPLOY_TO_FORGE" | ||
condition: "$DEPLOY_TO_FORGE = yes" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,84 @@ | ||
source ENV['GEM_SOURCE'] || "https://rubygems.org" | ||
|
||
group :development, :unit_tests do | ||
gem 'rake', :require => false | ||
gem 'rspec', :require => false | ||
gem 'rspec-puppet', :require => false | ||
gem 'puppetlabs_spec_helper', :require => false | ||
gem 'metadata-json-lint', :require => false | ||
gem 'puppet-lint', :require => false | ||
gem 'puppet-lint-unquoted_string-check', :require => false | ||
gem 'puppet-lint-empty_string-check', :require => false | ||
gem 'puppet-lint-spaceship_operator_without_tag-check', :require => false | ||
gem 'puppet-lint-absolute_classname-check', :require => false | ||
gem 'puppet-lint-undef_in_function-check', :require => false | ||
gem 'puppet-lint-leading_zero-check', :require => false | ||
gem 'puppet-lint-trailing_comma-check', :require => false | ||
gem 'puppet-lint-file_ensure-check', :require => false | ||
gem 'puppet-lint-version_comparison-check', :require => false | ||
gem 'puppet-lint-file_source_rights-check', :require => false | ||
gem 'puppet-lint-alias-check', :require => false | ||
gem 'rspec-puppet-facts', :require => false | ||
gem 'ruby-augeas', :require => false | ||
gem 'puppet-blacksmith', :require => false if RUBY_VERSION !~ /^1\./ | ||
gem 'json_pure', '< 2.0.2', :require => false | ||
def location_for(place, fake_version = nil) | ||
if place =~ /^(git[:@][^#]*)#(.*)/ | ||
[fake_version, { :git => $1, :branch => $2, :require => false }].compact | ||
elsif place =~ /^file:\/\/(.*)/ | ||
['>= 0', { :path => File.expand_path($1), :require => false }] | ||
else | ||
[place, { :require => false }] | ||
end | ||
end | ||
|
||
group :test do | ||
gem 'puppetlabs_spec_helper', '~> 2.6', :require => false | ||
gem 'rspec-puppet', '~> 2.5', :require => false | ||
gem 'rspec-puppet-facts', :require => false | ||
gem 'rspec-puppet-utils', :require => false | ||
gem 'puppet-lint-leading_zero-check', :require => false | ||
gem 'puppet-lint-trailing_comma-check', :require => false | ||
gem 'puppet-lint-version_comparison-check', :require => false | ||
gem 'puppet-lint-classes_and_types_beginning_with_digits-check', :require => false | ||
gem 'puppet-lint-unquoted_string-check', :require => false | ||
gem 'puppet-lint-variable_contains_upcase', :require => false | ||
gem 'metadata-json-lint', :require => false | ||
gem 'redcarpet', :require => false | ||
gem 'rubocop', '~> 0.49.1', :require => false if RUBY_VERSION >= '2.3.0' | ||
gem 'rubocop-rspec', '~> 1.15.0', :require => false if RUBY_VERSION >= '2.3.0' | ||
gem 'mocha', '~> 1.4.0', :require => false | ||
gem 'coveralls', :require => false | ||
gem 'simplecov-console', :require => false | ||
gem 'rack', '~> 1.0', :require => false if RUBY_VERSION < '2.2.2' | ||
gem 'parallel_tests', :require => false | ||
gem 'ruby-augeas', :require => false | ||
end | ||
|
||
group :development do | ||
gem 'travis', :require => false | ||
gem 'travis-lint', :require => false | ||
gem 'guard-rake', :require => false | ||
gem 'overcommit', '>= 0.39.1', :require => false | ||
end | ||
|
||
group :system_tests do | ||
gem 'beaker', '~>3.13', :require => false | ||
gem 'beaker-rspec', '> 5', :require => false | ||
gem 'beaker_spec_helper', :require => false | ||
gem 'serverspec', :require => false | ||
gem 'specinfra', :require => false | ||
gem 'winrm', :require => false | ||
if beaker_version = ENV['BEAKER_VERSION'] | ||
gem 'beaker', *location_for(beaker_version) | ||
else | ||
gem 'beaker', '>= 3.9.0', :require => false | ||
end | ||
if beaker_rspec_version = ENV['BEAKER_RSPEC_VERSION'] | ||
gem 'beaker-rspec', *location_for(beaker_rspec_version) | ||
else | ||
gem 'beaker-rspec', :require => false | ||
end | ||
gem 'serverspec', :require => false | ||
gem 'beaker-hostgenerator', '>= 1.1.10', :require => false | ||
gem 'beaker-docker', :require => false | ||
gem 'beaker-puppet', :require => false | ||
gem 'beaker-puppet_install_helper', :require => false | ||
gem 'beaker-module_install_helper', :require => false | ||
gem 'rbnacl', '>= 4', :require => false if RUBY_VERSION >= '2.2.6' | ||
gem 'rbnacl-libsodium', :require => false if RUBY_VERSION >= '2.2.6' | ||
gem 'bcrypt_pbkdf', :require => false | ||
end | ||
|
||
group :test do | ||
gem 'ruby-augeas', :require => false | ||
group :release do | ||
gem 'github_changelog_generator', :require => false, :git => 'https://github.com/skywinder/github-changelog-generator' if RUBY_VERSION >= '2.2.2' | ||
gem 'puppet-blacksmith', :require => false | ||
gem 'voxpupuli-release', :require => false, :git => 'https://github.com/voxpupuli/voxpupuli-release-gem' | ||
gem 'puppet-strings', '>= 1.0', :require => false | ||
end | ||
|
||
|
||
|
||
if facterversion = ENV['FACTER_GEM_VERSION'] | ||
gem 'facter', facterversion, :require => false | ||
gem 'facter', facterversion.to_s, :require => false, :groups => [:test] | ||
else | ||
gem 'facter', :require => false | ||
gem 'facter', :require => false, :groups => [:test] | ||
end | ||
|
||
if puppetversion = ENV['PUPPET_GEM_VERSION'] | ||
gem 'puppet', puppetversion, :require => false | ||
else | ||
gem 'puppet', :require => false | ||
end | ||
ENV['PUPPET_VERSION'].nil? ? puppetversion = '~> 5.0' : puppetversion = ENV['PUPPET_VERSION'].to_s | ||
gem 'puppet', puppetversion, :require => false, :groups => [:test] | ||
|
||
# vim:ft=ruby | ||
# vim: syntax=ruby |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,92 @@ | ||
require 'puppetlabs_spec_helper/rake_tasks' | ||
require 'puppet-lint/tasks/puppet-lint' | ||
|
||
Rake::Task[:lint].clear | ||
PuppetLint::RakeTask.new :lint do |config| | ||
config.ignore_paths = ["spec/**/*.pp", "pkg/**/*.pp", "vendor/**/*.pp"] | ||
config.disable_checks = ['140chars'] | ||
config.fail_on_warnings = true | ||
# load optional tasks for releases | ||
# only available if gem group releases is installed | ||
begin | ||
require 'puppet_blacksmith/rake_tasks' | ||
require 'voxpupuli/release/rake_tasks' | ||
require 'puppet-strings/tasks' | ||
rescue LoadError | ||
end | ||
|
||
PuppetSyntax.exclude_paths = ["spec/fixtures/**/*.pp", "vendor/**/*"] | ||
PuppetLint.configuration.log_format = '%{path}:%{line}:%{check}:%{KIND}:%{message}' | ||
PuppetLint.configuration.fail_on_warnings = true | ||
PuppetLint.configuration.send('relative') | ||
PuppetLint.configuration.send('disable_140chars') | ||
PuppetLint.configuration.send('disable_class_inherits_from_params_class') | ||
PuppetLint.configuration.send('disable_documentation') | ||
PuppetLint.configuration.send('disable_single_quote_string_with_variables') | ||
|
||
# Publishing tasks | ||
unless RUBY_VERSION =~ /^1\./ | ||
require 'puppet_blacksmith' | ||
require 'puppet_blacksmith/rake_tasks' | ||
exclude_paths = %w( | ||
pkg/**/* | ||
vendor/**/* | ||
.vendor/**/* | ||
spec/**/* | ||
) | ||
PuppetLint.configuration.ignore_paths = exclude_paths | ||
PuppetSyntax.exclude_paths = exclude_paths | ||
|
||
desc 'Auto-correct puppet-lint offenses' | ||
task 'lint:auto_correct' do | ||
PuppetLint.configuration.fix = true | ||
Rake::Task[:lint].invoke | ||
end | ||
|
||
desc 'Run acceptance tests' | ||
RSpec::Core::RakeTask.new(:acceptance) do |t| | ||
t.pattern = 'spec/acceptance' | ||
end | ||
|
||
desc 'Run tests metadata_lint, release_checks' | ||
task test: [ | ||
:metadata_lint, | ||
:release_checks, | ||
] | ||
|
||
desc "Run main 'test' task and report merged results to coveralls" | ||
task test_with_coveralls: [:test] do | ||
if Dir.exist?(File.expand_path('../lib', __FILE__)) | ||
require 'coveralls/rake/task' | ||
Coveralls::RakeTask.new | ||
Rake::Task['coveralls:push'].invoke | ||
else | ||
puts 'Skipping reporting to coveralls. Module has no lib dir' | ||
end | ||
end | ||
|
||
desc "Print supported beaker sets" | ||
task 'beaker_sets', [:directory] do |t, args| | ||
directory = args[:directory] | ||
|
||
metadata = JSON.load(File.read('metadata.json')) | ||
|
||
(metadata['operatingsystem_support'] || []).each do |os| | ||
(os['operatingsystemrelease'] || []).each do |release| | ||
if directory | ||
beaker_set = "#{directory}/#{os['operatingsystem'].downcase}-#{release}" | ||
else | ||
beaker_set = "#{os['operatingsystem'].downcase}-#{release}-x64" | ||
end | ||
|
||
filename = "spec/acceptance/nodesets/#{beaker_set}.yml" | ||
|
||
puts beaker_set if File.exists? filename | ||
end | ||
end | ||
end | ||
|
||
begin | ||
require 'github_changelog_generator/task' | ||
GitHubChangelogGenerator::RakeTask.new :changelog do |config| | ||
version = (Blacksmith::Modulefile.new).version | ||
config.future_release = "v#{version}" if version =~ /^\d+\.\d+.\d+$/ | ||
config.header = "# Changelog\n\nAll notable changes to this project will be documented in this file.\nEach new release typically also includes the latest modulesync defaults.\nThese should not affect the functionality of the module." | ||
config.exclude_labels = %w{duplicate question invalid wontfix wont-fix modulesync skip-changelog} | ||
config.user = 'voxpupuli' | ||
metadata_json = File.join(File.dirname(__FILE__), 'metadata.json') | ||
metadata = JSON.load(File.read(metadata_json)) | ||
config.project = metadata['name'] | ||
end | ||
rescue LoadError | ||
end | ||
# vim: syntax=ruby |
Oops, something went wrong.