Skip to content

Commit

Permalink
Merge pull request #49 from voxpupuli/modulesync
Browse files Browse the repository at this point in the history
modulesync 0.15.0
  • Loading branch information
dhoppe committed Nov 3, 2016
2 parents aa8f2e9 + 862dece commit aba0e7f
Show file tree
Hide file tree
Showing 16 changed files with 80 additions and 91 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -12,3 +12,4 @@ log/
.idea/
*.iml
.*.sw
.yardoc/
2 changes: 1 addition & 1 deletion .msync.yml
@@ -1 +1 @@
modulesync_config_version: '0.14.1'
modulesync_config_version: '0.15.0'
2 changes: 1 addition & 1 deletion .rubocop.yml
Expand Up @@ -57,7 +57,7 @@ Style/AndOr:
Style/RedundantSelf:
Enabled: True

Metric/BlockLength:
Metrics/BlockLength:
Enabled: False

# Method length is not necessarily an indicator of code quality
Expand Down
3 changes: 2 additions & 1 deletion Gemfile
Expand Up @@ -12,7 +12,7 @@ end

group :test do
gem 'puppetlabs_spec_helper', '~> 1.2.2', :require => false
gem 'rspec-puppet', :require => false, :git => 'https://github.com/rodjek/rspec-puppet.git'
gem 'rspec-puppet', '~> 2.5', :require => false
gem 'rspec-puppet-facts', :require => false
gem 'rspec-puppet-utils', :require => false
gem 'puppet-lint-absolute_classname-check', :require => false
Expand All @@ -30,6 +30,7 @@ group :test do
gem 'json_pure', '<= 2.0.1', :require => false if RUBY_VERSION < '2.0.0'
gem 'mocha', '>= 1.2.1', :require => false
gem 'coveralls', :require => false if RUBY_VERSION >= '2.0.0'
gem 'simplecov-console', :require => false if RUBY_VERSION >= '2.0.0'
end

group :development do
Expand Down
6 changes: 3 additions & 3 deletions spec/acceptance/class_spec.rb
Expand Up @@ -16,7 +16,7 @@ class { 'jenkins_job_builder': }
end

describe package('jenkins-job-builder') do
it { should be_installed.by('pip') }
it { is_expected.to be_installed.by('pip') }
end

# TODO: test ini file
Expand All @@ -39,8 +39,8 @@ class { 'jenkins_job_builder': }
YAML

