Skip to content

Commit

Permalink
Merge pull request #414 from bastelfreak/acceptance
Browse files Browse the repository at this point in the history
Add Acceptance tests
  • Loading branch information
bastelfreak authored Feb 17, 2018
2 parents 4e9313f + ca9fd22 commit 15474f7
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .sync.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
.travis.yml:
docker_sets:
- 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="
24 changes: 24 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,30 @@ 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
- 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
- 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
- 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
Expand Down
25 changes: 25 additions & 0 deletions spec/acceptance/php_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
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

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
when %(7)
describe package('php-fpm') do
it { is_expected.to be_installed }
end
end
end
18 changes: 18 additions & 0 deletions spec/spec_helper_acceptance.rb
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 15474f7

Please sign in to comment.