This repository was archived by the owner on Nov 29, 2023. It is now read-only.
forked from cloudfoundry-community-attic/inception-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRakefile
More file actions
66 lines (53 loc) · 1.79 KB
/
Rakefile
File metadata and controls
66 lines (53 loc) · 1.79 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __FILE__)
require "rubygems"
require "bundler"
Bundler.setup(:default, :test, :development, :integration)
require "bundler/gem_tasks"
require "rake/dsl_definition"
require "rake"
require "rspec/core/rake_task"
begin
require 'kitchen/rake_tasks'
Kitchen::RakeTasks.new
rescue LoadError
puts ">>>>> Kitchen gem not loaded, omitting tasks" unless ENV['CI']
end
if defined?(RSpec)
namespace :spec do
desc "Run Unit Tests"
unit_rspec_task = RSpec::Core::RakeTask.new(:unit) do |t|
t.pattern = "spec/unit/**/*_spec.rb"
t.rspec_opts = %w(--format progress --color)
end
desc "Run cookbook tests (only if $AWS_ACCESS_KEY_ID is set)"
task :cookbooks do
if ENV['AWS_ACCESS_KEY_ID']
sh "kitchen test ec2"
else
puts "Skipping spec:cookbooks. Please provide $AWS_ACCESS_KEY_ID & $AWS_SECRET_ACCESS_KEY_ID"
end
end
namespace :integration do
namespace :aws do
jobs = Dir["spec/integration/aws/*_spec.rb"].map {|f| File.basename(f).gsub(/aws_(.*)_spec.rb/, '\1')}
jobs.each do |job|
desc "Run AWS '#{job}' Integration Test"
RSpec::Core::RakeTask.new(job.to_sym) do |t|
t.pattern = "spec/integration/aws/aws_#{job}_spec.rb"
t.rspec_opts = %w(--format progress --color)
end
end
end
desc "Run AWS Integration Tests"
RSpec::Core::RakeTask.new(:aws) do |t|
t.pattern = "spec/integration/aws/*_spec.rb"
t.rspec_opts = %w(--format progress --color)
end
end
desc "Run all Integration Tests"
task :integration => %w[spec:integration:aws]
end
desc "Install dependencies and run tests"
task :spec => %w(spec:unit spec:integration)
end
task :default => ["spec:unit"]