forked from tl-its-umich-edu/StudentDashboard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
91 lines (73 loc) · 2.34 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
require 'rake/testtask'
### TTD
# - vagrant: check that build has been done? Invoke if necessary?
######################################################
## commands to setup and run vagrant VM with Dashboard
desc "### Commands to setup and run Vagrant VM for Dashboard testing"
task :vagrant
namespace :vagrant do
desc "Make the application build artifacts available for creating the VM"
task :get_artifacts do
sh "(cd vagrant; ./getArtifacts.sh)"
end
desc "Starts the Vagrant VM, creating it if necessary"
task :up => :get_artifacts do
sh "(cd vagrant; vagrant up)"
end
desc "Same as the halt task"
task :down => :halt
desc "Stop VM and destroy it"
task :destroy do
sh "(cd vagrant; vagrant destroy -f)"
end
desc "Halt (stop) the vagrant VM but do not delete it"
task :halt do
sh "(cd vagrant; vagrant halt)"
end
desc "Open a (debug) xterm to the vagrant VM, YMMV."
task :xterm do
sh "(cd vagrant; ./vagrantXterm.sh)"
end
desc "Open a ssh terminal connection to the vagrant VM."
task :ssh do
sh "(cd vagrant; vagrant ssh)"
end
desc "Reload changing into the existing VM. Avoids redoing initial OS updates."
task :reload => :get_artifacts do
sh "(cd vagrant; vagrant reload --provision)"
end
end
########## testing tasks #################
desc "### Available tests are test:all, test:local, test:resources, test:integration"
task :test do
puts "Try rake -t :test"
end
namespace :test do
desc "available tests are: [:test:all, :test:local, :test_integration, :test_resources]"
task :all => [:local, :integration, :resources]
## default unit tests
Rake::TestTask.new do |t|
t.libs << "test"
t.name = "local"
t.description = "Check local unit tests"
t.test_files = FileList['**/test_*.rb'].exclude('**/test_integration*rb')
t.verbose = true
end
## integration tests, only done on request.
Rake::TestTask.new do |t|
t.libs << "test"
t.name = "integration"
t.description = "Check using integration with working ESB"
t.test_files = FileList['**/test_integration*.rb']
t.verbose = true
end
## specific tests
Rake::TestTask.new do |t|
t.libs << "test"
t.name = "resources"
t.description = "Check file implementation of external resources url space"
t.test_files = FileList['**/test_*resources*.rb']
t.verbose = true
end
end
## end