rutema_web 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.txt +10 -0
- data/Manifest.txt +7 -4
- data/README.txt +2 -7
- data/Rakefile +2 -2
- data/lib/rutema_web/gems.rb +2 -2
- data/lib/rutema_web/main.rb +16 -8
- data/lib/rutema_web/model.rb +1 -3
- data/lib/rutema_web/public/js/graph.js +38 -0
- data/lib/rutema_web/sinatra.rb +127 -57
- data/lib/rutema_web/views/flot.erb +2 -2
- data/lib/rutema_web/views/main.erb +2 -2
- data/lib/rutema_web/views/timeline.erb +49 -0
- metadata +69 -34
data/History.txt
CHANGED
@@ -1,3 +1,13 @@
|
|
1
|
+
=== 1.0.4 / 2010-04-23
|
2
|
+
* Fixed manifest missing entry for the flot lib
|
3
|
+
* Fixed sequence of data in flot diagrams (was reversed)
|
4
|
+
* Added timeline diagrams per config
|
5
|
+
* Scenarios in a run are now listed in ascending order of start time
|
6
|
+
* Custom settings solution scrapped in favor for Sinatra's settings.
|
7
|
+
* Settings expanded to include last n runs number
|
8
|
+
* IMPORTANT: a configuration file is now needed instead of the sqlite3 database file, as rutema_web should now be able to connect to all activerecord databases. The configuration file is a yaml dump of {:db=>{:adapter=>'sqlite3', :database=>'rutema_test.db'}, :settings=>{ :page_size=>10, :last_n_runs=>20, :port=>7000, :show_setup_teardown=>true}}
|
9
|
+
Also important to know that at the moment this does not check or adjust paths, so the yaml file should be in the directory from which rutema_web is running so that paths to sqlite3 databases are correct.
|
10
|
+
* Statistics now use a drop down list instead of a bunch of buttons - tidier UI
|
1
11
|
=== 1.0.3 / 2009-12-17
|
2
12
|
* Replaced gruff with flot removing the gruff/RMagick/ImageMagick dependency
|
3
13
|
* Trivial caching of statistic data implemented to speed up graph display
|
data/Manifest.txt
CHANGED
@@ -7,11 +7,11 @@ bin/rutema_web
|
|
7
7
|
lib/rutema_web/gems.rb
|
8
8
|
lib/rutema_web/main.rb
|
9
9
|
lib/rutema_web/model.rb
|
10
|
-
lib/rutema_web/ruport_formatter.rb
|
11
|
-
lib/rutema_web/sinatra.rb
|
12
10
|
lib/rutema_web/public/css/style.css
|
13
11
|
lib/rutema_web/public/images/bg_menu.gif
|
14
12
|
lib/rutema_web/public/images/bg_submenu.gif
|
13
|
+
lib/rutema_web/public/images/left.png
|
14
|
+
lib/rutema_web/public/images/right.png
|
15
15
|
lib/rutema_web/public/images/run_error.png
|
16
16
|
lib/rutema_web/public/images/run_ok.png
|
17
17
|
lib/rutema_web/public/images/run_warn.png
|
@@ -19,11 +19,14 @@ lib/rutema_web/public/images/step_error.png
|
|
19
19
|
lib/rutema_web/public/images/step_ok.png
|
20
20
|
lib/rutema_web/public/images/step_warn.png
|
21
21
|
lib/rutema_web/public/images/tie_logo.gif
|
22
|
-
lib/rutema_web/public/images/left.png
|
23
|
-
lib/rutema_web/public/images/right.png
|
24
22
|
lib/rutema_web/public/js/folding.js
|
23
|
+
lib/rutema_web/public/js/graph.js
|
25
24
|
lib/rutema_web/public/js/jquery-1.3.2.min.js
|
26
25
|
lib/rutema_web/public/js/jquery.flot.min.js
|
27
26
|
lib/rutema_web/public/js/jquery.flot.stack.min.js
|
27
|
+
lib/rutema_web/ruport_formatter.rb
|
28
|
+
lib/rutema_web/sinatra.rb
|
28
29
|
lib/rutema_web/views/flot.erb
|
29
30
|
lib/rutema_web/views/main.erb
|
31
|
+
lib/rutema_web/views/timeline.erb
|
32
|
+
test/test_model.rb
|
data/README.txt
CHANGED
@@ -10,17 +10,12 @@ diagrams of debatable aesthetics but undoubtable value!
|
|
10
10
|
== FEATURES/PROBLEMS:
|
11
11
|
|
12
12
|
== SYNOPSIS:
|
13
|
-
rutema_web
|
13
|
+
rutema_web config.yaml and browse to http://localhost:7000 for the glorious view
|
14
14
|
|
15
15
|
== REQUIREMENTS:
|
16
|
-
* patir (http://patir.rubyforge.org)
|
17
16
|
* rutema (http://patir.rubyforge.org/rutema)
|
18
|
-
* activerecord (http://ar.rubyonrails.com/)
|
19
|
-
* sqlite3 (http://rubyforge.org/projects/sqlite-ruby/)
|
20
17
|
* sinatra (http://www.sinatrarb.com/)
|
21
18
|
* ruport (http://rubyreports.org/)
|
22
|
-
* acts_as_reportable
|
23
|
-
* gruff/RMagick (optional, but needed if you want to see the statistics graphs)
|
24
19
|
|
25
20
|
== INSTALL:
|
26
21
|
* sudo gem install rutema_web
|
@@ -28,7 +23,7 @@ rutema_web [results.db] and browse to http://localhost:7000 for the glorious vie
|
|
28
23
|
== LICENSE:
|
29
24
|
(The Ruby License)
|
30
25
|
|
31
|
-
rutema is copyright (c) 2007 -
|
26
|
+
rutema is copyright (c) 2007 - 2010 Vassilis Rizopoulos
|
32
27
|
|
33
28
|
You can redistribute it and/or modify it under either the terms of the GPL
|
34
29
|
(see COPYING.txt file), or the conditions below:
|
data/Rakefile
CHANGED
@@ -14,8 +14,8 @@ Hoe.spec('rutema_web') do |p|
|
|
14
14
|
p.description = p.paragraphs_of('README.txt', 1..5).join("\n\n")
|
15
15
|
p.url = p.paragraphs_of('README.txt', 0).first.split(/\n/)[1..-1]
|
16
16
|
p.changes = p.paragraphs_of('History.txt', 0..1).join("\n\n")
|
17
|
-
p.extra_deps<<['rutema',"1.0.
|
18
|
-
p.extra_deps<<['sinatra','0.
|
17
|
+
p.extra_deps<<['rutema',"=1.0.9"]
|
18
|
+
p.extra_deps<<['sinatra','=1.0.0']
|
19
19
|
p.extra_deps<<['ruport','>=1.6.1']
|
20
20
|
p.spec_extras={:executables=>["rutema_web"],
|
21
21
|
:default_executable=>"rutema_web"}
|
data/lib/rutema_web/gems.rb
CHANGED
data/lib/rutema_web/main.rb
CHANGED
@@ -1,29 +1,36 @@
|
|
1
1
|
$:.unshift File.join(File.dirname(__FILE__),"..")
|
2
2
|
require 'rutema_web/sinatra'
|
3
|
-
require 'rutema/db'
|
4
3
|
require 'optparse'
|
4
|
+
require 'rutema/reporters/activerecord'
|
5
5
|
#This is the web frontend for Rutema databases.
|
6
6
|
module RutemaWeb
|
7
|
+
extend Rutema::ActiveRecordConnections
|
7
8
|
#This module defines the version numbers for the library
|
8
9
|
module Version
|
9
10
|
MAJOR=1
|
10
11
|
MINOR=0
|
11
|
-
TINY=
|
12
|
+
TINY=4
|
12
13
|
STRING=[ MAJOR, MINOR, TINY ].join( "." )
|
13
14
|
end
|
14
15
|
#Starts App
|
15
16
|
def self.start
|
16
17
|
logger=Patir.setup_logger
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
18
|
+
cfg_file=parse_command_line(ARGV)
|
19
|
+
cfg_file=File.expand_path(cfg_file)
|
20
|
+
configuration=YAML.load_file(cfg_file)
|
21
|
+
if (configuration[:db])
|
22
|
+
self.connect_to_active_record(configuration[:db],logger)
|
23
|
+
RutemaWeb::UI::SinatraApp.define_settings(configuration[:settings])
|
24
|
+
RutemaWeb::UI::SinatraApp.run!
|
25
|
+
else
|
26
|
+
logger.fatal("No database configuration information found in #{cfg_file}")
|
27
|
+
end
|
21
28
|
end
|
22
29
|
#Parses the command line arguments
|
23
30
|
def self.parse_command_line args
|
24
31
|
args.options do |opt|
|
25
|
-
opt.on("Usage:")
|
26
|
-
opt.on("
|
32
|
+
opt.on("Usage:")
|
33
|
+
opt.on("rutema_web [options] config_file")
|
27
34
|
opt.on("Options:")
|
28
35
|
opt.on("--debug", "-d","Turns on debug messages") { $DEBUG=true }
|
29
36
|
opt.on("-v", "--version","Displays the version") { $stdout.puts("v#{Version::STRING}");exit 0 }
|
@@ -38,6 +45,7 @@ module RutemaWeb
|
|
38
45
|
end
|
39
46
|
end
|
40
47
|
end
|
48
|
+
|
41
49
|
end
|
42
50
|
|
43
51
|
|
data/lib/rutema_web/model.rb
CHANGED
@@ -1,7 +1,5 @@
|
|
1
1
|
# Copyright (c) 2008 Vassilis Rizopoulos. All rights reserved.
|
2
|
-
$:.unshift File.join(File.dirname(__FILE__),"..")
|
3
|
-
require 'active_record'
|
4
|
-
require 'ruport/acts_as_reportable'
|
2
|
+
$:.unshift File.join(File.dirname(__FILE__),"..")
|
5
3
|
require 'rutema/model'
|
6
4
|
module Rutema
|
7
5
|
module Model
|
@@ -0,0 +1,38 @@
|
|
1
|
+
$(function () {
|
2
|
+
var options = {
|
3
|
+
stack: true,
|
4
|
+
bars: { show: true },
|
5
|
+
xaxis: { tickDecimals: 0, tickSize: 1 }
|
6
|
+
};
|
7
|
+
var data = [];
|
8
|
+
var placeholder = $("#placeholder");
|
9
|
+
|
10
|
+
$.plot(placeholder, data, options);
|
11
|
+
|
12
|
+
$("input.fetchSeries").click(function () {
|
13
|
+
//var button = $(this);
|
14
|
+
var cfg = document.configurations_form.configurations_list.value
|
15
|
+
// find the URL in the link right next to us
|
16
|
+
var dataurl = '/statistics/data/' + cfg;
|
17
|
+
|
18
|
+
// then fetch the data with jQuery
|
19
|
+
function onDataReceived(series) {
|
20
|
+
// and plot all we got
|
21
|
+
$.plot(placeholder, series, {
|
22
|
+
series: {
|
23
|
+
stack: true,
|
24
|
+
bars: { show: true, barWidth: 0.6 },
|
25
|
+
},
|
26
|
+
legend: {position:'nw'}
|
27
|
+
});
|
28
|
+
}
|
29
|
+
|
30
|
+
$.ajax({
|
31
|
+
url: dataurl,
|
32
|
+
method: 'GET',
|
33
|
+
dataType: 'json',
|
34
|
+
success: onDataReceived
|
35
|
+
});
|
36
|
+
});
|
37
|
+
})
|
38
|
+
|
data/lib/rutema_web/sinatra.rb
CHANGED
@@ -61,7 +61,7 @@ module RutemaWeb
|
|
61
61
|
end
|
62
62
|
return msg
|
63
63
|
end
|
64
|
-
|
64
|
+
|
65
65
|
def run_link r
|
66
66
|
"<a class=\"smallgreytext\" href=\"#{run_url(r)}\">Run #{r.id}</a>"
|
67
67
|
end
|
@@ -112,29 +112,6 @@ module RutemaWeb
|
|
112
112
|
|
113
113
|
end
|
114
114
|
|
115
|
-
#Contains all the settings that control the display of information for RutemaWeb's controllers
|
116
|
-
module Settings
|
117
|
-
DEFAULT_PAGE_SIZE=10
|
118
|
-
@@rutemaweb_settings||=Hash.new
|
119
|
-
#Set to true to show all setup and teardown scenarios
|
120
|
-
def show_setup_teardown= v
|
121
|
-
@@rutemaweb_settings[:show_setup_teardown]= v
|
122
|
-
end
|
123
|
-
|
124
|
-
def show_setup_teardown?
|
125
|
-
return @@rutemaweb_settings[:show_setup_teardown]
|
126
|
-
end
|
127
|
-
|
128
|
-
def page_size= v
|
129
|
-
@@rutemaweb_settings[:page_size]=v
|
130
|
-
end
|
131
|
-
|
132
|
-
def page_size
|
133
|
-
@@rutemaweb_settings[:page_size]||=DEFAULT_PAGE_SIZE
|
134
|
-
return @@rutemaweb_settings[:page_size]
|
135
|
-
end
|
136
|
-
end
|
137
|
-
|
138
115
|
module Statistics
|
139
116
|
private
|
140
117
|
#extract all the configuration names
|
@@ -142,31 +119,53 @@ module RutemaWeb
|
|
142
119
|
runs=Rutema::Model::Run.find(:all)
|
143
120
|
return runs.map{|r| r.context[:config_file] if r.context.is_a?(Hash)}.compact.uniq
|
144
121
|
end
|
145
|
-
def panel_configurations
|
146
|
-
panel=""
|
122
|
+
def panel_configurations type,action=nil
|
123
|
+
panel="<form name=\"configurations_form\" action=\"#{action}\" method=\"post\"><select name=\"configurations_list\">"
|
124
|
+
|
147
125
|
configurations.each do |cfg|
|
148
|
-
panel<<"<
|
149
|
-
panel<<"<br/>"
|
126
|
+
panel<<"<option value=\"#{cfg}\">#{cfg}</option>"
|
150
127
|
end
|
128
|
+
panel<<"</select><input class=\"fetchSeries\" type=\"#{type}\" value=\"Go\"></form>"
|
151
129
|
return panel
|
152
130
|
end
|
153
131
|
end
|
154
|
-
|
132
|
+
|
133
|
+
module Timeline
|
134
|
+
#Collects the timeline information from a set of runs.
|
135
|
+
#Essentially this lists the status for all scenarios in each run
|
136
|
+
#filling in not_executed status for any missing entries
|
137
|
+
def timeline_data runs
|
138
|
+
# {:scenario=>{"run_id"=>status}}
|
139
|
+
data=Hash.new
|
140
|
+
runs.each do |run|
|
141
|
+
run.scenarios.each do |scenario|
|
142
|
+
unless scenario.name=~/_setup$/ || scenario.name=~/_teardown$/
|
143
|
+
data[scenario.name]||={}
|
144
|
+
data[scenario.name][run.id]=[scenario.status,scenario.id]
|
145
|
+
end
|
146
|
+
end
|
147
|
+
end
|
148
|
+
#fill in the blanks
|
149
|
+
data.each do |k,v|
|
150
|
+
runs.each do |run|
|
151
|
+
data[k][run.id]=["not_executed",nil] unless data[k][run.id]
|
152
|
+
end
|
153
|
+
end
|
154
|
+
return data
|
155
|
+
end
|
156
|
+
end
|
157
|
+
|
155
158
|
class SinatraApp<Sinatra::Base
|
156
159
|
include ViewUtilities
|
157
|
-
include Settings
|
158
160
|
include Statistics
|
161
|
+
include Timeline
|
159
162
|
attr_accessor :title,:panel_content,:content_title,:content
|
160
|
-
enable :logging
|
161
|
-
enable :run
|
162
|
-
enable :static
|
163
|
-
set :server, %w[thin mongrel webrick]
|
164
|
-
set :port, 7000
|
165
|
-
set :root, File.dirname(__FILE__)
|
166
|
-
set :public, File.dirname(__FILE__) + '/public'
|
167
163
|
|
164
|
+
DEFAULT_SETTINGS = {:show_setup_teardown=>true,:page_size=>10,:last_n_runs=>20,:sorting_order=>"start_time",:port=>7000}
|
165
|
+
|
168
166
|
@@logger = Patir.setup_logger
|
169
167
|
@@cache = {}
|
168
|
+
|
170
169
|
get '/' do
|
171
170
|
page_setup "Rutema",panel_runs,"Welcome to Rutema","<p>This is the rutema web interface.<br/>It allows you to browse the contents of the test results database.</p><p>Currently you can view the results for each separate run, the results for a specific scenario (a complete list of all steps executed in the scenario with standard and error output logs) or the complete execution history of a scenario.</p><p>The panel on the left shows a list of the ten most recent runs.</p>"
|
172
171
|
erb :main
|
@@ -178,17 +177,17 @@ module RutemaWeb
|
|
178
177
|
page_setup "Run #{run_id}",panel_runs,"Summary of run #{run_id}",single_run(run_id)
|
179
178
|
erb :main
|
180
179
|
end
|
181
|
-
|
180
|
+
|
182
181
|
get '/run/?' do
|
183
182
|
runs(0)
|
184
183
|
erb :main
|
185
184
|
end
|
186
|
-
|
185
|
+
|
187
186
|
get '/runs/?' do
|
188
187
|
runs(0)
|
189
188
|
erb :main
|
190
189
|
end
|
191
|
-
|
190
|
+
|
192
191
|
get '/runs/:page' do |page|
|
193
192
|
runs(page)
|
194
193
|
erb :main
|
@@ -207,19 +206,19 @@ module RutemaWeb
|
|
207
206
|
end
|
208
207
|
erb :main
|
209
208
|
end
|
210
|
-
|
209
|
+
|
211
210
|
get '/scenario/?' do
|
212
211
|
scenarios(0)
|
213
212
|
erb :main
|
214
213
|
end
|
215
|
-
|
214
|
+
|
216
215
|
get '/scenarios/?' do
|
217
216
|
scenarios(0)
|
218
217
|
erb :main
|
219
218
|
end
|
220
|
-
|
219
|
+
|
221
220
|
get '/statistics/?' do
|
222
|
-
page_setup "Rutema",panel_configurations,"Statistics"
|
221
|
+
page_setup "Rutema",panel_configurations("button"),"Statistics"
|
223
222
|
@content="<p>rutema statistics provide reports that present the results on a time axis<br/>At present you can see the ratio of successful vs. failed test cases over time grouped per configuration file.</p>"
|
224
223
|
erb :flot
|
225
224
|
end
|
@@ -229,24 +228,86 @@ module RutemaWeb
|
|
229
228
|
successful,failed,not_executed=*dt
|
230
229
|
content_type "text/json"
|
231
230
|
return ActiveSupport::JSON.encode([{:data=>successful,:label=>"successful",:color=>"green"},
|
232
|
-
|
233
|
-
|
231
|
+
{:data=>failed,:label=>"failed",:color=>"red"},
|
232
|
+
{:data=>not_executed,:label=>"not_executed",:color=>"yellow"}
|
234
233
|
])
|
235
234
|
end
|
235
|
+
|
236
|
+
get '/timeline/?' do
|
237
|
+
page_setup "Rutema",panel_configurations("submit","/timeline"),"Timeline"
|
238
|
+
@content="<p>rutema timelines show the status of executed scenarios for the last N runs.</p>"
|
239
|
+
erb :timeline
|
240
|
+
end
|
241
|
+
|
242
|
+
post '/timeline' do
|
243
|
+
configuration = params["configurations_list"]
|
244
|
+
timeline(configuration)
|
245
|
+
erb :timeline
|
246
|
+
end
|
247
|
+
|
248
|
+
get '/timeline/:configuration' do |configuration|
|
249
|
+
timeline(configuration)
|
250
|
+
erb :timeline
|
251
|
+
end
|
252
|
+
|
253
|
+
|
254
|
+
def self.define_settings cfg
|
255
|
+
#the settings that are not public
|
256
|
+
enable :logging
|
257
|
+
enable :run
|
258
|
+
enable :static
|
259
|
+
set :server, %w[thin mongrel webrick]
|
260
|
+
set :root, File.dirname(__FILE__)
|
261
|
+
set :public, File.dirname(__FILE__) + '/public'
|
262
|
+
#the settings that can be changed
|
263
|
+
#set any missing values with the default
|
264
|
+
cfg[:show_setup_teardown] ||= DEFAULT_SETTINGS[:show_setup_teardown]
|
265
|
+
cfg[:page_size] ||= DEFAULT_SETTINGS[:page_size]
|
266
|
+
cfg[:last_n_runs] ||= DEFAULT_SETTINGS[:last_n_runs]
|
267
|
+
cfg[:port] ||= DEFAULT_SETTINGS[:port]
|
268
|
+
#set them
|
269
|
+
set :show_setup_teardown, cfg[:show_setup_teardown]
|
270
|
+
set :page_size, cfg[:page_size]
|
271
|
+
set :last_n_runs, cfg[:last_n_runs]
|
272
|
+
set :port, cfg[:port]
|
273
|
+
end
|
236
274
|
private
|
275
|
+
def timeline configuration
|
276
|
+
page_setup "Rutema",panel_configurations("submit","/timeline"),"Timeline for #{configuration}"
|
277
|
+
data=timeline_data(last_n_runs_in_configuration(configuration,settings.last_n_runs))
|
278
|
+
|
279
|
+
@content="<table class=\"timeline\">"
|
280
|
+
data.each do |sc_name,run_data|
|
281
|
+
@content<<"<tr><td>#{sc_name}</td>"
|
282
|
+
run_data.keys.sort.each do |key|
|
283
|
+
sc_data=run_data[key]
|
284
|
+
@content<<"<td class=\"#{sc_data[0]}\">"
|
285
|
+
if sc_data[1]
|
286
|
+
@content<<"<a class=\"timeline\" href=\"/scenario/#{sc_data[1]}\">#{key}</a>"
|
287
|
+
else
|
288
|
+
@content<<"<span class=\"timeline\">#{key}</span>"
|
289
|
+
end
|
290
|
+
@content<<"</td>"
|
291
|
+
end
|
292
|
+
@content<<"</tr>"
|
293
|
+
end
|
294
|
+
@content<<"</table>"
|
295
|
+
end
|
237
296
|
|
238
297
|
def get_data_from_cache configuration
|
239
298
|
cache = @@cache[configuration]
|
240
299
|
return cache[:data] if cache && cache[:index] == all_runs_in_configuration(configuration).size
|
241
300
|
calculate_data(configuration)
|
242
301
|
end
|
302
|
+
|
243
303
|
def calculate_data configuration
|
244
|
-
runs=
|
304
|
+
runs=last_n_runs_in_configuration(configuration,50)
|
305
|
+
#runs=all_runs_in_configuration(configuration)
|
245
306
|
successful=[]
|
246
307
|
failed=[]
|
247
308
|
not_executed=[]
|
248
309
|
counter = 0
|
249
|
-
runs.each do |r|
|
310
|
+
runs.reverse.each do |r|
|
250
311
|
fails=r.number_of_failed
|
251
312
|
no_exec = r.number_of_not_executed
|
252
313
|
#the scenarios array includes setup and teardown scripts as well - we want only the actual testcases
|
@@ -261,7 +322,7 @@ module RutemaWeb
|
|
261
322
|
end
|
262
323
|
#finds all the runs belonging to a specific configuration
|
263
324
|
def all_runs_in_configuration configuration
|
264
|
-
runs=Rutema::Model::Run.find(:all,:order=>"id
|
325
|
+
runs=Rutema::Model::Run.find(:all,:order=>"id ASC")
|
265
326
|
#find all runs beloging to this configuration
|
266
327
|
runs.select{|r| r.context[:config_file]==configuration if r.context.is_a?(Hash)} if configuration
|
267
328
|
end
|
@@ -272,15 +333,15 @@ module RutemaWeb
|
|
272
333
|
@content_title=content_title
|
273
334
|
@content=content
|
274
335
|
end
|
275
|
-
|
336
|
+
|
276
337
|
def runs page
|
277
338
|
page_setup "All runs",nil,"All runs"
|
278
339
|
|
279
340
|
dt=[]
|
280
|
-
total_pages=(Rutema::Model::Run.count/page_size)+1
|
341
|
+
total_pages=(Rutema::Model::Run.count/settings.page_size)+1
|
281
342
|
page_number=validated_page_number(page,total_pages)
|
282
343
|
|
283
|
-
runs=Rutema::Model::Run.find_on_page(page_number,page_size)
|
344
|
+
runs=Rutema::Model::Run.find_on_page(page_number,settings.page_size)
|
284
345
|
runs.each do |r|
|
285
346
|
dt<<[status_icon(r.status),run_summary(r),r.config_file]
|
286
347
|
end
|
@@ -288,7 +349,7 @@ module RutemaWeb
|
|
288
349
|
@content<<"<br/>"
|
289
350
|
@content<<run_page_link(page_number,total_pages)
|
290
351
|
end
|
291
|
-
|
352
|
+
|
292
353
|
def scenarios page
|
293
354
|
page_setup "All scenarios",panel_runs,"All scenarios"
|
294
355
|
runs=Hash.new
|
@@ -301,10 +362,10 @@ module RutemaWeb
|
|
301
362
|
runs[nm]<<sc.run.id
|
302
363
|
end
|
303
364
|
#the size of the hash is also the number of unique scenario names
|
304
|
-
total_pages=(runs.size / page_size)+1
|
365
|
+
total_pages=(runs.size / settings.page_size)+1
|
305
366
|
page_number=validated_page_number(page,total_pages)
|
306
367
|
#Ramaze::Log.debug("Getting scenarios for page #{page_number}")
|
307
|
-
scens=Rutema::Model::Scenario.find_on_page(page_number,page_size,conditions)
|
368
|
+
scens=Rutema::Model::Scenario.find_on_page(page_number,settings.page_size,conditions)
|
308
369
|
#and now build the table data
|
309
370
|
dt=Array.new
|
310
371
|
scens.each do |sc|
|
@@ -396,7 +457,7 @@ module RutemaWeb
|
|
396
457
|
conditions="run_id = :run_id AND name NOT LIKE '%_teardown' AND name NOT LIKE '%_setup'"
|
397
458
|
table=Rutema::Model::Scenario.report_table(:all,
|
398
459
|
:conditions=>[conditions,{:run_id=>run_id}],:except=>["run_id"],
|
399
|
-
:order=>"
|
460
|
+
:order=>"start_time ASC")
|
400
461
|
if table.empty?
|
401
462
|
ret<<"No scenarios for run #{run_id}"
|
402
463
|
else
|
@@ -425,7 +486,16 @@ module RutemaWeb
|
|
425
486
|
scenarios.each{|sc| failures+=1 unless sc.status=="success" }
|
426
487
|
return ((failures.to_f/scenarios.size)*100).round
|
427
488
|
end
|
428
|
-
|
489
|
+
|
490
|
+
def last_n_runs_in_configuration configuration,n
|
491
|
+
runs=all_runs_in_configuration(configuration)
|
492
|
+
runs.reverse!
|
493
|
+
if n<runs.size
|
494
|
+
return runs[-0,n]
|
495
|
+
else
|
496
|
+
return runs
|
497
|
+
end
|
498
|
+
end
|
429
499
|
end#SinatraApp
|
430
500
|
end#UI module
|
431
501
|
end
|
@@ -24,7 +24,7 @@
|
|
24
24
|
</div>
|
25
25
|
<div id="menu">
|
26
26
|
<div align="right" class="smallwhitetext" style="padding:9px;">
|
27
|
-
<a href="/">Home</a> | <a href="/run">Runs</a> | <a href="/scenario">Scenarios</a> | <a href="/statistics">Statistics</a>
|
27
|
+
<a href="/">Home</a> | <a href="/run">Runs</a> | <a href="/scenario">Scenarios</a> | <a href="/statistics">Statistics</a> | <a href="/timeline">Timeline</a>
|
28
28
|
</div>
|
29
29
|
</div>
|
30
30
|
<div id="submenu">
|
@@ -46,7 +46,7 @@
|
|
46
46
|
</div>
|
47
47
|
<div id="footer" class="smallgraytext">
|
48
48
|
rutemaweb v<%= RutemaWeb::Version::STRING %> | <a href="/">Home</a> | <a href="http://patir.rubyforge.org/rutema">about rutema</a> |
|
49
|
-
© 2008 -
|
49
|
+
© 2008 - 2010 <a href="http://www.braveworld.net/riva" target="_blank">Vassilis Rizopoulos</a>
|
50
50
|
</div>
|
51
51
|
</div>
|
52
52
|
</div>
|
@@ -25,7 +25,7 @@
|
|
25
25
|
</div>
|
26
26
|
<div id="menu">
|
27
27
|
<div align="right" class="smallwhitetext" style="padding:9px;">
|
28
|
-
<a href="/">Home</a> | <a href="/run">Runs</a> | <a href="/scenario">Scenarios</a> | <a href="/statistics">Statistics</a>
|
28
|
+
<a href="/">Home</a> | <a href="/run">Runs</a> | <a href="/scenario">Scenarios</a> | <a href="/statistics">Statistics</a> | <a href="/timeline">Timeline</a>
|
29
29
|
</div>
|
30
30
|
</div>
|
31
31
|
<div id="submenu">
|
@@ -46,7 +46,7 @@
|
|
46
46
|
</div>
|
47
47
|
<div id="footer" class="smallgraytext">
|
48
48
|
rutemaweb v<%= RutemaWeb::Version::STRING %> | <a href="/">Home</a> | <a href="http://patir.rubyforge.org/rutema">about rutema</a> |
|
49
|
-
© 2008 -
|
49
|
+
© 2008 - 2010 <a href="http://www.braveworld.net/riva" target="_blank">Vassilis Rizopoulos</a>
|
50
50
|
</div>
|
51
51
|
</div>
|
52
52
|
</div>
|
@@ -0,0 +1,49 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
2
|
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
3
|
+
<head>
|
4
|
+
<meta name="author" content="Vassilis Rizopoulos" />
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf8" />
|
6
|
+
<link rel="stylesheet" href="/css/style.css" type="text/css" />
|
7
|
+
<title><%=@title%></title>
|
8
|
+
</head>
|
9
|
+
<body>
|
10
|
+
<div id="page" align="center">
|
11
|
+
<div id="content" style="width:800px">
|
12
|
+
<div id="logo">
|
13
|
+
<div style="margin-top:70px" class="whitetitle">rutema</div>
|
14
|
+
</div>
|
15
|
+
<div id="topheader">
|
16
|
+
<div align="left" class="bodytext">
|
17
|
+
</div>
|
18
|
+
<div id="toplinks" class="smallgraytext">
|
19
|
+
</div>
|
20
|
+
</div>
|
21
|
+
<div id="menu">
|
22
|
+
<div align="right" class="smallwhitetext" style="padding:9px;">
|
23
|
+
<a href="/">Home</a> | <a href="/run">Runs</a> | <a href="/scenario">Scenarios</a> | <a href="/statistics">Statistics</a> | <a href="/timeline">Timeline</a>
|
24
|
+
</div>
|
25
|
+
</div>
|
26
|
+
<div id="submenu">
|
27
|
+
<div align="right" class="smallgraytext" style="padding:9px;"></div>
|
28
|
+
</div>
|
29
|
+
<div id="contenttext">
|
30
|
+
<div style="padding:10px">
|
31
|
+
<span class="titletext"><%=@content_title%></span>
|
32
|
+
</div>
|
33
|
+
<div class="bodytext" style="padding:12px;" align="justify"><%=@content%></div>
|
34
|
+
</div>
|
35
|
+
<div id="leftpanel">
|
36
|
+
<% if @panel_content && !@panel_content.empty? %>
|
37
|
+
<div align="justify" class="graypanel">
|
38
|
+
<%=@panel_content%>
|
39
|
+
</div>
|
40
|
+
<% end %>
|
41
|
+
</div>
|
42
|
+
<div id="footer" class="smallgraytext">
|
43
|
+
rutemaweb v<%= RutemaWeb::Version::STRING %> | <a href="/">Home</a> | <a href="http://patir.rubyforge.org/rutema">about rutema</a> |
|
44
|
+
© 2008 - 2010 <a href="http://www.braveworld.net/riva" target="_blank">Vassilis Rizopoulos</a>
|
45
|
+
</div>
|
46
|
+
</div>
|
47
|
+
</div>
|
48
|
+
</body>
|
49
|
+
</html>
|
metadata
CHANGED
@@ -1,7 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rutema_web
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 1
|
7
|
+
- 0
|
8
|
+
- 4
|
9
|
+
version: 1.0.4
|
5
10
|
platform: ruby
|
6
11
|
authors:
|
7
12
|
- Vassilis Rizopoulos
|
@@ -9,49 +14,79 @@ autorequire:
|
|
9
14
|
bindir: bin
|
10
15
|
cert_chain: []
|
11
16
|
|
12
|
-
date:
|
17
|
+
date: 2010-04-23 00:00:00 +03:00
|
13
18
|
default_executable: rutema_web
|
14
19
|
dependencies:
|
15
20
|
- !ruby/object:Gem::Dependency
|
16
21
|
name: rutema
|
17
|
-
|
18
|
-
|
19
|
-
version_requirements: !ruby/object:Gem::Requirement
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
20
24
|
requirements:
|
21
25
|
- - "="
|
22
26
|
- !ruby/object:Gem::Version
|
23
|
-
|
24
|
-
|
27
|
+
segments:
|
28
|
+
- 1
|
29
|
+
- 0
|
30
|
+
- 9
|
31
|
+
version: 1.0.9
|
32
|
+
type: :runtime
|
33
|
+
version_requirements: *id001
|
25
34
|
- !ruby/object:Gem::Dependency
|
26
35
|
name: sinatra
|
27
|
-
|
28
|
-
|
29
|
-
version_requirements: !ruby/object:Gem::Requirement
|
36
|
+
prerelease: false
|
37
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
30
38
|
requirements:
|
31
39
|
- - "="
|
32
40
|
- !ruby/object:Gem::Version
|
33
|
-
|
34
|
-
|
41
|
+
segments:
|
42
|
+
- 1
|
43
|
+
- 0
|
44
|
+
- 0
|
45
|
+
version: 1.0.0
|
46
|
+
type: :runtime
|
47
|
+
version_requirements: *id002
|
35
48
|
- !ruby/object:Gem::Dependency
|
36
49
|
name: ruport
|
37
|
-
|
38
|
-
|
39
|
-
version_requirements: !ruby/object:Gem::Requirement
|
50
|
+
prerelease: false
|
51
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
40
52
|
requirements:
|
41
53
|
- - ">="
|
42
54
|
- !ruby/object:Gem::Version
|
55
|
+
segments:
|
56
|
+
- 1
|
57
|
+
- 6
|
58
|
+
- 1
|
43
59
|
version: 1.6.1
|
44
|
-
|
60
|
+
type: :runtime
|
61
|
+
version_requirements: *id003
|
45
62
|
- !ruby/object:Gem::Dependency
|
46
|
-
name:
|
63
|
+
name: rubyforge
|
64
|
+
prerelease: false
|
65
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - ">="
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
segments:
|
70
|
+
- 2
|
71
|
+
- 0
|
72
|
+
- 4
|
73
|
+
version: 2.0.4
|
47
74
|
type: :development
|
48
|
-
|
49
|
-
|
75
|
+
version_requirements: *id004
|
76
|
+
- !ruby/object:Gem::Dependency
|
77
|
+
name: hoe
|
78
|
+
prerelease: false
|
79
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
50
80
|
requirements:
|
51
81
|
- - ">="
|
52
82
|
- !ruby/object:Gem::Version
|
53
|
-
|
54
|
-
|
83
|
+
segments:
|
84
|
+
- 2
|
85
|
+
- 6
|
86
|
+
- 0
|
87
|
+
version: 2.6.0
|
88
|
+
type: :development
|
89
|
+
version_requirements: *id005
|
55
90
|
description: |-
|
56
91
|
== DESCRIPTION:
|
57
92
|
rutema_web is the web frontend for rutema.
|
@@ -63,17 +98,12 @@ description: |-
|
|
63
98
|
== FEATURES/PROBLEMS:
|
64
99
|
|
65
100
|
== SYNOPSIS:
|
66
|
-
rutema_web
|
101
|
+
rutema_web config.yaml and browse to http://localhost:7000 for the glorious view
|
67
102
|
|
68
103
|
== REQUIREMENTS:
|
69
|
-
* patir (http://patir.rubyforge.org)
|
70
104
|
* rutema (http://patir.rubyforge.org/rutema)
|
71
|
-
* activerecord (http://ar.rubyonrails.com/)
|
72
|
-
* sqlite3 (http://rubyforge.org/projects/sqlite-ruby/)
|
73
105
|
* sinatra (http://www.sinatrarb.com/)
|
74
106
|
* ruport (http://rubyreports.org/)
|
75
|
-
* acts_as_reportable
|
76
|
-
* gruff/RMagick (optional, but needed if you want to see the statistics graphs)
|
77
107
|
email: riva@braveworld.net
|
78
108
|
executables:
|
79
109
|
- rutema_web
|
@@ -94,11 +124,11 @@ files:
|
|
94
124
|
- lib/rutema_web/gems.rb
|
95
125
|
- lib/rutema_web/main.rb
|
96
126
|
- lib/rutema_web/model.rb
|
97
|
-
- lib/rutema_web/ruport_formatter.rb
|
98
|
-
- lib/rutema_web/sinatra.rb
|
99
127
|
- lib/rutema_web/public/css/style.css
|
100
128
|
- lib/rutema_web/public/images/bg_menu.gif
|
101
129
|
- lib/rutema_web/public/images/bg_submenu.gif
|
130
|
+
- lib/rutema_web/public/images/left.png
|
131
|
+
- lib/rutema_web/public/images/right.png
|
102
132
|
- lib/rutema_web/public/images/run_error.png
|
103
133
|
- lib/rutema_web/public/images/run_ok.png
|
104
134
|
- lib/rutema_web/public/images/run_warn.png
|
@@ -106,14 +136,17 @@ files:
|
|
106
136
|
- lib/rutema_web/public/images/step_ok.png
|
107
137
|
- lib/rutema_web/public/images/step_warn.png
|
108
138
|
- lib/rutema_web/public/images/tie_logo.gif
|
109
|
-
- lib/rutema_web/public/images/left.png
|
110
|
-
- lib/rutema_web/public/images/right.png
|
111
139
|
- lib/rutema_web/public/js/folding.js
|
140
|
+
- lib/rutema_web/public/js/graph.js
|
112
141
|
- lib/rutema_web/public/js/jquery-1.3.2.min.js
|
113
142
|
- lib/rutema_web/public/js/jquery.flot.min.js
|
114
143
|
- lib/rutema_web/public/js/jquery.flot.stack.min.js
|
144
|
+
- lib/rutema_web/ruport_formatter.rb
|
145
|
+
- lib/rutema_web/sinatra.rb
|
115
146
|
- lib/rutema_web/views/flot.erb
|
116
147
|
- lib/rutema_web/views/main.erb
|
148
|
+
- lib/rutema_web/views/timeline.erb
|
149
|
+
- test/test_model.rb
|
117
150
|
has_rdoc: true
|
118
151
|
homepage:
|
119
152
|
licenses: []
|
@@ -128,18 +161,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
128
161
|
requirements:
|
129
162
|
- - ">="
|
130
163
|
- !ruby/object:Gem::Version
|
164
|
+
segments:
|
165
|
+
- 0
|
131
166
|
version: "0"
|
132
|
-
version:
|
133
167
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
134
168
|
requirements:
|
135
169
|
- - ">="
|
136
170
|
- !ruby/object:Gem::Version
|
171
|
+
segments:
|
172
|
+
- 0
|
137
173
|
version: "0"
|
138
|
-
version:
|
139
174
|
requirements: []
|
140
175
|
|
141
176
|
rubyforge_project: patir
|
142
|
-
rubygems_version: 1.3.
|
177
|
+
rubygems_version: 1.3.6
|
143
178
|
signing_key:
|
144
179
|
specification_version: 3
|
145
180
|
summary: rutema_web is the web frontend for rutema
|