Skip to content

Commit bc9f88e

Browse files
committed
normalize common files
1 parent 50e1ce1 commit bc9f88e

14 files changed

+440
-84
lines changed

.sync.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
---
22
.travis.yml:
3-
hc_secure: "aWQzE9dBdTs2zGrCq8q13FYrB9KuNtJQ0VlWcJVOEf+6qhwWPMu5aKwYKZQcrIswFxGHytIjPuvNf8AAHzfXvtFHPWSURnrRDISlXiCha+B4Opf3BhDFEzK2H7c5JMXhyzYxZJ8iKzBMWipr9UGWm+VsoWLSKsan4qlLcb+V2Gc="
3+
hc_secure: "O4brQNu9Hk4IUfgaNU+R8QWe0A/5ucmEBzTPX3kzrCXALHP1f4opc3MgIFzPohc/O9Y64oNcV/TZk2Bwy1mUunxCubfQfF4G1VoE0yQc/z7qOBOrYPvOU2S5srcrbwyg7zBt1H0dXKoDvgoW4fSTz4LMv3ahIlYZYmgmaeZioE4="
44

.travis.yml

+25-39
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,33 @@
1+
---
12
language: ruby
2-
bundler_args: --without development
3-
script: "bundle exec rake spec SPEC_OPTS='--format documentation'"
4-
rvm:
5-
- 1.8.7
6-
- 1.9.3
7-
- 2.0.0
8-
- 2.1.0
9-
script:
10-
- "rake lint"
11-
- "rake spec SPEC_OPTS='--format documentation'"
12-
- "rake syntax"
13-
env:
14-
- PUPPET_VERSION="~> 2.7.0"
15-
- PUPPET_VERSION="~> 3.1.0"
16-
- PUPPET_VERSION="~> 3.2.0"
17-
- PUPPET_VERSION="~> 3.3.0"
18-
- PUPPET_VERSION="~> 3.4.0"
19-
- PUPPET_VERSION="~> 3.5.0"
20-
- PUPPET_VERSION="~> 3.6.0"
3+
cache: bundler
4+
bundler_args: --without system_tests development
5+
script: "bundle exec rake validate && bundle exec rake test SPEC_OPTS='--format documentation'"
6+
sudo: false
217
matrix:
22-
exclude:
23-
- rvm: 1.9.3
24-
env: PUPPET_VERSION="~> 2.7.0"
25-
- rvm: 2.0.0
26-
env: PUPPET_VERSION="~> 2.7.0"
27-
- rvm: 2.0.0
28-
env: PUPPET_VERSION="~> 3.1.0"
29-
- rvm: 2.1.0
30-
env: PUPPET_VERSION="~> 2.7.0"
31-
- rvm: 2.1.0
32-
env: PUPPET_VERSION="~> 3.0.0"
33-
- rvm: 2.1.0
34-
env: PUPPET_VERSION="~> 3.1.0"
35-
- rvm: 2.1.0
36-
env: PUPPET_VERSION="~> 3.2.0"
37-
- rvm: 2.1.0
38-
env: PUPPET_VERSION="~> 3.3.0"
39-
- rvm: 2.1.0
40-
env: PUPPET_VERSION="~> 3.4.0"
8+
fast_finish: true
9+
include:
10+
- rvm: 1.8.7
11+
env: PUPPET_GEM_VERSION="~> 3.3.0"
12+
- rvm: 1.8.7
13+
env: PUPPET_GEM_VERSION="~> 3.0" FUTURE_PARSER="yes"
14+
- rvm: 1.9.3
15+
env: PUPPET_GEM_VERSION="~> 3.3.0"
16+
- rvm: 1.9.3
17+
env: PUPPET_GEM_VERSION="~> 3.0" FUTURE_PARSER="yes"
18+
- rvm: 2.0.0
19+
env: PUPPET_GEM_VERSION="~> 3.3.0"
20+
- rvm: 2.0.0
21+
env: PUPPET_GEM_VERSION="~> 3.0" FUTURE_PARSER="yes"
22+
- rvm: 2.1.0
23+
env: PUPPET_GEM_VERSION="~> 3.0" FUTURE_PARSER="yes"
4124
notifications:
4225
email: false
4326
hipchat:
4427
rooms:
45-
- secure: "dpF/KF4dTsYh2tkBpxCg5jCYSie+ge+IsUAcwiCfqdVGOqFs8LyaJvHzObVA\naF6up/OFLjRtt979ht9dgUZUHEvbZk0iQpbojSRng8CWJUNobXVE1cLh1HKg\nkTh9NlUu1hu0Eyk139OMZo1bC4nmN83yCBnclymgWnNaT43FttA="
28+
- secure: O4brQNu9Hk4IUfgaNU+R8QWe0A/5ucmEBzTPX3kzrCXALHP1f4opc3MgIFzPohc/O9Y64oNcV/TZk2Bwy1mUunxCubfQfF4G1VoE0yQc/z7qOBOrYPvOU2S5srcrbwyg7zBt1H0dXKoDvgoW4fSTz4LMv3ahIlYZYmgmaeZioE4=
29+
template:
30+
- '%{repository}#%{build_number} (%{branch} - %{commit} : %{author}): %{message} (<a href="%{build_url}">Details</a>/<a href="%{compare_url}">Change view</a>)'
31+
format: html
4632
on_success: always
4733
on_failure: always

