Skip to content

Commit 5c2e385

Browse files
authored
Merge pull request #117 from voxpupuli/modulesync
modulesync 0.21.0
2 parents 3f4573c + 541f285 commit 5c2e385

File tree

14 files changed

+130
-18
lines changed

14 files changed

+130
-18
lines changed

.github/CONTRIBUTING.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,3 +98,7 @@ If you don't want to have to recreate the virtual machine every time you
9898
can use `BEAKER_DESTROY=no` and `BEAKER_PROVISION=no`. On the first run you will
9999
at least need `BEAKER_PROVISION` set to yes (the default). The Vagrantfile
100100
for the created virtual machines will be in `.vagrant/beaker_vagrant_fies`.
101+
102+
The easiest way to debug in a docker container is to open a shell:
103+
104+
docker exec -it -u root ${container_id_or_name} bash

.msync.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
modulesync_config_version: '0.20.1'
1+
modulesync_config_version: '0.21.0'

.overcommit.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Managed by https://github.com/voxpupuli/modulesync_configs
2+
#
3+
# Hooks are only enabled if you take action.
4+
#
5+
# To enable the hooks run:
6+
#
7+
# ```
8+
# bundle exec overcommit --install
9+
# # ensure .overcommit.yml does not harm to you and then
10+
# bundle exec overcommit --sign
11+
# ```
12+
#
13+
# (it will manage the .git/hooks directory):
14+
#
15+
# Examples howto skip a test for a commit or push:
16+
#
17+
# ```
18+
# SKIP=RuboCop git commit
19+
# SKIP=PuppetLint git commit
20+
# SKIP=RakeTask git push
21+
# ```
22+
#
23+
# Don't invoke overcommit at all:
24+
#
25+
# ```
26+
# OVERCOMMIT_DISABLE=1 git commit
27+
# ```
28+
#
29+
# Read more about overcommit: https://github.com/brigade/overcommit
30+
#
31+
# To manage this config yourself in your module add
32+
#
33+
# ```
34+
# .overcommit.yml:
35+
# unmanaged: true
36+
# ```
37+
#
38+
# to your modules .sync.yml config
39+
---
40+
PreCommit:
41+
RuboCop:
42+
enabled: true
43+
description: 'Runs rubocop on modified files only'
44+
command: ['bundle', 'exec', 'rubocop']
45+
PuppetLint:
46+
enabled: true
47+
description: 'Runs puppet-lint on modified files only'
48+
command: ['bundle', 'exec', 'puppet-lint']
49+
YamlSyntax:
50+
enabled: true
51+
JsonSyntax:
52+
enabled: true
53+
TrailingWhitespace:
54+
enabled: true
55+
56+
PrePush:
57+
RakeTarget:
58+
enabled: true
59+
description: 'Run rake targets'
60+
targets:
61+
- 'test'
62+
- 'rubocop'
63+
command: [ 'bundle', 'exec', 'rake' ]

.rubocop.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ AllCops:
99
- .vendor/**/*
1010
- pkg/**/*
1111
- spec/fixtures/**/*
12+
- Gemfile
13+
- Rakefile
1214
Lint/ConditionPosition:
1315
Enabled: True
1416