describe file('/tmp/jenkins-test.yaml') do
it { should be_file }
its(:content) { should == yaml_content }
it { is_expected.to be_file }
its(:content) { is_expected.to == yaml_content }
end
end
end
13 changes: 5 additions & 8 deletions spec/acceptance/nodesets/docker/centos-5.yml
Expand Up @@ -4,19 +4,16 @@
# https://github.com/voxpupuli/modulesync_config
HOSTS:
centos-5-x64:
default_apply_opts:
order: random
strict_variables:
platform: el-5-x86_64
hypervisor : docker
image: tianon/centos:5.10
hypervisor: docker
image: centos:5
docker_preserve_image: true
docker_cmd: '["/sbin/init"]'
docker_image_commands:
- 'yum install -y crontabs tar wget which'
- 'yum install -y crontabs initscripts iproute openssl sysvinit-tools tar wget which'
- 'sed -i -e "/mingetty/d" /etc/inittab'
CONFIG:
type: aio
log_level: debug
trace_limit: 200
masterless: true
...
# vim: syntax=yaml
11 changes: 4 additions & 7 deletions spec/acceptance/nodesets/docker/centos-6.yml
Expand Up @@ -4,20 +4,17 @@
# https://github.com/voxpupuli/modulesync_config
HOSTS:
centos-6-x64:
default_apply_opts:
order: random
strict_variables:
platform: el-6-x86_64
hypervisor : docker
hypervisor: docker
image: centos:6
docker_preserve_image: true
docker_cmd: '["/sbin/init"]'
docker_image_commands:
- 'rm -rf /var/run/network/*'
- 'yum install -y crontabs tar wget'
- 'yum install -y crontabs initscripts iproute openssl sysvinit-tools tar wget which'
- 'rm /etc/init/tty.conf'
CONFIG:
type: aio
log_level: debug
trace_limit: 200
masterless: true
...
# vim: syntax=yaml
11 changes: 4 additions & 7 deletions spec/acceptance/nodesets/docker/centos-7.yml
Expand Up @@ -4,18 +4,15 @@
# https://github.com/voxpupuli/modulesync_config
HOSTS:
centos-7-x64:
default_apply_opts:
order: random
strict_variables:
platform: el-7-x86_64
hypervisor : docker
hypervisor: docker
image: centos:7
docker_preserve_image: true
docker_cmd: '["/usr/sbin/init"]'
docker_image_commands:
- 'yum install -y crontabs tar wget iproute'
- 'yum install -y crontabs initscripts iproute openssl sysvinit-tools tar wget which'
CONFIG:
type: aio
log_level: debug
trace_limit: 200
masterless: true
...
# vim: syntax=yaml
12 changes: 5 additions & 7 deletions spec/acceptance/nodesets/docker/debian-7.yml
Expand Up @@ -4,18 +4,16 @@
# https://github.com/voxpupuli/modulesync_config
HOSTS:
debian-7-x64:
default_apply_opts:
order: random
strict_variables:
platform: debian-7-amd64
hypervisor : docker
hypervisor: docker
image: debian:7
docker_preserve_image: true
docker_cmd: '["/sbin/init"]'
docker_image_commands:
- 'apt-get install -y cron locales-all net-tools wget'
- 'echo deb http://ftp.debian.org/debian wheezy-backports main >> /etc/apt/sources.list'
- 'apt-get update && apt-get install -y cron locales-all net-tools wget'
CONFIG:
type: aio
log_level: debug
trace_limit: 200
masterless: true
...
# vim: syntax=yaml
12 changes: 5 additions & 7 deletions spec/acceptance/nodesets/docker/debian-8.yml
Expand Up @@ -4,19 +4,17 @@
# https://github.com/voxpupuli/modulesync_config
HOSTS:
debian-8-x64:
default_apply_opts:
order: random
strict_variables:
platform: debian-8-amd64
hypervisor : docker
hypervisor: docker
image: debian:8
docker_preserve_image: true
docker_cmd: '["/sbin/init"]'
docker_image_commands:
- 'apt-get install -y cron locales-all net-tools wget'
- 'echo deb http://ftp.debian.org/debian jessie-backports main >> /etc/apt/sources.list'
- 'apt-get update && apt-get install -y cron locales-all net-tools wget'
- 'rm -f /usr/sbin/policy-rc.d'
CONFIG:
type: aio
log_level: debug
trace_limit: 200
masterless: true
...
# vim: syntax=yaml
9 changes: 3 additions & 6 deletions spec/acceptance/nodesets/docker/ubuntu-12.04.yml
Expand Up @@ -4,19 +4,16 @@
# https://github.com/voxpupuli/modulesync_config
HOSTS:
ubuntu-1204-x64:
default_apply_opts:
order: random
strict_variables:
platform: ubuntu-12.04-amd64
hypervisor : docker
hypervisor: docker
image: ubuntu:12.04
docker_preserve_image: true
docker_cmd: '["/sbin/init"]'
docker_image_commands:
- 'apt-get install -y net-tools wget'
- 'locale-gen en_US.UTF-8'
CONFIG:
type: aio
log_level: debug
trace_limit: 200
masterless: true
...
# vim: syntax=yaml
9 changes: 3 additions & 6 deletions spec/acceptance/nodesets/docker/ubuntu-14.04.yml
Expand Up @@ -4,11 +4,8 @@
# https://github.com/voxpupuli/modulesync_config
HOSTS:
ubuntu-1404-x64:
default_apply_opts:
order: random
strict_variables:
platform: ubuntu-14.04-amd64
hypervisor : docker
hypervisor: docker
image: ubuntu:14.04
docker_preserve_image: true
docker_cmd: '["/sbin/init"]'
Expand All @@ -18,7 +15,7 @@ HOSTS:
- 'apt-get install -y net-tools wget'
- 'locale-gen en_US.UTF-8'
CONFIG:
type: aio
log_level: debug
trace_limit: 200
masterless: true
...
# vim: syntax=yaml
9 changes: 3 additions & 6 deletions spec/acceptance/nodesets/docker/ubuntu-16.04.yml
Expand Up @@ -4,19 +4,16 @@
# https://github.com/voxpupuli/modulesync_config
HOSTS:
ubuntu-1604-x64:
default_apply_opts:
order: random
strict_variables:
platform: ubuntu-16.04-amd64
hypervisor : docker
hypervisor: docker
image: ubuntu:16.04
docker_preserve_image: true
docker_cmd: '["/sbin/init"]'
docker_image_commands:
- 'apt-get install -y net-tools wget'
- 'locale-gen en_US.UTF-8'
CONFIG:
type: aio
log_level: debug
trace_limit: 200
masterless: true
...
# vim: syntax=yaml
44 changes: 22 additions & 22 deletions spec/classes/jenkins_job_builder_spec.rb
Expand Up @@ -13,20 +13,20 @@
}
end

it { should compile.with_all_deps }
it { is_expected.to compile.with_all_deps }

it { should contain_class('jenkins_job_builder::params') }
it { is_expected.to contain_class('jenkins_job_builder::params') }

it { should contain_class('jenkins_job_builder::install').that_comes_before('class[jenkins_job_builder::config]') }
it { should contain_class('jenkins_job_builder::config') }
it { is_expected.to contain_class('jenkins_job_builder::install').that_comes_before('class[jenkins_job_builder::config]') }
it { is_expected.to contain_class('jenkins_job_builder::config') }

it { should contain_package('jenkins-job-builder').with_ensure('latest') }
it { is_expected.to contain_package('jenkins-job-builder').with_ensure('latest') }

