Project

General

Profile

« Previous | Next » 

Revision e0386421

Added by Ewoud Kohl van Wijngaarden about 4 years ago

Modulesync: use voxpupuli-acceptance 1.3

View differences:

.gitignore
pkg/
coverage/
.yardoc/
REFERENCE.md
## InteliJ / RubyMine
.idea
.puppet-lint.rc
--fail-on-warnings
--no-140chars-check
--no-class_inherits_from_params_class-check
--no-parameter_documentation-check
.sync.yml
---
.puppet-lint.rc:
extra_disabled_lint_checks:
- parameter_documentation
.travis.yml:
beaker_sets:
- centos7-64
CONTRIBUTING.md
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
-------------
Gemfile
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"]}
spec/spec_helper_acceptance.rb
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

Also available in: Unified diff