.travis.yml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ sudo: false
33
dist: trusty
44
language: ruby
55
cache: bundler
6-
bundler_args: --without system_tests development
76
before_install:
87
- bundle -v
98
- rm Gemfile.lock || true
@@ -17,27 +16,33 @@ matrix:
1716
fast_finish: true
1817
include:
1918
- rvm: 2.1.9
19+
bundler_args: --without system_tests development
2020
env: PUPPET_VERSION="~> 4.0" CHECK=test
21-
- rvm: 2.2.6
21+
- rvm: 2.2.7
22+
bundler_args: --without system_tests development
2223
env: PUPPET_VERSION="~> 4.0" CHECK=test
23-
- rvm: 2.3.3
24+
- rvm: 2.3.4
25+
bundler_args: --without system_tests development
2426
env: PUPPET_VERSION="~> 4.0" CHECK=test
25-
- rvm: 2.4.0
27+
- rvm: 2.4.1
28+
bundler_args: --without system_tests development
2629
env: PUPPET_VERSION="~> 4.0" CHECK=test
27-
- rvm: 2.4.0
30+
- rvm: 2.4.1
31+
bundler_args: --without system_tests development
2832
env: PUPPET_VERSION="~> 4.0" CHECK=rubocop
29-
- rvm: 2.4.0
33+
- rvm: 2.4.1
34+
bundler_args: --without system_tests development
3035
env: PUPPET_VERSION="~> 4.0" CHECK=build DEPLOY_TO_FORGE=yes
3136
- rvm: 2.4.0
37+
bundler_args: --without development
3238
env: PUPPET_VERSION="~> 4.0" CHECK=acceptance BEAKER_set="docker/debian-8" bundle exec rake acceptance
3339
services: docker
3440
sudo: required
35-
bundler_args: --without development
3641
- rvm: 2.4.0
42+
bundler_args: --without development
3743
env: PUPPET_VERSION="~> 4.0" CHECK=acceptance BEAKER_set="docker/centos-7" bundle exec rake acceptance
3844
services: docker
3945
sudo: required
40-
bundler_args: --without development
4146
branches:
4247
only:
4348
- master

Gemfile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ def location_for(place, fake_version = nil)
1111
end
1212

1313
group :test do
14-
gem 'puppetlabs_spec_helper', '~> 2.0.1', :require => false
15-
gem 'parallel_tests', :require => false
14+
gem 'puppetlabs_spec_helper', '~> 2.1.1', :require => false
1615
gem 'rspec-puppet', '~> 2.5', :require => false
1716
gem 'rspec-puppet-facts', :require => false
1817
gem 'rspec-puppet-utils', :require => false
@@ -26,10 +25,10 @@ group :test do
2625
gem 'metadata-json-lint', :require => false
2726
gem 'puppet-blacksmith', :require => false
2827
gem 'voxpupuli-release', :require => false, :git => 'https://github.com/voxpupuli/voxpupuli-release-gem.git'
29-
gem 'puppet-strings', '~> 1.0.0', :require => false
28+
gem 'puppet-strings', '~> 1.0', :require => false
3029
gem 'redcarpet', :require => false
31-
gem 'rubocop', '~> 0.47.0', :require => false if RUBY_VERSION >= '2.3.0'
32-
gem 'rubocop-rspec', '~> 1.10.0', :require => false if RUBY_VERSION >= '2.3.0'
30+
gem 'rubocop', '~> 0.48.0', :require => false if RUBY_VERSION >= '2.3.0'
31+
gem 'rubocop-rspec', '~> 1.15.0', :require => false if RUBY_VERSION >= '2.3.0'
3332
gem 'mocha', '>= 1.2.1', :require => false
3433
gem 'coveralls', :require => false
3534
gem 'simplecov-console', :require => false
@@ -39,9 +38,10 @@ group :test do
3938
end
4039

4140
group :development do
42-
gem 'travis', :require => false
43-
gem 'travis-lint', :require => false
44-
gem 'guard-rake', :require => false
41+
gem 'travis', :require => false
42+
gem 'travis-lint', :require => false
43+
gem 'guard-rake', :require => false
44+
gem 'overcommit', '~> 0.39.1', :require => false
4545
end
4646

4747
group :system_tests do

