Skip to content

Commit

Permalink
Merge 761eec2 into 89a2c1a
Browse files Browse the repository at this point in the history
  • Loading branch information
bastelfreak authored Mar 6, 2018
2 parents 89a2c1a + 761eec2 commit f671384
Show file tree
Hide file tree
Showing 5 changed files with 137 additions and 29 deletions.
20 changes: 20 additions & 0 deletions .sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,27 @@
.travis.yml:
docker_sets:
- set: docker/ubuntu-16.04
options:
script: 'bundle exec rspec spec/acceptance/php56_spec.rb'
- set: docker/ubuntu-14.04
options:
script: 'bundle exec rspec spec/acceptance/php56_spec.rb'
- set: docker/centos-7
options:
script: 'bundle exec rspec spec/acceptance/php56_spec.rb'
- set: docker/debian-8
options:
script: 'bundle exec rspec spec/acceptance/php56_spec.rb'
- set: docker/ubuntu-16.04
options:
script: 'bundle exec rspec spec/acceptance/php_spec.rb'
- set: docker/ubuntu-14.04
options:
script: 'bundle exec rspec spec/acceptance/php_spec.rb'
- set: docker/centos-7
options:
script: 'bundle exec rspec spec/acceptance/php_spec.rb'
- set: docker/debian-8
options:
script: 'bundle exec rspec spec/acceptance/php_spec.rb'
secure: "GOhttACuJt+3s38m4WnW5RuTgwqaAoeEQnNT+X1Ukn7KdcIk4KV8NzYU/CC0VIm8lUOnBWYJKEC4ixX/J/4Wbxox2RAoKMQrO++L0DB1zTCJnq9SfoUBMaQhXvLu+PbxAR0p3P47ozra0C+pOWDpOaxT9ecufrPQt9W9Z4aY/bs="
58 changes: 45 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,41 +12,73 @@ matrix:
include:
- rvm: 2.1.9
bundler_args: --without system_tests development release
env: PUPPET_VERSION="~> 4.0" CHECK=test PARALLEL_TEST_PROCESSORS=12
env: PUPPET_VERSION="~> 4.0" CHECK="test" PARALLEL_TEST_PROCESSORS=12
- rvm: 2.4.3
bundler_args: --without system_tests development release
env: PUPPET_VERSION="~> 5.0" CHECK=test_with_coveralls
env: PUPPET_VERSION="~> 5.0" CHECK="test_with_coveralls"
- rvm: 2.5.0
bundler_args: --without system_tests development release
env: PUPPET_VERSION="~> 5.0" CHECK=test_with_coveralls
env: PUPPET_VERSION="~> 5.0" CHECK="test_with_coveralls"
- rvm: 2.4.3
bundler_args: --without system_tests development release
env: PUPPET_VERSION="~> 5.0" CHECK=rubocop
env: PUPPET_VERSION="~> 5.0" CHECK="rubocop"
- rvm: 2.4.3
bundler_args: --without system_tests development release
env: PUPPET_VERSION="~> 5.0" CHECK=build DEPLOY_TO_FORGE=yes
- rvm: 2.4.2
env: PUPPET_VERSION="~> 5.0" CHECK="build" DEPLOY_TO_FORGE=yes
- rvm: 2.4.3
bundler_args: --without development release
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_set=docker/ubuntu-16.04
script: 'bundle exec rspec spec/acceptance/php56_spec.rb'
services: docker
sudo: require
- rvm: 2.4.3
bundler_args: --without development release
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_set=docker/ubuntu-14.04
script: 'bundle exec rspec spec/acceptance/php56_spec.rb'
services: docker
sudo: require
- rvm: 2.4.3
bundler_args: --without development release
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_set=docker/centos-7
script: 'bundle exec rspec spec/acceptance/php56_spec.rb'
services: docker
sudo: require
- rvm: 2.4.3
bundler_args: --without development release
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_set=docker/debian-8
script: 'bundle exec rspec spec/acceptance/php56_spec.rb'
services: docker
sudo: require
- rvm: 2.4.3
bundler_args: --without development release
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_set=docker/ubuntu-16.04 CHECK=beaker
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_set=docker/ubuntu-16.04
script: 'bundle exec rspec spec/acceptance/php_spec.rb'
services: docker
sudo: require
- rvm: 2.4.2
- rvm: 2.4.3
bundler_args: --without development release
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_set=docker/ubuntu-14.04 CHECK=beaker
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_set=docker/ubuntu-14.04
script: 'bundle exec rspec spec/acceptance/php_spec.rb'
services: docker
sudo: require
- rvm: 2.4.2
- rvm: 2.4.3
bundler_args: --without development release
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_set=docker/centos-7 CHECK=beaker
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_set=docker/centos-7
script: 'bundle exec rspec spec/acceptance/php_spec.rb'
services: docker
sudo: require
- rvm: 2.4.2
- rvm: 2.4.3
bundler_args: --without development release
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_set=docker/debian-8 CHECK=beaker
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_set=docker/debian-8
script: 'bundle exec rspec spec/acceptance/php_spec.rb'
services: docker
sudo: require
branches:
Expand Down
3 changes: 3 additions & 0 deletions spec/acceptance/nodesets/docker/ubuntu-16.04.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@ HOSTS:
docker_preserve_image: true
docker_cmd: '["/sbin/init"]'
docker_image_commands:
- 'systemctl mask getty@tty1.service getty-static.service'
- 'apt-get update'
- 'apt-get install -y net-tools wget locales apt-transport-https'
- 'locale-gen en_US.UTF-8'
- 'echo LANG=en_US.UTF-8 > /etc/default/locale'
CONFIG:
trace_limit: 200
masterless: true
Expand Down
47 changes: 47 additions & 0 deletions spec/acceptance/php56_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
require 'spec_helper_acceptance'

