From a3efdfe25c0827bf861d3762e9d61fd5f5df6550 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Sat, 3 Feb 2018 13:12:43 +0100 Subject: [PATCH 1/5] add acceptance tests on ubuntu16.04 --- .sync.yml | 2 ++ .travis.yml | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/.sync.yml b/.sync.yml index dbe8e9f2..d1e30d3f 100644 --- a/.sync.yml +++ b/.sync.yml @@ -1,3 +1,5 @@ --- .travis.yml: + docker_sets: + - set: docker/ubuntu-16.04 secure: "GOhttACuJt+3s38m4WnW5RuTgwqaAoeEQnNT+X1Ukn7KdcIk4KV8NzYU/CC0VIm8lUOnBWYJKEC4ixX/J/4Wbxox2RAoKMQrO++L0DB1zTCJnq9SfoUBMaQhXvLu+PbxAR0p3P47ozra0C+pOWDpOaxT9ecufrPQt9W9Z4aY/bs=" diff --git a/.travis.yml b/.travis.yml index 72e6b060..faed4125 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,6 +25,12 @@ matrix: - 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 + bundler_args: --without development release + dist: trusty + env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_set=docker/ubuntu-16.04 CHECK=beaker + services: docker + sudo: require branches: only: - master From e1ab866d6d6b464c4d5c1e17522f77f8f48939f9 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Sat, 3 Feb 2018 13:16:07 +0100 Subject: [PATCH 2/5] add basic acceptance tests --- spec/acceptance/php_spec.rb | 14 ++++++++++++++ spec/spec_helper_acceptance.rb | 18 ++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 spec/acceptance/php_spec.rb create mode 100644 spec/spec_helper_acceptance.rb diff --git a/spec/acceptance/php_spec.rb b/spec/acceptance/php_spec.rb new file mode 100644 index 00000000..ec62f6ed --- /dev/null +++ b/spec/acceptance/php_spec.rb @@ -0,0 +1,14 @@ +require 'spec_helper_acceptance' + +describe 'php' do + it 'works' 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 package('php7.0-fpm') do + it { is_expected.to be_installed } + end +end diff --git a/spec/spec_helper_acceptance.rb b/spec/spec_helper_acceptance.rb new file mode 100644 index 00000000..b94ec1b1 --- /dev/null +++ b/spec/spec_helper_acceptance.rb @@ -0,0 +1,18 @@ +require 'beaker-rspec' +require 'beaker/puppet_install_helper' +require 'beaker/module_install_helper' + +run_puppet_install_helper unless ENV['BEAKER_provision'] == 'no' +install_ca_certs unless ENV['PUPPET_INSTALL_TYPE'] =~ %r{pe}i +install_module_on(hosts) +install_module_dependencies_on(hosts) + +RSpec.configure do |c| + # Readable test descriptions + c.formatter = :documentation + hosts.each do |host| + if host[:platform] =~ %r{el-7-x86_64} && host[:hypervisor] =~ %r{docker} + on(host, "sed -i '/nodocs/d' /etc/yum.conf") + end + end +end From 26bb2aa8910dbd6d3b84e09f89553cdd86bdc62d Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Sat, 3 Feb 2018 14:00:52 +0100 Subject: [PATCH 3/5] add ubuntu14.04 to acceptance tests matrix --- .sync.yml | 1 + .travis.yml | 6 ++++++ spec/acceptance/php_spec.rb | 13 ++++++++++--- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/.sync.yml b/.sync.yml index d1e30d3f..c0e100a2 100644 --- a/.sync.yml +++ b/.sync.yml @@ -2,4 +2,5 @@ .travis.yml: docker_sets: - set: docker/ubuntu-16.04 + - set: docker/ubuntu-14.04 secure: "GOhttACuJt+3s38m4WnW5RuTgwqaAoeEQnNT+X1Ukn7KdcIk4KV8NzYU/CC0VIm8lUOnBWYJKEC4ixX/J/4Wbxox2RAoKMQrO++L0DB1zTCJnq9SfoUBMaQhXvLu+PbxAR0p3P47ozra0C+pOWDpOaxT9ecufrPQt9W9Z4aY/bs=" diff --git a/.travis.yml b/.travis.yml index faed4125..c837c7db 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,6 +31,12 @@ matrix: env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_set=docker/ubuntu-16.04 CHECK=beaker services: docker sudo: require + - rvm: 2.4.2 + bundler_args: --without development release + dist: trusty + env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_set=docker/ubuntu-14.04 CHECK=beaker + services: docker + sudo: require branches: only: - master diff --git a/spec/acceptance/php_spec.rb b/spec/acceptance/php_spec.rb index ec62f6ed..5f0f7776 100644 --- a/spec/acceptance/php_spec.rb +++ b/spec/acceptance/php_spec.rb @@ -1,14 +1,21 @@ require 'spec_helper_acceptance' describe 'php' do - it 'works' 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 package('php7.0-fpm') do - it { is_expected.to be_installed } + case default[:platform] + when %r{16.04} + describe package('php7.0-fpm') do + it { is_expected.to be_installed } + end + when %r{14.04} + describe package('php5-fpm') do + it { is_expected.to be_installed } + end end end From 14740c366d4ed9434ad08dc4bc9aad47bde4cee6 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Sat, 3 Feb 2018 14:12:46 +0100 Subject: [PATCH 4/5] add acceptance tests on centos7 --- .sync.yml | 1 + .travis.yml | 6 ++++++ spec/acceptance/php_spec.rb | 4 ++++ 3 files changed, 11 insertions(+) diff --git a/.sync.yml b/.sync.yml index c0e100a2..7f789bd4 100644 --- a/.sync.yml +++ b/.sync.yml @@ -3,4 +3,5 @@ docker_sets: - set: docker/ubuntu-16.04 - set: docker/ubuntu-14.04 + - set: docker/centos-7 secure: "GOhttACuJt+3s38m4WnW5RuTgwqaAoeEQnNT+X1Ukn7KdcIk4KV8NzYU/CC0VIm8lUOnBWYJKEC4ixX/J/4Wbxox2RAoKMQrO++L0DB1zTCJnq9SfoUBMaQhXvLu+PbxAR0p3P47ozra0C+pOWDpOaxT9ecufrPQt9W9Z4aY/bs=" diff --git a/.travis.yml b/.travis.yml index c837c7db..428cc62c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,6 +37,12 @@ matrix: env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_set=docker/ubuntu-14.04 CHECK=beaker services: docker sudo: require + - rvm: 2.4.2 + bundler_args: --without development release + dist: trusty + env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_set=docker/centos-7 CHECK=beaker + services: docker + sudo: require branches: only: - master diff --git a/spec/acceptance/php_spec.rb b/spec/acceptance/php_spec.rb index 5f0f7776..f7e3263b 100644 --- a/spec/acceptance/php_spec.rb +++ b/spec/acceptance/php_spec.rb @@ -17,5 +17,9 @@ describe package('php5-fpm') do it { is_expected.to be_installed } end + when %(7) + describe package('php-fpm') do + it { is_expected.to be_installed } + end end end From ca9fd220e96f866f1dbfaf5766810a77b9347b2f Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Sat, 17 Feb 2018 09:55:55 +0100 Subject: [PATCH 5/5] add acceptance tests on debian 8 --- .sync.yml | 1 + .travis.yml | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/.sync.yml b/.sync.yml index 7f789bd4..70edc3fc 100644 --- a/.sync.yml +++ b/.sync.yml @@ -4,4 +4,5 @@ - set: docker/ubuntu-16.04 - set: docker/ubuntu-14.04 - set: docker/centos-7 + - set: docker/debian-8 secure: "GOhttACuJt+3s38m4WnW5RuTgwqaAoeEQnNT+X1Ukn7KdcIk4KV8NzYU/CC0VIm8lUOnBWYJKEC4ixX/J/4Wbxox2RAoKMQrO++L0DB1zTCJnq9SfoUBMaQhXvLu+PbxAR0p3P47ozra0C+pOWDpOaxT9ecufrPQt9W9Z4aY/bs=" diff --git a/.travis.yml b/.travis.yml index 428cc62c..94cb977d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -43,6 +43,12 @@ matrix: env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_set=docker/centos-7 CHECK=beaker services: docker sudo: require + - rvm: 2.4.2 + bundler_args: --without development release + dist: trusty + env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_set=docker/debian-8 CHECK=beaker + services: docker + sudo: require branches: only: - master