From 8325dfb2e61a3d9e817126bd5d8a52ab26480d89 Mon Sep 17 00:00:00 2001 From: Sebastien Badia Date: Sat, 11 Jul 2015 19:52:02 +0200 Subject: [PATCH] acceptance: Clean spec file and use ubuntu 14.04 for default tests --- Gemfile | 1 + spec/acceptance/nodesets/default.yml | 13 +++++++------ spec/spec_helper_acceptance.rb | 16 ++++++++++------ 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/Gemfile b/Gemfile index b9ec620..4e1a9a9 100644 --- a/Gemfile +++ b/Gemfile @@ -24,6 +24,7 @@ end group :system_tests do gem 'beaker-rspec', :require => false + gem 'beaker-puppet_install_helper', :require => false end if facterversion = ENV['FACTER_GEM_VERSION'] diff --git a/spec/acceptance/nodesets/default.yml b/spec/acceptance/nodesets/default.yml index 480aa79..3bb3e62 100644 --- a/spec/acceptance/nodesets/default.yml +++ b/spec/acceptance/nodesets/default.yml @@ -1,10 +1,11 @@ HOSTS: - debian-73-x64: + ubuntu-server-1404-x64: roles: - master - platform: debian-7-amd64 - box : debian-73-x64-nocm - box_url : http://puppet-vagrant-boxes.puppetlabs.com/debian-73-x64-virtualbox-nocm.box - hypervisor : vagrant + platform: ubuntu-14.04-amd64 + box: puppetlabs/ubuntu-14.04-64-nocm + box_url: https://vagrantcloud.com/puppetlabs/ubuntu-14.04-64-nocm + hypervisor: vagrant CONFIG: - type: foss + log_level: debug + type: git diff --git a/spec/spec_helper_acceptance.rb b/spec/spec_helper_acceptance.rb index 7cf5910..f176ea7 100644 --- a/spec/spec_helper_acceptance.rb +++ b/spec/spec_helper_acceptance.rb @@ -1,21 +1,22 @@ require 'beaker-rspec' +require 'beaker/puppet_install_helper' -hosts.each do |host| - install_puppet - on host, "mkdir -p #{host['distmoduledir']}" -end +run_puppet_install_helper RSpec.configure do |c| # Project root proj_root = File.expand_path(File.join(File.dirname(__FILE__), '..')) + modname = JSON.parse(open('metadata.json').read)['name'].split('-')[1] # Readable test descriptions c.formatter = :documentation # Configure all nodes in nodeset c.before :suite do + # Install module - puppet_module_install(:source => proj_root, :module_name => 'gitlab') + # + puppet_module_install(:source => proj_root, :module_name => modname) hosts.each do |host| on host, puppet('module','install','alup/rbenv'), { :acceptable_exit_codes => [0,1] } on host, puppet('module','install','fsalum/redis'), { :acceptable_exit_codes => [0,1] } @@ -23,8 +24,11 @@ on host, puppet('module','install','evenup/logrotate'), { :acceptable_exit_codes => [0,1] } 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', '--version', '2.2'), { :acceptable_exit_codes => [0,1] } + on host, puppet('module','install','puppetlabs-mysql'), { :acceptable_exit_codes => [0,1] } on host, puppet('module','install','puppetlabs-stdlib'), { :acceptable_exit_codes => [0,1] } + + # List modules installed to help with debugging + on host, puppet('module','list'), { :acceptable_exit_codes => [0] } end end end