forked from puppetlabs/beaker-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
48 lines (36 loc) · 1.14 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
42
43
44
45
46
47
48
require 'rspec/core/rake_task'
namespace :test do
namespace :spec do
desc "Run spec tests"
RSpec::Core::RakeTask.new(:run) do |t|
t.rspec_opts = ['--color']
t.pattern = 'spec/'
end
desc "Run spec tests with coverage"
RSpec::Core::RakeTask.new(:coverage) do |t|
ENV['BEAKER_TEMPLATE_COVERAGE'] = 'y'
t.rspec_opts = ['--color']
t.pattern = 'spec/'
end
end
namespace :acceptance do
desc <<-EOS
A quick acceptance test, named because it has no pre-suites to run
EOS
task :quick do
sh("beaker",
"--hosts", ENV['CONFIG'] || "acceptance/config/nodes/vagrant-ubuntu-1404.yml",
"--tests", "acceptance/tests",
"--log-level", "debug",
"--keyfile", ENV['KEY'] || "#{ENV['HOME']}/.ssh/id_rsa")
end
end
end
# namespace-named default tasks.
# these are the default tasks invoked when only the namespace is referenced.
# they're needed because `task :default` in those blocks doesn't work as expected.
task 'test:spec' => 'test:spec:run'
task 'test:acceptance' => 'test:acceptance:quick'
# global defaults
task :test => 'test:spec'
task :default => :test