-
-
Notifications
You must be signed in to change notification settings - Fork 165
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
129 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |