Skip to content

Commit

Permalink
spec: Test also pgsql backend
Browse files Browse the repository at this point in the history
  • Loading branch information
sbadia committed Aug 5, 2015
1 parent 9c5ec9d commit 5e1e0e9
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 0 deletions.
File renamed without changes.
53 changes: 53 additions & 0 deletions spec/acceptance/gitlab_postgresql_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
require 'spec_helper_acceptance'

describe 'gitlab class' do
context 'using postgresql backend' do
hosts.each do |host|
if fact('osfamily') == 'RedHat'
if fact('architecture') == 'amd64'
on host, "wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm; rpm -ivh epel-release-6-8.noarch.rpm"
else
on host, "wget http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm; rpm -ivh epel-release-6-8.noarch.rpm"
end
end
end

it 'should work with no errors' do
pp= <<-EOS
include redis
include nginx
include postgresql::server
include git
include nodejs
include logrotate

postgresql::server::db { 'gitlab':
user => 'user',
password => postgresql_password('user', 'password'),
}

class {'gitlab':
git_user => 'git',
git_home => '/home/git',
git_email => '[email protected]',
git_comment => 'GitLab',
gitlab_sources => 'https://github.com/gitlabhq/gitlabhq.git',
gitlab_domain => 'gitlab.localdomain.local',
gitlab_http_timeout => '300',
gitlab_dbtype => 'pgsql',
gitlab_backup => true,
gitlab_dbname => 'gitlab',
gitlab_dbuser => 'user',
gitlab_dbpwd => 'password',
gitlab_dbport => '5432',
ldap_enabled => false,
}
EOS

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

end
end
1 change: 1 addition & 0 deletions spec/spec_helper_acceptance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
on host, puppet('module','install','puppetlabs-git'), { :acceptable_exit_codes => [0,1] }
on host, puppet('module','install','puppetlabs-vcsrepo'), { :acceptable_exit_codes => [0,1] }
on host, puppet('module','install','puppetlabs-mysql'), { :acceptable_exit_codes => [0,1] }
on host, puppet('module','install','puppetlabs-postgresql'), { :acceptable_exit_codes => [0,1] }
on host, puppet('module','install','puppetlabs-stdlib'), { :acceptable_exit_codes => [0,1] }

# List modules installed to help with debugging
Expand Down

0 comments on commit 5e1e0e9

Please sign in to comment.