forked from AppScale/gts
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Rakefile
156 lines (108 loc) · 3.04 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
require 'rubygems'
require 'rake'
require 'rdoc/task'
require 'rake/testtask'
namespace :appcontroller do
APPCONTROLLER_TEST_SUITE = "AppController/test/ts_all.rb"
desc "Generates AppController rdoc"
Rake::RDocTask.new(:doc) { |rd|
rd.rdoc_files.include("AppController/djinn.rb",
"AppController/djinnServer.rb", "AppController/lib")
rd.rdoc_dir = "AppController/doc"
}
desc "Runs AppController unit tests"
Rake::TestTask.new("test") do |t|
t.pattern = APPCONTROLLER_TEST_SUITE
t.verbose = true
t.warning = false
end
end
namespace :apps do
task :test do
sh 'python -m unittest discover -b -v -s Apps/sensor/tests'
sh 'python -m unittest discover -b -v -s Apps/sensor/common/tests'
end
end
namespace :infrastructuremanager do
task :test do
sh 'python -m unittest discover -b -v -s InfrastructureManager'
end
end
namespace :appdb do
task :test do
sh 'python -m unittest discover -b -v -s AppDB/test/unit'
end
end
namespace :apptaskqueue do
task :test do
sh 'python -m unittest discover -b -v -s AppTaskQueue/test/unit'
end
end
namespace :hermes do
task :test do
sh 'python -m unittest discover -b -v -s Hermes/appscale/hermes'
end
end
namespace :searchservice do
task :test do
sh 'python -m unittest discover -b -v -s SearchService/test/unit'
end
end
namespace :appserver do
task :test do
sh 'python -m unittest discover -b -v '\
'-s AppServer/google/appengine/api/taskqueue/test'
sh 'python -m unittest discover -b -v '\
'-s AppServer/google/appengine/api/xmpp/test'
end
end
namespace :common do
task :test do
sh 'python -m unittest discover -b -v -s common/test/unit -t common/'
end
end
namespace :appdashboard do
task :test do
sh 'python -m unittest discover -b -v -s AppDashboard/test/unit'
end
task :coverage do |test|
sh "rm -rf AppDashboard/coverage"
sh "coverage erase"
sh "coverage run --include='AppDashboard/lib/*,AppDashboard/dashboard.py' --omit='*tests*' AppDashboard/test/test_suite.py"
sh "coverage report -m"
sh "coverage html --directory=AppDashboard/coverage"
end
end
namespace :xmppreceiver do
task :coverage do
sh "rm -rf XMPPReceiver/coverage"
sh "cd XMPPReceiver && coverage -e"
sh "cd XMPPReceiver && coverage run --include='xmpp_receiver.py' --omit='*tests*' --omit='*Python*' test/test_suite.py"
sh "cd XMPPReceiver && coverage report -m"
sh "cd XMPPReceiver && coverage html"
sh "cd XMPPReceiver && mv htmlcov coverage"
end
task :test do
sh 'python -m unittest discover -b -v -s XMPPReceiver/test'
end
end
namespace :adminserver do
task :test do
sh 'python -m unittest discover -b -v -s AdminServer/tests'
end
end
python_tests = [
'appdashboard:test',
'appdb:test',
'appserver:test',
'apptaskqueue:test',
'common:test',
'hermes:test',
'infrastructuremanager:test',
'searchservice:test',
'xmppreceiver:test',
'apps:test',
'adminserver:test'
]
ruby_tests = ['appcontroller:test']
task :default => python_tests + ruby_tests