CHANGELOG

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
20150408 - v0.1.0:
2+
Initial release

CONTRIBUTING.md

+90
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
This module has grown over time based on a range of contributions from
2+
people using it. If you follow these contributing guidelines your patch
3+
will likely make it into a release a little quicker.
4+
5+
6+
## Contributing
7+
8+
1. Fork the repo.
9+
10+
2. Run the tests. We only take pull requests with passing tests, and
11+
it's great to know that you have a clean slate
12+
13+
3. Add a test for your change. Only refactoring and documentation
14+
changes require no new tests. If you are adding functionality
15+
or fixing a bug, please add a test.
16+
17+
4. Make the test pass.
18+
19+
5. Push to your fork and submit a pull request.
20+
21+
22+
## Dependencies
23+
24+
The testing and development tools have a bunch of dependencies,
25+
all managed by [bundler](http://bundler.io/) according to the
26+
[Puppet support matrix](http://docs.puppetlabs.com/guides/platforms.html#ruby-versions).
27+
28+
By default the tests use a baseline version of Puppet.
29+
30+
If you have Ruby 2.x or want a specific version of Puppet,
31+
you must set an environment variable such as:
32+
33+
export PUPPET_VERSION="~> 3.2.0"
34+
35+
Install the dependencies like so...
36+
37+
bundle install
38+
39+
## Syntax and style
40+
41+
The test suite will run [Puppet Lint](http://puppet-lint.com/) and
42+
[Puppet Syntax](https://github.com/gds-operations/puppet-syntax) to
43+
check various syntax and style things. You can run these locally with:
44+
45+
bundle exec rake lint
46+
bundle exec rake syntax
47+
48+
## Running the unit tests
49+
50+
The unit test suite covers most of the code, as mentioned above please
51+
add tests if you're adding new functionality. If you've not used
52+
[rspec-puppet](http://rspec-puppet.com/) before then feel free to ask
53+
about how best to test your new feature. Running the test suite is done
54+
with:
55+
56+
bundle exec rake spec
57+
58+
Note also you can run the syntax, style and unit tests in one go with:
59+
60+
bundle exec rake test
61+
62+
## Automatically run the Integration tests
63+
64+
During development of your puppet module you might want to run your unit tests a couple of times. You can use the following command to automate running the unit tests on every change made in the manifests folder.
65+
66+
bundle exec guard
67+
68+
## Integration tests
69+
70+
The unit tests just check the code runs, not that it does exactly what
71+
we want on a real machine. For that we're using
72+
[beaker](https://github.com/puppetlabs/beaker).
73+
74+
This fires up a new virtual machine (using vagrant) and runs a series of
75+
simple tests against it after applying the module. You can run this
76+
with:
77+
78+
bundle exec rake acceptance
79+
80+
This will run the tests on an CentOS 7.0 virtual machine. You can also
81+
run the integration tests against Centos 6.5 with. A list of all configured
82+
nodesets is in spec/acceptance/nodeset.
83+
84+
BEAKER_SET=centos-65-x64 bundle exec rake acceptance
85+
86+
If you don't want to have to recreate the virtual machine every time you
87+
can use `BEAKER_DESTROY=no` and `BEAKER_PROVISION=no`. On the first run you will
88+
at least need `BEAKER_PROVISION` set to yes (the default). The Vagrantfile
89+
for the created virtual machines will be in `.vagrant/beaker_vagrant_files`.
90+

Guardfile

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
notification :off
2+
3+
guard 'rake', :task => 'test' do
4+
watch(%r{^manifests\/(.+)\.pp$})
5+
watch(%r{^spec\/classes\/(.+)\.rb$})
6+
watch(%r{^spec\/defines\/(.+)\.rb$})
7+
end

0 commit comments

Comments
 (0)