From ad11bab8dd9ae161c20dbc9034014dc757a87491 Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Thu, 16 Apr 2020 19:11:39 +0200 Subject: [PATCH] Modulesync: require voxpupuli-test 1.3 Follow up on 01d1ede67a89dd3d8e0a2f4edcd9f2de3971735a. This currently ignores parameter documentation because view and zone are missing parameters. --- .gitignore | 1 + .puppet-lint.rc | 1 + .sync.yml | 3 +++ CONTRIBUTING.md | 30 ++++++++++++++++++++++++++---- Gemfile | 2 +- spec/spec_helper_acceptance.rb | 9 +++++---- 6 files changed, 37 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index d5038650..77892f5c 100644 --- a/.gitignore +++ b/.gitignore @@ -36,6 +36,7 @@ junit/ pkg/ coverage/ .yardoc/ +REFERENCE.md ## InteliJ / RubyMine .idea diff --git a/.puppet-lint.rc b/.puppet-lint.rc index a1f1fb10..e069c555 100644 --- a/.puppet-lint.rc +++ b/.puppet-lint.rc @@ -1,3 +1,4 @@ --fail-on-warnings --no-140chars-check --no-class_inherits_from_params_class-check +--no-parameter_documentation-check diff --git a/.sync.yml b/.sync.yml index 24b98bba..32085245 100644 --- a/.sync.yml +++ b/.sync.yml @@ -1,4 +1,7 @@ --- +.puppet-lint.rc: + extra_disabled_lint_checks: + - parameter_documentation .travis.yml: beaker_sets: - centos6-64 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 64a434ad..0f6b9552 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -178,12 +178,34 @@ With all dependencies in place and up-to-date we can now run the tests: rake spec ``` -This will execute all the [rspec tests](http://rspec-puppet.com/) tests -under [spec/defines](./spec/defines), [spec/classes](./spec/classes), -and so on. rspec tests may have the same kind of dependencies as the -module they are testing. While the module defines in its [Modulefile](./Modulefile), +This will execute all the [rspec tests](http://rspec-puppet.com/) tests under +[spec/defines](./spec/defines), [spec/classes](./spec/classes), and so on. +rspec tests may have the same kind of dependencies as the module they are +testing. While the module defines in its [metadata.json](./metadata.json), rspec tests define them in [.fixtures.yml](./fixtures.yml). +To run specific tests, use the spec test file name and a filter like: + +```shell +bundle exec rspec spec/classes/foreman_spec.rb -e 'should restart passenger' +``` +More filter info available [here](https://relishapp.com/rspec/rspec-core/v/3-9/docs/command-line/example-option) + +To run OS specific tests: + +```shell +SPEC_FACTS_OS=redhat-7-x86_64 bundle exec rspec spec/classes/foreman_spec.rb +``` + +If you have more than one version of `redhat` OS specified in metadata.json, +you can run them all like: + +```shell +SPEC_FACTS_OS=redhat bundle exec rspec spec/classes/foreman_spec.rb +``` +For more information on running the tests, see [rspec-puppet-facts](https://github.com/mcanevet/rspec-puppet-facts) +and specifically the [section for running tests](https://github.com/mcanevet/rspec-puppet-facts#running-your-tests). + Writing Tests ------------- diff --git a/Gemfile b/Gemfile index 229015b2..03d42c47 100644 --- a/Gemfile +++ b/Gemfile @@ -12,7 +12,7 @@ gem 'puppet-lint-param-docs', '>= 1.3.0' gem 'puppet-lint-spaceship_operator_without_tag-check' gem 'puppet-lint-strict_indent-check' gem 'puppet-lint-undef_in_function-check' -gem 'voxpupuli-test', '~> 1.0' +gem 'voxpupuli-test', '~> 1.3' gem 'github_changelog_generator', '>= 1.15.0', {"groups"=>["development"]} gem 'puppet-blacksmith', '>= 4.1.0', {"groups"=>["development"]} gem 'voxpupuli-acceptance', '~> 0.1', {"groups"=>["system_tests"]} diff --git a/spec/spec_helper_acceptance.rb b/spec/spec_helper_acceptance.rb index ffe05338..ba8aa63f 100644 --- a/spec/spec_helper_acceptance.rb +++ b/spec/spec_helper_acceptance.rb @@ -11,11 +11,12 @@ end # refresh check if cache needs refresh on next yum command on host, 'yum clean expire-cache' + end - # this is absent in the el8 container images used for testing - if fact_on(host, 'os.release.major') == '8' - on host, puppet('resource', 'package', 'glibc-langpack-en', 'ensure=installed') - end + local_setup = File.join(__dir__, 'setup_acceptance_node.pp') + if File.exist?(local_setup) + puts "Configuring #{host} by applying #{local_setup}" + apply_manifest_on(host, File.read(local_setup), catch_failures: true) end end