Skip to content

Commit

Permalink
enable beaker acceptance tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan33l committed Oct 28, 2018
1 parent ce1df8d commit c2d5259
Show file tree
Hide file tree
Showing 5 changed files with 129 additions and 94 deletions.
6 changes: 6 additions & 0 deletions .sync.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
---
.travis.yml:
docker_sets:
- set: centos6-64
- set: centos7-64
- set: ubuntu1604-64
- set: ubuntu1404-64
- set: debian8-64
secure: "iStKD31BM2tH9V3IbVJ0BTekwPWwhZbj4rb+6Xiz44cL4pNTHX3ymiAmbGjP0tlVbkzr1+jgUiTXG7ubLG0lTr2mjbgmBWa8ZcyH933HTZ7pzwIUtBjKuZjHT9vG1qZ3MPLDgb9R/i1qRj9rk6pRNlAyhqk5B/ynmO1uzcPneQHo8wToN/WvFGQIw/9I/FFWQQO/6Ap9LpD7xSF5ZAcg94tMpTkBebEuibZOi3Ze5Ah3zf2vHOOFSRcTTrFynyn1mYkUFU1xaOuoqvyTp7Tv+M1+uB1zIXJSJ4oNNeWsC5mLkKz1UBT5GQN7CFaFLawmGqhLQx29sk483Y5+K1NIX8UST47oZFc+bTQjAWJPlVj16lMApB1AXBzov3Cdz3n7GOfZla4BK/2FLqXXbG2KLMMQS/dG3rnLFM4vCT3ED48ZIXV4mb+wpbiXPV4HlOhEbtMSNwXwgWzq3+9yn2PO0rrmGA8tYeY1+ffHoyYGu4aiXO6xzQE8Xbp4LqDeYzRRM078t5BlYyuaU6ZTYgCVFoS9weQETGD1soF8nRObD9Flk2kB+XRIaQytIkQwOR8B28Z44L4ha5syfqvNbuNcJWHvJJNkhT9WlfdcQdmTdIPhglrCGrPtiVp83Ictps6qL5mJRpWcVQarubOGac2YfWC6CBFvxgo7lMFSoYFR3gc="
spec/spec_helper.rb:
spec_overrides:
Expand Down
90 changes: 90 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,96 @@ matrix:
- rvm: 2.4.4
bundler_args: --without system_tests development release
env: PUPPET_VERSION="~> 5.0" CHECK=build DEPLOY_TO_FORGE=yes
- rvm: 2.5.1
bundler_args: --without development release
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=centos6-64{hypervisor=docker} CHECK=beaker
services: docker
sudo: required
- rvm: 2.5.1
bundler_args: --without development release
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_debug=true BEAKER_setfile=centos6-64{hypervisor=docker} CHECK=beaker
services: docker
sudo: required
- rvm: 2.5.1
bundler_args: --without development release
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6-nightly BEAKER_debug=true BEAKER_setfile=centos6-64{hypervisor=docker} CHECK=beaker
services: docker
sudo: required
- rvm: 2.5.1
bundler_args: --without development release
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=centos7-64{hypervisor=docker} CHECK=beaker
services: docker
sudo: required
- rvm: 2.5.1
bundler_args: --without development release
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_debug=true BEAKER_setfile=centos7-64{hypervisor=docker} CHECK=beaker
services: docker
sudo: required
- rvm: 2.5.1
bundler_args: --without development release
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6-nightly BEAKER_debug=true BEAKER_setfile=centos7-64{hypervisor=docker} CHECK=beaker
services: docker
sudo: required
- rvm: 2.5.1
bundler_args: --without development release
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=ubuntu1404-64{hypervisor=docker} CHECK=beaker
services: docker
sudo: required
- rvm: 2.5.1
bundler_args: --without development release
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_debug=true BEAKER_setfile=ubuntu1404-64{hypervisor=docker} CHECK=beaker
services: docker
sudo: required
- rvm: 2.5.1
bundler_args: --without development release
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6-nightly BEAKER_debug=true BEAKER_setfile=ubuntu1404-64{hypervisor=docker} CHECK=beaker
services: docker
sudo: required
- rvm: 2.5.1
bundler_args: --without development release
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=ubuntu1604-64{hypervisor=docker} CHECK=beaker
services: docker
sudo: required
- rvm: 2.5.1
bundler_args: --without development release
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_debug=true BEAKER_setfile=ubuntu1604-64{hypervisor=docker} CHECK=beaker
services: docker
sudo: required
- rvm: 2.5.1
bundler_args: --without development release
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6-nightly BEAKER_debug=true BEAKER_setfile=ubuntu1604-64{hypervisor=docker} CHECK=beaker
services: docker
sudo: required
- rvm: 2.5.1
bundler_args: --without development release
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=debian8-64{hypervisor=docker} CHECK=beaker
services: docker
sudo: required
- rvm: 2.5.1
bundler_args: --without development release
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_debug=true BEAKER_setfile=debian8-64{hypervisor=docker} CHECK=beaker
services: docker
sudo: required
- rvm: 2.5.1
bundler_args: --without development release
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6-nightly BEAKER_debug=true BEAKER_setfile=debian8-64{hypervisor=docker} CHECK=beaker
services: docker
sudo: required
branches:
only:
- master
Expand Down
11 changes: 4 additions & 7 deletions spec/acceptance/class_spec.rb → spec/acceptance/gitlab_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@

