-
Notifications
You must be signed in to change notification settings - Fork 55
/
Rakefile
44 lines (33 loc) · 969 Bytes
/
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
require 'rbconfig'
RELEASE_FOLDER = "./"
desc 'run all the specs'
task spec: %w(spec:unit spec:integration)
desc 'Installs noaa'
task :install_noaa do
`go install github.com/cloudfoundry/noaa/samples/firehose@latest`
end
namespace :spec do
require 'rspec/core/rake_task'
task :system => :install_noaa
desc 'run all of the unit tests'
RSpec::Core::RakeTask.new(:rspec_unit) do |t|
t.pattern = FileList['spec/unit/**/*_spec.rb']
end
desc 'runs basht unit tests'
task :bash_unit do
execute_cmd('./scripts/run-bash-tests')
end
task :unit => [:bash_unit, :rspec_unit]
desc 'runs integration tests (require the release to be deployed)'
RSpec::Core::RakeTask.new(:integration) do |t|
t.pattern = FileList['spec/integration/**/*_spec.rb']
end
end
def execute_cmd(cmd)
system("bash -c #{cmd.shellescape}")
status = $?
if status != 0
raise "'#{cmd}' execution failed (exit code: #{status}"
end
end
task default: :spec