forked from puppetlabs/puppetdb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
41 lines (34 loc) · 1.17 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
require 'rake'
RAKE_ROOT = File.dirname(__FILE__)
def run_beaker(test_files)
config = ENV["BEAKER_CONFIG"] || "vbox-el6-64mda"
options = ENV["BEAKER_OPTIONS"] || "postgres"
preserve_hosts = ENV["BEAKER_PRESERVE_HOSTS"] || "never"
color = ENV["BEAKER_COLOR"] == "false" ? false : true
xml = ENV["BEAKER_XML"] == "true" ? true : false
type = ENV["BEAKER_TYPE"] || "git"
rake_root = File.dirname(__FILE__)
beaker = "beaker " +
"-c '#{RAKE_ROOT}/acceptance/config/#{config}.cfg' " +
"--type #{type} " +
"--debug " +
"--tests " + test_files + " " +
"--options-file 'acceptance/options/#{options}.rb' " +
"--root-keys " +
"--preserve-hosts #{preserve_hosts}"
beaker += " --no-color" unless color
beaker += " --xml" if xml
sh beaker
end
namespace :beaker do
desc "Run beaker based acceptance tests"
task :acceptance, [:test_files] do |t, args|
args.with_defaults(:test_files => 'acceptance/tests/')
run_beaker(args[:test_files])
end
desc "Run beaker based performance tests"
task :performance, :test_files do |t, args|
args.with_defaults(:test_files => 'acceptance/performance/')
run_beaker(args[:test_files])
end
end