-
Notifications
You must be signed in to change notification settings - Fork 545
/
Rakefile
41 lines (37 loc) · 942 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
require 'tmpdir'
def root_path
File.expand_path('../.', __FILE__)
end
def commit
@commit ||= (
ENV['TRAVIS_COMMIT'] || `git rev-parse --abbrev-ref HEAD`.chomp
)
end
task :default do
Dir.mktmpdir('gvm-test') do |tmpdir|
system(<<-EOSH) || fail
bash -c '
set -e
#{root_path}/binscripts/gvm-installer #{commit} #{tmpdir}
source #{tmpdir}/gvm/scripts/gvm
tf --text #{tmpdir}/gvm/tests/*.sh
'
EOSH
end
end
task :scenario do
Dir["#{root_path}/tests/scenario/*_comment_test.sh"].each do |test|
name = File.basename(test)
puts "Running scenario #{name}..."
Dir.mktmpdir('gvm-test') do |tmpdir|
system(<<-EOSH) || fail
bash -c '
set -e
#{root_path}/binscripts/gvm-installer #{commit} #{tmpdir}
source #{tmpdir}/gvm/scripts/gvm
tf --text #{tmpdir}/gvm/tests/scenario/#{name}
'
EOSH
end
end
end