describe 'with specific php version' do
case default[:platform]
when %r{ubuntu}
packagename = 'php5.6-fpm'
when %{el}
# ell = Enterprise Linux = CentOS....
packagename = 'php-fpm'
when %r{debian}
packagename = 'php5-fpm'
end

context 'with params' do
it 'works with 5.6' do
pp = <<-EOS
class { 'php::globals':
php_version => '5.6',
}
-> class { 'php':
ensure => 'present',
manage_repos => true,
fpm => true,
dev => true,
composer => true,
pear => true,
phpunit => false,
}
EOS

# Run it twice and test for idempotency
apply_manifest(pp, catch_failures: true)
apply_manifest(pp, catch_changes: true)
end

describe package(packagename) do
it { is_expected.to be_installed }
end
describe service(packagename) do
it { is_expected.to be_running }
it { is_expected.to be_enabled }
end
describe command('php --version') do
its(:stdout) { is_expected.to match %r{5\.6} }
end
end
end
38 changes: 22 additions & 16 deletions spec/acceptance/php_spec.rb
Original file line number Diff line number Diff line change
@@ -1,25 +1,31 @@
require 'spec_helper_acceptance'

describe 'php' do
it 'works with defaults' do
pp = 'include php'
# Run it twice and test for idempotency
apply_manifest(pp, catch_failures: true)
apply_manifest(pp, catch_changes: true)
end
describe 'php with default settings' do
context 'default parameters' do
it 'works with defaults' do
pp = 'include php'
# Run it twice and test for idempotency
apply_manifest(pp, catch_failures: true)
apply_manifest(pp, catch_changes: true)
end

case default[:platform]
when %r{16.04}
describe package('php7.0-fpm') do
it { is_expected.to be_installed }
case default[:platform]
when %r{ubuntu-16.04}
packagename = 'php7.0-fpm'
when %r{ubuntu-14.04}
packagename = 'php5-fpm'
when %r{el}
packagename = 'php-fpm'
when %r{debian}
packagename = 'php5-fpm'
end
when %r{14.04}
describe package('php5-fpm') do
describe package(packagename) do
it { is_expected.to be_installed }
end
when %(7)
describe package('php-fpm') do
it { is_expected.to be_installed }

describe service(packagename) do
it { is_expected.to be_running }
it { is_expected.to be_enabled }
end
end
end

0 comments on commit f671384

Please sign in to comment.