spec/classes/client_spec.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
let(:facts) do
77
facts
88
end
9+
910
case facts[:osfamily]
1011
when 'Redhat'
1112
context 'with all defaults' do
@@ -25,6 +26,7 @@
2526
version: '3.6.1'
2627
}
2728
end
29+
2830
it 'includes gluster::install with version 3.6.1' do
2931
is_expected.to create_class('gluster::install').with(
3032
repo: true,
@@ -39,6 +41,7 @@
3941
repo: false
4042
}
4143
end
44+
4245
it 'includes gluster::install with repo=>false' do
4346
is_expected.to create_class('gluster::install').with(
4447
repo: false,
@@ -65,6 +68,7 @@
6568
version: '3.6.1'
6669
}
6770
end
71+
6872
it 'includes gluster::install with version 3.6.1' do
6973
is_expected.to create_class('gluster::install').with(
7074
repo: true,
@@ -79,6 +83,7 @@
7983
repo: false
8084
}
8185
end
86+
8287
it 'includes gluster::install with repo=>false' do
8388
is_expected.to create_class('gluster::install').with(
8489
repo: false,

spec/classes/init_spec.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
let(:facts) do
77
facts
88
end
9+
910
case facts[:osfamily]
1011
when 'Redhat'
1112
context 'with all defaults' do
@@ -42,6 +43,7 @@
4243
repo: false
4344
}
4445
end
46+
4547
it 'creates gluster::install' do
4648
is_expected.to create_class('gluster::install').with(
4749
server: true,
@@ -97,6 +99,7 @@
9799
repo: false
98100
}
99101
end
102+
100103
it 'creates gluster::install' do
101104
is_expected.to create_class('gluster::install').with(
102105
server: true,
@@ -139,6 +142,7 @@
139142
}
140143
}
141144
end
145+
142146
it 'creates gluster::volume' do
143147
is_expected.to contain_gluster__volume('data1').with(
144148
name: 'data1',
@@ -152,9 +156,10 @@
152156
context 'when volumes incorrectly defined' do
153157
let :params do
154158
{
155-
volumes: { 'data1' => %w(this is an array) }
159+
volumes: { 'data1' => %w[this is an array] }
156160
}
157161
end
162+
158163
it 'fails' do
159164
expect do
160165
is_expected.to contain_gluster__volume('data1')

spec/classes/install_spec.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
let :pre_condition do
1010
'require ::gluster::service'
1111
end
12+
1213
context 'with defaults' do
1314
it { is_expected.to compile.with_all_deps }
1415
case facts[:osfamily]
@@ -28,12 +29,14 @@
2829
let :params do
2930
{ repo: false }
3031
end
32+
3133
it { is_expected.not_to create_class('gluster::repo') }
3234
end
3335
context 'when client is false' do
3436
let :params do
3537
{ client: false }
3638
end
39+
3740
case facts[:osfamily]
3841
when 'Redhat'
3942
it { is_expected.not_to create_package('glusterfs-fuse') }
@@ -45,6 +48,7 @@
4548
let :params do
4649
{ server: false }
4750
end
51+
4852
case facts[:osfamily]
4953
when 'Redhat', 'Debian'
5054
it { is_expected.not_to create_package('glusterfs-server') }
@@ -56,6 +60,7 @@
5660
architecture: 'zLinux'
5761
)
5862
end
63+
5964
case facts[:osfamily]
6065
when 'Archlinux'
6166
it { is_expected.not_to create_class('gluster::repo') }

spec/classes/repo_apt_spec.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
let :pre_condition do
1010
'require ::gluster::params'
1111
end
12+
1213
case facts[:osfamily]
1314
when 'Debian'
1415
context 'with all defaults' do
@@ -28,6 +29,7 @@
2829
architecture: 'zLinux'
2930
)
3031
end
32+
3133
it 'does not install' do
3234
expect do
3335
is_expected.to create_file('/etc/pki/rpm-gpg/RPM-GPG-KEY-gluster.pub')
@@ -40,6 +42,7 @@
4042
priority: '700'
4143
}
4244
end
45+
4346
it 'installs' do
4447
is_expected.to contain_apt__source('glusterfs-LATEST').with(
4548
repos: 'main',
@@ -56,6 +59,7 @@
5659
release: '3.9'
5760
}
5861
end
62+
5963
it 'installs' do
6064
is_expected.to contain_apt__source('glusterfs-LATEST').with(
6165
repos: 'main',
@@ -75,6 +79,7 @@
7579
release: '3.6'
7680
}
7781
end
82+
7883
it 'installs' do
7984
is_expected.to contain_apt__source('glusterfs-LATEST').with(
8085
repos: 'main',
@@ -94,6 +99,7 @@
9499
release: '3.8'
95100
}
96101
end
102+
97103
it 'installs' do
98104
is_expected.to contain_apt__source('glusterfs-LATEST').with(
99105
repos: 'main',

0 commit comments

Comments
 (0)