-
Notifications
You must be signed in to change notification settings - Fork 1
/
Rakefile
46 lines (42 loc) · 1.06 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
require "pathname"
root_dir = Pathname.new(__FILE__).dirname
integration_test_dir = root_dir + "tests" + "integration"
integration_test_dirs = Pathname.new(integration_test_dir)
.children.select(&:directory?)
task default: %w[test]
desc "run all tests"
task :test do
integration_test_dirs.each do |d|
rakefile = d + "Rakefile"
if rakefile.exist? && rakefile.file?
Dir.chdir(d) do
puts format("entering to %s", d)
begin
puts "running rake"
sh "rake"
ensure
sh "rake clean"
end
end
else
puts "Rakefile does not exist, skipping"
end
end
end
task :clean do
integration_test_dirs.each do |d|
rakefile = d + "Rakefile"
next unless rakefile.exist? && rakefile.file?
Dir.chdir(d) do
puts format("entering to %s", d)
begin
puts "running rake clean"
sh "rake clean"
rescue StandardError => e
puts "rake clean clean failed:"
puts e.message
puts e.backtrace.inspect
end
end
end
end