From 8cea1341f874c8d15ab7cc3b8b2a9cc28751b442 Mon Sep 17 00:00:00 2001 From: lnemsick-simp Date: Fri, 2 Feb 2018 15:34:46 -0500 Subject: [PATCH] (SIMP-4348) Move failover tests to independent suite (#63) SIMP-4348 #close --- .gitlab-ci.yml | 259 +++++++++++++----- .puppet-lint.rc | 1 - .travis.yml | 114 +++++--- Gemfile | 2 +- .../04_failover_no_tls_spec.rb | 0 .../05_failover_using_tls_spec.rb | 0 spec/acceptance/suites/failover/nodesets | 1 + 7 files changed, 260 insertions(+), 117 deletions(-) rename spec/acceptance/suites/{default => failover}/04_failover_no_tls_spec.rb (100%) rename spec/acceptance/suites/{default => failover}/05_failover_using_tls_spec.rb (100%) create mode 120000 spec/acceptance/suites/failover/nodesets diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6429999..3aff608 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,97 +1,206 @@ +# The testing matrix considers ruby/puppet versions supported by SIMP and PE: # +# https://puppet.com/docs/pe/2017.3/overview/component_versions_in_recent_pe_releases.html +# https://puppet.com/misc/puppet-enterprise-lifecycle +# https://puppet.com/docs/pe/2017.3/overview/getting_support_for_pe.html#standard-releases-and-long-term-support-releases +# ------------------------------------------------------------------------------ +# release pup ruby eol +# PE 2016.4 4.7 2.1.9 2018-10 (LTS) +# SIMP6.0.0 4.8 2.1.9 TBD +# PE 2017.2 4.10 2.1.9 2018-02-21 +# PE 2017.3 5.3 2.4.1 2018-07 +# PE 2018.1 ??? ????? ????-?? (LTS) --- -puppet-syntax: - stage: test - tags: - - docker - image: ruby:2.1 - script: - - bundle install +.cache_bundler: &cache_bundler + cache: + untracked: true + # An attempt at caching between runs (ala Travis CI) + key: "${CI_PROJECT_NAMESPACE}__bundler" + paths: + - '.vendor' + - 'vendor' + +.setup_bundler_env: &setup_bundler_env + before_script: + - '(find .vendor | wc -l) || :' + - gem install bundler --no-rdoc --no-ri + - rm -f Gemfile.lock + - rm -rf pkg/ + - bundle install --no-binstubs --jobs $(nproc) --path=.vendor "${FLAGS[@]}" + +.validation_checks: &validation_checks + script: - bundle exec rake syntax -puppet-lint: - stage: test - tags: - - docker - image: ruby:2.1 - script: - - bundle install + - bundle exec rake check:dot_underscore + - bundle exec rake check:test_file + - bundle exec rake pkg:check_version + - bundle exec rake pkg:compare_latest_tag - bundle exec rake lint -puppet-metadata: - stage: test - tags: + - bundle exec rake clean + - bundle exec puppet module build + +.spec_tests: &spec_tests + script: + - bundle exec rake spec + +stages: + - validation + - unit + - acceptance + - deploy + +# Puppet 4.7 for PE 2016.4 LTS Support (EOL: 2018-10-21) +# See: https://puppet.com/misc/puppet-enterprise-lifecycle +# -------------------------------------- +pup4.7-validation: + stage: validation + tags: - docker image: ruby:2.1 - script: - - bundle install - - bundle exec rake metadata -unit-test-ruby-2.1: - stage: test - tags: + variables: + PUPPET_VERSION: '~> 4.7.0' + <<: *cache_bundler + <<: *setup_bundler_env + <<: *validation_checks + +pup4.7-unit: + stage: unit + tags: - docker image: ruby:2.1 - script: - - bundle install - - bundle exec rake spec -unit-test-ruby-2.2: - stage: test - tags: + variables: + PUPPET_VERSION: '~> 4.7.0' + <<: *cache_bundler + <<: *setup_bundler_env + <<: *spec_tests + + +# Puppet 4.8 for SIMP 6.0 + 6.1 support +# -------------------------------------- +pup4.8-validation: + stage: validation + tags: - docker - image: ruby:2.2 - allow_failure: true - script: - - bundle install - - bundle exec rake spec -unit-test-ruby-2.3: - stage: test - tags: + image: ruby:2.1 + variables: + PUPPET_VERSION: '~> 4.8.0' + <<: *cache_bundler + <<: *setup_bundler_env + <<: *validation_checks + +pup4.8-unit: + stage: unit + tags: - docker - image: ruby:2.3 - allow_failure: true - script: - - bundle install - - bundle exec rake spec + image: ruby:2.1 + variables: + PUPPET_VERSION: '~> 4.8.0' + <<: *cache_bundler + <<: *setup_bundler_env + <<: *spec_tests -# For PE LTS Support + +# Puppet 4.10 for PE 2017.2 support (EOL:2018-02-21) # See: https://puppet.com/misc/puppet-enterprise-lifecycle -puppet4.7-syntax: - stage: test - tags: +# -------------------------------------- +pup4.10-validation: + stage: validation + tags: - docker image: ruby:2.1 - script: - - PUPPET_VERSION=4.7 bundle install - - PUPPET_VERSION=4.7 bundle exec rake syntax -unit-test-puppet4.7-ruby-2.1: - stage: test - tags: + variables: + PUPPET_VERSION: '~> 4.10.0' + <<: *cache_bundler + <<: *setup_bundler_env + <<: *validation_checks + +pup4.10-unit: + stage: unit + tags: - docker image: ruby:2.1 - script: - - PUPPET_VERSION=4.7 bundle install - - PUPPET_VERSION=4.7 bundle exec rake spec -unit-test-puppet4.7-ruby-2.2: - stage: test - tags: + variables: + PUPPET_VERSION: '~> 4.10.0' + <<: *cache_bundler + <<: *setup_bundler_env + <<: *spec_tests + + +# Puppet 5.3 for PE 2017.3 support (EOL: 2018-07) +# See: https://puppet.com/misc/puppet-enterprise-lifecycle +# -------------------------------------- +pup5.3-validation: + stage: validation + tags: + - docker + image: ruby:2.4 + variables: + PUPPET_VERSION: '~> 5.3.0' + <<: *cache_bundler + <<: *setup_bundler_env + <<: *validation_checks + +pup5.3-unit: + stage: unit + tags: - docker - image: ruby:2.2 + image: ruby:2.4 + variables: + PUPPET_VERSION: '~> 5.3.0' + <<: *cache_bundler + <<: *setup_bundler_env + <<: *spec_tests + + +# Keep an eye on the latest puppet 5 +# ---------------------------------- +pup5.latest-validation: + stage: validation + tags: + - docker + image: ruby:2.4 + variables: + PUPPET_VERSION: '~> 5.0' + <<: *cache_bundler + <<: *setup_bundler_env + <<: *validation_checks allow_failure: true - script: - - PUPPET_VERSION=4.7 bundle install - - PUPPET_VERSION=4.7 bundle exec rake spec -unit-test-puppet4.7-ruby-2.3: - stage: test - tags: + +pup5.latest-unit: + stage: unit + tags: - docker - image: ruby:2.3 + image: ruby:2.4 + variables: + PUPPET_VERSION: '~> 5.0' + <<: *cache_bundler + <<: *setup_bundler_env + <<: *spec_tests allow_failure: true - script: - - PUPPET_VERSION=4.7 bundle install - - PUPPET_VERSION=4.7 bundle exec rake spec -acceptance-test: - stage: test - tags: + + +# Acceptance tests +# ============================================================================== +acceptance-default: + stage: acceptance + tags: + - beaker + <<: *cache_bundler + <<: *setup_bundler_env + variables: + PUPPET_VERSION: '4.10' + script: + - bundle exec rake beaker:suites[default] + +acceptance-fips-default: + stage: acceptance + tags: - beaker - script: - - bundle install --no-binstubs --path=vendor - - bundle exec rake acceptance + <<: *cache_bundler + <<: *setup_bundler_env + variables: + PUPPET_VERSION: '4.10' + BEAKER_fips: 'yes' + script: + - bundle exec rake beaker:suites[default] diff --git a/.puppet-lint.rc b/.puppet-lint.rc index 2415788..e33c93d 100644 --- a/.puppet-lint.rc +++ b/.puppet-lint.rc @@ -2,7 +2,6 @@ --relative --no-class_inherits_from_params_class-check --no-140chars-check ---no-empty_string-check --no-trailing_comma-check # This is here because the code can't handle lookups in parameters and we have # a LOT of those diff --git a/.travis.yml b/.travis.yml index 70c9127..68e2a7a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,48 +8,82 @@ # PE 2017.2 4.10 2.1.9 TBD --- language: ruby -sudo: false cache: bundler -before_script: - - bundle update +sudo: false + bundler_args: --without development system_tests --path .vendor -before_install: rm Gemfile.lock || true -script: - - bundle exec rake test + notifications: email: false -rvm: - - 2.1.9 -env: - global: - - STRICT_VARIABLES=yes - matrix: - - PUPPET_VERSION="~> 4.8.2" FORGE_PUBLISH=true - - PUPPET_VERSION="~> 4.10.0" - - PUPPET_VERSION="~> 4.9.2" - - PUPPET_VERSION="~> 4.7.0" -matrix: - fast_finish: true - -before_deploy: - - 'bundle exec rake metadata_lint' - - 'bundle exec rake clobber' - - 'bundle exec rake spec_clean' - - "export PUPMOD_METADATA_VERSION=`ruby -r json -e \"puts JSON.parse(File.read('metadata.json')).fetch('version')\"`" - - '[[ $TRAVIS_TAG =~ ^simp-${PUPMOD_METADATA_VERSION}$|^${PUPMOD_METADATA_VERSION}$ ]]' -deploy: - - provider: puppetforge - user: simp - password: - secure: "dLEr1qGxxo9+sR1LKnj8LD8jrYmNKiKkQr+6Us/O4vzL4z4JO1F8Hta9J9wunVbjsuwyZa7gmHEBObOxcmnKJKqwoHofIQVxdbd5R0xl5nfd2WCx7/m6yocU5ZEbn/toxNYw9J61Mts99L3iFTg2Stjkn20agTmkt6T7HUQOCdachs46EZ/cAOGUNxqM013Vk/EgVT0FFYkMda6KbIZ7GOjuToCH8/YgYhl3xZr1R+GKLlXqUV3Yvokc3Xi7DTmVr85q4FoLQoS85tEjfwtBuuLD1DX003QM66IJDca2ZgD+FMIrGxtOQs6Md1hPiMlO4qNzyGf6N9e1v5LgxzcLLsZ6cndEXZJ/hCGBV6AlsIObvjjyuK0qAv2/ztoDOZKfJFRZU4hGEcaYVdC/oJY8M8sNnNLapleForM3mtX3v6H+fgHQtI3wtYWeZvCuEkP76qt9VxKD03X70JgDu34tXtxwm/eQF0Aj0+/SaUS/gQbF0o9wPBnV9/4Q32ERC/r3qPp4MzGsifMdsy80SUxiVtYaJDESbDLcS9eg46MwvcpsVje5U17ldA1fCRZW5rQ0feb7bUqfUAbeAmg9E0wJrzcY4zrdSzq7SqtteaDtTMfQnstVe3kvw4eLEWYULoELo+BV6JelMtqGBvKWtjhsqmuq1DnAqoDqKKnH46HF73I=" - on: - tags: true + +addons: + apt: + packages: + - rpm + +before_install: + - rm -f Gemfile.lock + +jobs: + include: + - stage: check + rvm: 2.4.1 + env: STRICT_VARIABLES=yes TRUSTED_NODE_DATA=yes PUPPET_VERSION="~> 5" + script: + - bundle exec rake check:dot_underscore + - bundle exec rake check:test_file + - bundle exec rake pkg:check_version + - bundle exec rake metadata_lint + - bundle exec rake pkg:compare_latest_tag + - bundle exec rake pkg:create_tag_changelog + - bundle exec rake lint + - bundle exec puppet module build + + - stage: spec + rvm: 2.4.1 + env: STRICT_VARIABLES=yes TRUSTED_NODE_DATA=yes PUPPET_VERSION="~> 5.0" + script: + - bundle exec rake spec + + - stage: spec + rvm: 2.1.9 + env: STRICT_VARIABLES=yes TRUSTED_NODE_DATA=yes PUPPET_VERSION="~> 4.10.0" + script: + - bundle exec rake spec + + - stage: spec rvm: 2.1.9 - condition: '($SKIP_FORGE_PUBLISH != true) && ($FORGE_PUBLISH = true)' - - provider: releases - api_key: - secure: "dR4a+xv4QGE7V1vruZ/4eGKNzUEXgGTNI3XPszCIjzZ7+AdE2rpwl53edMZ7M8u6//hYoSMhGng11zkq8Pez47NlyJ5wXLqhqQklGj4KJ0VzXOpl4FL8MkgOk09EwJ5V2gS+UtSy7/koau1VLHZRdr5lXHhAcQW/KTkJAS/Br4hvqwfmokkONaRtSbaMN9xOIm/BEzWxq29IC3QP0Yjsjp0NZOlFDRQwGO55PJVieU/4clqiS+t3aNMYQx90df+HLXYe875M+dmCK9cHVHM0IQtCeHASRNPqBcvaEGCpbKO47+54PDnNAF4IBGxfR+tC7o6AbgS8ve41pbX2bjCYMvIV6wwpx7+Fv04i9ahqdguFdh+9Y2UcCsmwCB1xP0N5qGlg2ot4z8Q/EWuKYcg3x8LcNqepuKvQ8uKyk5WuMw/mDxLdCsaH1JrhsvcqxegBjUEGNs35aSWa6a67ifHzbJb1HPHBvvujHWVn0YDur/F2ZKoFQyJqr9WYRMem0GvUASEqST29HExfIM2IG4/AQN//DCT7aqKBZRGuw9OHoWQiTDoOIJkZXKWDTgFCYv4OD/utYb8x8xA7FF5zLxh4NZiHUoAPtK3FQ1XS9VRbrtuYAGsILwI95o2sGbDAPp2K04cVofv5IbO5Va7w5ms/noynpb14ZKnO6BjdRjDFaco=" - skip_cleanup: true - on: - tags: true - condition: '($SKIP_FORGE_PUBLISH != true) && ($FORGE_PUBLISH = true)' + env: STRICT_VARIABLES=yes TRUSTED_NODE_DATA=yes PUPPET_VERSION="~> 4.9.2" + script: + - bundle exec rake spec + + - stage: spec + rvm: 2.1.9 + env: STRICT_VARIABLES=yes TRUSTED_NODE_DATA=yes PUPPET_VERSION="~> 4.7.0" + script: + - bundle exec rake spec + + - stage: deploy + rvm: 2.4.1 + script: + - true + before_deploy: + - "export PUPMOD_METADATA_VERSION=`ruby -r json -e \"puts JSON.parse(File.read('metadata.json')).fetch('version')\"`" + - '[[ $TRAVIS_TAG =~ ^simp-${PUPMOD_METADATA_VERSION}$|^${PUPMOD_METADATA_VERSION}$ ]]' + + deploy: + - provider: releases + api_key: + secure: "dR4a+xv4QGE7V1vruZ/4eGKNzUEXgGTNI3XPszCIjzZ7+AdE2rpwl53edMZ7M8u6//hYoSMhGng11zkq8Pez47NlyJ5wXLqhqQklGj4KJ0VzXOpl4FL8MkgOk09EwJ5V2gS+UtSy7/koau1VLHZRdr5lXHhAcQW/KTkJAS/Br4hvqwfmokkONaRtSbaMN9xOIm/BEzWxq29IC3QP0Yjsjp0NZOlFDRQwGO55PJVieU/4clqiS+t3aNMYQx90df+HLXYe875M+dmCK9cHVHM0IQtCeHASRNPqBcvaEGCpbKO47+54PDnNAF4IBGxfR+tC7o6AbgS8ve41pbX2bjCYMvIV6wwpx7+Fv04i9ahqdguFdh+9Y2UcCsmwCB1xP0N5qGlg2ot4z8Q/EWuKYcg3x8LcNqepuKvQ8uKyk5WuMw/mDxLdCsaH1JrhsvcqxegBjUEGNs35aSWa6a67ifHzbJb1HPHBvvujHWVn0YDur/F2ZKoFQyJqr9WYRMem0GvUASEqST29HExfIM2IG4/AQN//DCT7aqKBZRGuw9OHoWQiTDoOIJkZXKWDTgFCYv4OD/utYb8x8xA7FF5zLxh4NZiHUoAPtK3FQ1XS9VRbrtuYAGsILwI95o2sGbDAPp2K04cVofv5IbO5Va7w5ms/noynpb14ZKnO6BjdRjDFaco=" + skip_cleanup: true + on: + tags: true + condition: '($SKIP_FORGE_PUBLISH != true)' + - provider: puppetforge + user: simp + password: + secure: "dLEr1qGxxo9+sR1LKnj8LD8jrYmNKiKkQr+6Us/O4vzL4z4JO1F8Hta9J9wunVbjsuwyZa7gmHEBObOxcmnKJKqwoHofIQVxdbd5R0xl5nfd2WCx7/m6yocU5ZEbn/toxNYw9J61Mts99L3iFTg2Stjkn20agTmkt6T7HUQOCdachs46EZ/cAOGUNxqM013Vk/EgVT0FFYkMda6KbIZ7GOjuToCH8/YgYhl3xZr1R+GKLlXqUV3Yvokc3Xi7DTmVr85q4FoLQoS85tEjfwtBuuLD1DX003QM66IJDca2ZgD+FMIrGxtOQs6Md1hPiMlO4qNzyGf6N9e1v5LgxzcLLsZ6cndEXZJ/hCGBV6AlsIObvjjyuK0qAv2/ztoDOZKfJFRZU4hGEcaYVdC/oJY8M8sNnNLapleForM3mtX3v6H+fgHQtI3wtYWeZvCuEkP76qt9VxKD03X70JgDu34tXtxwm/eQF0Aj0+/SaUS/gQbF0o9wPBnV9/4Q32ERC/r3qPp4MzGsifMdsy80SUxiVtYaJDESbDLcS9eg46MwvcpsVje5U17ldA1fCRZW5rQ0feb7bUqfUAbeAmg9E0wJrzcY4zrdSzq7SqtteaDtTMfQnstVe3kvw4eLEWYULoELo+BV6JelMtqGBvKWtjhsqmuq1DnAqoDqKKnH46HF73I=" + on: + tags: true + rvm: 2.4.1 + condition: '($SKIP_FORGE_PUBLISH != true)' diff --git a/Gemfile b/Gemfile index cc07236..38b87b8 100644 --- a/Gemfile +++ b/Gemfile @@ -17,7 +17,7 @@ group :test do gem 'puppet-lint-empty_string-check', :require => false gem 'puppet-lint-trailing_comma-check', :require => false gem 'simp-rspec-puppet-facts', ENV.fetch('SIMP_RSPEC_PUPPET_FACTS_VERSION', '~> 2.0') - gem 'simp-rake-helpers', ENV.fetch('SIMP_RAKE_HELPERS_VERSION', '~> 4.0') + gem 'simp-rake-helpers', ENV.fetch('SIMP_RAKE_HELPERS_VERSION', ['>= 5.2', '< 6.0']) end group :development do diff --git a/spec/acceptance/suites/default/04_failover_no_tls_spec.rb b/spec/acceptance/suites/failover/04_failover_no_tls_spec.rb similarity index 100% rename from spec/acceptance/suites/default/04_failover_no_tls_spec.rb rename to spec/acceptance/suites/failover/04_failover_no_tls_spec.rb diff --git a/spec/acceptance/suites/default/05_failover_using_tls_spec.rb b/spec/acceptance/suites/failover/05_failover_using_tls_spec.rb similarity index 100% rename from spec/acceptance/suites/default/05_failover_using_tls_spec.rb rename to spec/acceptance/suites/failover/05_failover_using_tls_spec.rb diff --git a/spec/acceptance/suites/failover/nodesets b/spec/acceptance/suites/failover/nodesets new file mode 120000 index 0000000..f2ea7de --- /dev/null +++ b/spec/acceptance/suites/failover/nodesets @@ -0,0 +1 @@ +../../nodesets/ \ No newline at end of file