it { should contain_file('/etc/jenkins_jobs').with_ensure('directory') }
it { should contain_file('/etc/jenkins_jobs/jenkins_jobs.ini').with_ensure('present') }
it { is_expected.to contain_file('/etc/jenkins_jobs').with_ensure('directory') }
it { is_expected.to contain_file('/etc/jenkins_jobs/jenkins_jobs.ini').with_ensure('present') }

it do
should contain_ini_setting('jenkins-jobs user').with(
is_expected.to contain_ini_setting('jenkins-jobs user').with(
'ensure' => 'present',
'path' => '/etc/jenkins_jobs/jenkins_jobs.ini',
'section' => 'jenkins',
Expand All @@ -37,7 +37,7 @@
end

it do
should contain_ini_setting('jenkins-jobs password').with(
is_expected.to contain_ini_setting('jenkins-jobs password').with(
'ensure' => 'present',
'path' => '/etc/jenkins_jobs/jenkins_jobs.ini',
'section' => 'jenkins',
Expand All @@ -48,7 +48,7 @@
end

it do
should contain_ini_setting('jenkins-jobs url').with(
is_expected.to contain_ini_setting('jenkins-jobs url').with(
'ensure' => 'present',
'path' => '/etc/jenkins_jobs/jenkins_jobs.ini',
'section' => 'jenkins',
Expand All @@ -59,7 +59,7 @@
end

it do
should contain_ini_setting('jenkins-jobs hipchat token').with(
is_expected.to contain_ini_setting('jenkins-jobs hipchat token').with(
'ensure' => 'present',
'path' => '/etc/jenkins_jobs/jenkins_jobs.ini',
'section' => 'hipchat',
Expand All @@ -81,7 +81,7 @@
end

['python', 'python-pip', 'python-yaml'].each do |dep|
it { should contain_package(dep).with_ensure('present') }
it { is_expected.to contain_package(dep).with_ensure('present') }
end
end

Expand All @@ -95,7 +95,7 @@
end

['python', 'python-pip', 'PyYAML', 'python-argparse'].each do |dep|
it { should contain_package(dep).with_ensure('present') }
it { is_expected.to contain_package(dep).with_ensure('present') }
end
end

Expand All @@ -109,7 +109,7 @@
end

['python', 'python-pip', 'PyYAML'].each do |dep|
it { should contain_package(dep).with_ensure('present') }
it { is_expected.to contain_package(dep).with_ensure('present') }
end
end
end
Expand All @@ -129,7 +129,7 @@
end

it do
should contain_vcsrepo('/opt/jenkins_job_builder').with(
is_expected.to contain_vcsrepo('/opt/jenkins_job_builder').with(
'ensure' => 'latest',
'provider' => 'git'
)
Expand All @@ -151,7 +151,7 @@
}
end

it { should contain_package('jenkins-job-builder').with_ensure('latest') }
it { is_expected.to contain_package('jenkins-job-builder').with_ensure('latest') }
end
describe "jenkins_job_builder installed from pkg on 'RedHat' OS version el6" do
let :params do
Expand All @@ -166,7 +166,7 @@
}
end

it { should contain_package('jenkins-job-builder').with_ensure('latest') }
it { is_expected.to contain_package('jenkins-job-builder').with_ensure('latest') }
end
describe "jenkins_job_builder installed from pkg on 'RedHat' OS" do
let :params do
Expand All @@ -181,7 +181,7 @@
}
end

it { should contain_package('python-jenkins-job-builder').with_ensure('latest') }
it { is_expected.to contain_package('python-jenkins-job-builder').with_ensure('latest') }
end
end

Expand All @@ -200,7 +200,7 @@
end

it do
should contain_ini_setting('jenkins-jobs timeout').with(
is_expected.to contain_ini_setting('jenkins-jobs timeout').with(
'ensure' => 'present',
'path' => '/etc/jenkins_jobs/jenkins_jobs.ini',
'section' => 'jenkins',
Expand All @@ -222,7 +222,7 @@
}
end

it { expect { should contain_package('jenkins_job_builder') }.to raise_error(Puppet::Error, %r{Nexenta not supported}) }
it { expect { is_expected.to contain_package('jenkins_job_builder') }.to raise_error(Puppet::Error, %r{Nexenta not supported}) }
end
end

Expand Down Expand Up @@ -254,13 +254,13 @@
end

it do
should contain_file('/tmp/jenkins-test01.yaml').with(
is_expected.to contain_file('/tmp/jenkins-test01.yaml').with(
'content' => ['job' => params[:jobs]['test01']['config']].to_yaml
)
end

it do
should contain_file('/tmp/jenkins-test02.yaml').with(
is_expected.to contain_file('/tmp/jenkins-test02.yaml').with(
'content' => ['job' => params[:jobs]['test02']['config']].to_yaml
)
end
Expand Down

0 comments on commit aba0e7f

Please sign in to comment.