describe 'gitlab class' do
context 'default parameters' do
# Using puppet_apply as a helper
it 'idempotently with no errors' do
pp = <<-EOS
class { 'gitlab':
external_url => "http://${::fqdn}",
}
EOS

# Run it twice and test for idempotency
apply_manifest(pp, catch_failures: true)
apply_manifest(pp, catch_changes: true)
end
Expand All @@ -19,11 +17,10 @@ class { 'gitlab':
it { is_expected.to be_installed }
end

it 'allows http connection on port 8080' do
shell 'sleep 15' # give it some time to start up
describe command('curl 0.0.0.0:80/users/sign_in') do
its(:stdout) { is_expected.to match %r{/GitLab|password/} }
end
shell('sleep 15') # give it some time to start up

describe command('curl -s -S 0.0.0.0:80/users/sign_in') do
its(:stdout) { is_expected.to match %r{.*reset_password_token=.*redirected.*} }
end
end
end
72 changes: 0 additions & 72 deletions spec/acceptance/travis_ci_acceptance_spec.rb

This file was deleted.

44 changes: 29 additions & 15 deletions spec/spec_helper_acceptance.rb
Original file line number Diff line number Diff line change
@@ -1,24 +1,38 @@
require 'beaker-rspec/spec_helper'
require 'beaker-rspec/helpers/serverspec'
require 'beaker-rspec'
require 'beaker-puppet'
require 'beaker/puppet_install_helper'
require 'beaker/module_install_helper'

run_puppet_install_helper unless ENV['BEAKER_provision'] == 'no'
install_module
install_module_dependencies

RSpec.configure do |c|
# Project root
proj_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))
# Configure all nodes
c.before :suite do
# The omnibus installer use the following algorithm to know what to do.
# https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-cookbooks/runit/recipes/default.rb
# If this peace of code trigger docker case, the installer hang indefinitly.
pp = %(
file {'/.dockerenv':
ensure => absent,
}
package { ['curl']:
ensure => present,
}
)

# Readable test descriptions
c.formatter = :documentation
apply_manifest(pp, catch_failures: true)

# Configure all nodes in nodeset
c.before :suite do
# Install module and dependencies
puppet_module_install(source: proj_root, module_name: 'gitlab')
hosts.each do |host|
on host, puppet('module', 'install', 'puppetlabs-stdlib'), acceptable_exit_codes: [0]
on host, puppet('module', 'install', 'puppetlabs-apt'), acceptable_exit_codes: [0]
on host, puppet('module', 'install', 'garethr-docker'), acceptable_exit_codes: [0]
end
# https://gitlab.com/gitlab-org/omnibus-gitlab/issues/2229
# There is no /usr/share/zoneinfo in latest Docker image for ubuntu 16.04
# Gitlab installer fail without this file
tzdata = %(
package { ['tzdata']:
ensure => present,
}
)

apply_manifest(tzdata, catch_failures: true) if fact('os.release.major') == '16.04'
end
end

0 comments on commit c2d5259

Please sign in to comment.