kaya 0.0.9 → 0.0.10
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.
- checksums.yaml +4 -4
- data/lib/kaya/API/execution.rb +40 -32
- data/lib/kaya/API/suites.rb +16 -3
- data/lib/kaya/background_jobs/workers/execution_checker.rb +1 -1
- data/lib/kaya/cuba.rb +19 -19
- data/lib/kaya/database/mongo_connector.rb +13 -0
- data/lib/kaya/results/result.rb +9 -4
- data/lib/kaya/results/results.rb +15 -0
- data/lib/kaya/version.rb +1 -1
- data/lib/kaya/view/body.mote +1 -4
- data/lib/kaya/view/git_information.mote +0 -9
- data/lib/kaya/view/results/all.mote +29 -3
- data/lib/kaya/view/results/console.mote +4 -2
- data/lib/kaya/view/results/detailed_info.mote +10 -7
- data/lib/kaya/view/suites/suite.mote +20 -9
- data/lib/kaya/view/suites/suite_item.mote +20 -5
- data/lib/kaya/view/suites/suites.mote +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8c3297f1d73f1e546c0332257f9844b1e5744e2a
|
4
|
+
data.tar.gz: 9bc15c57ac5916db0ac45abf286820624eb83dc5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 81215d73a2e5768c6cf9883da57d729180a2a969d3bbcca611c3ef2b5ee1a101d5541b9ff7b33476fcc117484ecc40742f1f3893888121cdd9430ef338aafa4a
|
7
|
+
data.tar.gz: a773c5717f0db26358b3bede1f9b9fd38f7f3a82721b880e16225b3dc97dcaa01dbd24b02610fc0ccfaa684c69f8e3772408076451c4761bea9ddb66486b02e2
|
data/lib/kaya/API/execution.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
module Kaya
|
2
2
|
module API
|
3
3
|
class Execution
|
4
|
-
def self.start suite_name, query_string
|
4
|
+
def self.start suite_name, query_string, ip
|
5
5
|
$K_LOG.debug "Starting suite #{suite_name}" if $K_LOG
|
6
6
|
|
7
7
|
suite_name.gsub!("%20", " ")
|
@@ -29,7 +29,9 @@ module Kaya
|
|
29
29
|
|
30
30
|
suite = Kaya::Suites::Suite.get_suite_with(suite_name)
|
31
31
|
|
32
|
-
|
32
|
+
suite_is_ready_for_ip = !Kaya::Results.running_for_suite_id_and_ip?(suite.id, ip)
|
33
|
+
|
34
|
+
if suite_is_ready_for_ip
|
33
35
|
|
34
36
|
$K_LOG.debug "Suite #{suite_name} is ready to run" if $K_LOG
|
35
37
|
|
@@ -38,7 +40,8 @@ module Kaya
|
|
38
40
|
"suite" => {"id" => suite.id, "name" => suite.name},
|
39
41
|
"execution_name" => execution_name,
|
40
42
|
"custom_params" => custom_params,
|
41
|
-
"git_log" => git_log
|
43
|
+
"git_log" => git_log,
|
44
|
+
"ip" => ip
|
42
45
|
}
|
43
46
|
|
44
47
|
suite.last_result = Kaya::Execution.run!(execution_request_data) # Returns result_id
|
@@ -91,7 +94,7 @@ module Kaya
|
|
91
94
|
# Kill associated process to the running execution
|
92
95
|
# Sets as finished the result and associated suite as READY
|
93
96
|
#
|
94
|
-
def self.reset(result_id)
|
97
|
+
def self.reset(result_id, ip)
|
95
98
|
|
96
99
|
$K_LOG.debug "Reset execution request for #{result_id}"
|
97
100
|
|
@@ -99,35 +102,40 @@ module Kaya
|
|
99
102
|
|
100
103
|
suite = Kaya::Suites::Suite.get(result.suite_id)
|
101
104
|
|
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
|
-
|
105
|
+
#
|
106
|
+
if result.ip == ip # is the owner of execution
|
107
|
+
|
108
|
+
if result.process_running? or !result.finished? or !result.stopped?
|
109
|
+
begin
|
110
|
+
Kaya::Support::Processes.kill_by_result_id(result.id)
|
111
|
+
killed = true
|
112
|
+
$K_LOG.debug "Execution (id=#{results.id}) killed"
|
113
|
+
rescue => e
|
114
|
+
$K_LOG.error "#{e}#{e.backtrace}"
|
115
|
+
end
|
116
|
+
|
117
|
+
begin
|
118
|
+
Kaya::Support::FilesCleanner.delete_report_which_has(result.id)
|
119
|
+
$K_LOG.debug "Execution files(id=#{result.id}) cleanned"
|
120
|
+
cleanned = true
|
121
|
+
rescue
|
122
|
+
end
|
123
|
+
|
124
|
+
result.append_result_to_console_output!
|
125
|
+
result.save_report!
|
126
|
+
result.reset!("forced"); $K_LOG.debug "Execution stopped! Kaya restarted"
|
127
|
+
result.show_as = "pending"
|
128
|
+
result.save!
|
129
|
+
# Reset if suite is setted as "RUNNING" and its result_id value corresponds to the result reset request
|
130
|
+
suite.set_ready! if suite.last_result == result.id
|
131
|
+
if killed and cleanned
|
132
|
+
{"message" => "Execution stopped"}
|
133
|
+
else
|
134
|
+
{"message" => "Could not stop execution. Process killing: #{filled}. Files cleanned: #{celanned}"}
|
135
|
+
end
|
130
136
|
end
|
137
|
+
else
|
138
|
+
{"message" => "You are not the owner of this execution"}
|
131
139
|
end
|
132
140
|
end
|
133
141
|
|
data/lib/kaya/API/suites.rb
CHANGED
@@ -2,9 +2,11 @@ module Kaya
|
|
2
2
|
module API
|
3
3
|
module Suites
|
4
4
|
|
5
|
-
# @param [hash] options = {:running, :active}
|
5
|
+
# @param [hash] options = {:running, :active, :ip}
|
6
6
|
def self.list(options ={})
|
7
7
|
|
8
|
+
start = Time.now.to_f
|
9
|
+
|
8
10
|
response = {
|
9
11
|
"project_name" => Dir.pwd.split("/").last,
|
10
12
|
"size" => 0,
|
@@ -23,8 +25,19 @@ module Kaya
|
|
23
25
|
if suites.size.zero?
|
24
26
|
response["message"] = options[:running] ? "No running suites found" : "No suites found"
|
25
27
|
else
|
26
|
-
|
27
|
-
|
28
|
+
# Gets the executions for given ip
|
29
|
+
suites = suites.map{|suite_id| Kaya::Suites::Suite.get(suite_id).api_response}
|
30
|
+
|
31
|
+
suites = suites.map do |suite|
|
32
|
+
unless Kaya::Results.results_for_suite_id_and_ip(suite["_id"], options[:ip]).empty?
|
33
|
+
suite["status"]="RUNNING"
|
34
|
+
suite
|
35
|
+
else
|
36
|
+
suite
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
response["suites"] = suites
|
28
41
|
$K_LOG.debug "#{suites.size} retrieved in (#{Time.now.to_f - start} s)" if $K_LOG
|
29
42
|
|
30
43
|
response["size"] = suites.size
|
data/lib/kaya/cuba.rb
CHANGED
@@ -49,8 +49,8 @@ Cuba.define do
|
|
49
49
|
result = Kaya::Results::Result.get(result_id)
|
50
50
|
res.redirect "/#{HOSTNAME}/kaya/404/There%20is%20no%20result%20for%20id=#{result_id}" if result.nil?
|
51
51
|
result.mark_as_saw! if (result.finished? or result.stopped?)
|
52
|
-
template = Mote.parse(File.read("#{Kaya::View.path}/results/console.mote"),self, [:result])
|
53
|
-
res.write template.call(result:result)
|
52
|
+
template = Mote.parse(File.read("#{Kaya::View.path}/results/console.mote"),self, [:result, :ip])
|
53
|
+
res.write template.call(result:result, ip:request.ip)
|
54
54
|
end
|
55
55
|
|
56
56
|
|
@@ -67,32 +67,32 @@ Cuba.define do
|
|
67
67
|
end
|
68
68
|
|
69
69
|
on "#{HOSTNAME}/kaya/results/:result_id/reset" do |result_id|
|
70
|
-
result = Kaya::API::Execution.reset(result_id)
|
70
|
+
result = Kaya::API::Execution.reset(result_id, request.ip)
|
71
71
|
res.redirect "/#{HOSTNAME}/kaya/results?msg=#{result['message']}"
|
72
72
|
end
|
73
73
|
|
74
74
|
on "#{HOSTNAME}/kaya/results/suite/:suite_name" do |suite_name|
|
75
75
|
query_string = Kaya::Support::QueryString.new req
|
76
76
|
suite_name.gsub!("%20"," ")
|
77
|
-
template = Mote.parse(File.read("#{Kaya::View.path}/body.mote"),self, [:section, :query_string, :suite_name, :log_name])
|
78
|
-
res.write template.call(section:"Results", query_string:query_string, suite_name:suite_name, log_name:nil)
|
77
|
+
template = Mote.parse(File.read("#{Kaya::View.path}/body.mote"),self, [:section, :query_string, :suite_name, :log_name, :ip])
|
78
|
+
res.write template.call(section:"Results", query_string:query_string, suite_name:suite_name, log_name:nil, ip:request.ip)
|
79
79
|
end
|
80
80
|
|
81
81
|
on "#{HOSTNAME}/kaya/results/all" do
|
82
82
|
query_string = Kaya::Support::QueryString.new req
|
83
|
-
template = Mote.parse(File.read("#{Kaya::View.path}/body.mote"),self, [:section, :query_string, :suite_name, :log_name])
|
84
|
-
res.write template.call(section:"All Results", query_string:query_string, suite_name:nil, log_name:nil)
|
83
|
+
template = Mote.parse(File.read("#{Kaya::View.path}/body.mote"),self, [:section, :query_string, :suite_name, :log_name, :ip])
|
84
|
+
res.write template.call(section:"All Results", query_string:query_string, suite_name:nil, log_name:nil, ip:request.ip)
|
85
85
|
end
|
86
86
|
|
87
87
|
on "#{HOSTNAME}/kaya/results" do
|
88
88
|
query_string = Kaya::Support::QueryString.new req
|
89
|
-
template = Mote.parse(File.read("#{Kaya::View.path}/body.mote"),self, [:section, :query_string, :suite_name, :log_name])
|
90
|
-
res.write template.call(section:"Results", query_string:query_string, suite_name:nil, log_name:nil)
|
89
|
+
template = Mote.parse(File.read("#{Kaya::View.path}/body.mote"),self, [:section, :query_string, :suite_name, :log_name, :ip])
|
90
|
+
res.write template.call(section:"Results", query_string:query_string, suite_name:nil, log_name:nil, ip:request.ip)
|
91
91
|
end
|
92
92
|
|
93
93
|
on "#{HOSTNAME}/kaya/suites/:suite/run" do |suite_name|
|
94
94
|
query_string = Kaya::Support::QueryString.new req
|
95
|
-
result = Kaya::API::Execution.start suite_name, query_string.values
|
95
|
+
result = Kaya::API::Execution.start suite_name, query_string.values, request.ip
|
96
96
|
|
97
97
|
path = "/#{HOSTNAME}/kaya/suites"
|
98
98
|
path += "?msg=#{result['message']}. " if result["message"]
|
@@ -107,21 +107,21 @@ Cuba.define do
|
|
107
107
|
(Kaya::Support::Git.reset_hard and Kaya::Support::Git.pull) if Kaya::Support::Configuration.use_git?
|
108
108
|
Kaya::Suites.update_suites
|
109
109
|
suite_name.gsub!("%20"," ")
|
110
|
-
template = Mote.parse(File.read("#{Kaya::View.path}/body.mote"),self, [:section, :query_string, :suite_name, :log_name])
|
111
|
-
res.write template.call(section:"Test Suites", query_string:query_string, suite_name:suite_name, log_name:nil)
|
110
|
+
template = Mote.parse(File.read("#{Kaya::View.path}/body.mote"),self, [:section, :query_string, :suite_name, :log_name, :ip])
|
111
|
+
res.write template.call(section:"Test Suites", query_string:query_string, suite_name:suite_name, log_name:nil, ip:request.ip)
|
112
112
|
end
|
113
113
|
|
114
114
|
on "#{HOSTNAME}/kaya/suites" do
|
115
115
|
query_string = Kaya::Support::QueryString.new req
|
116
116
|
Kaya::Suites.update_suites
|
117
|
-
template = Mote.parse(File.read("#{Kaya::View.path}/body.mote"),self, [:section, :query_string, :suite_name, :log_name])
|
118
|
-
res.write template.call(section:"Test Suites", query_string:query_string, suite_name:nil, log_name:nil)
|
117
|
+
template = Mote.parse(File.read("#{Kaya::View.path}/body.mote"),self, [:section, :query_string, :suite_name, :log_name, :ip])
|
118
|
+
res.write template.call(section:"Test Suites", query_string:query_string, suite_name:nil, log_name:nil, ip:request.ip)
|
119
119
|
end
|
120
120
|
|
121
121
|
on "#{HOSTNAME}/kaya/logs/:log_name" do |log_name|
|
122
122
|
query_string = Kaya::Support::QueryString.new req
|
123
|
-
template = Mote.parse(File.read("#{Kaya::View.path}/body.mote"),self, [:section, :query_string, :suite_name, :log_name])
|
124
|
-
res.write template.call(section:"Logs", query_string:query_string, suite_name:nil, log_name:log_name)
|
123
|
+
template = Mote.parse(File.read("#{Kaya::View.path}/body.mote"),self, [:section, :query_string, :suite_name, :log_name, :ip])
|
124
|
+
res.write template.call(section:"Logs", query_string:query_string, suite_name:nil, log_name:log_name, ip:request.ip)
|
125
125
|
end
|
126
126
|
|
127
127
|
# ========================================================================
|
@@ -178,13 +178,13 @@ Cuba.define do
|
|
178
178
|
end
|
179
179
|
|
180
180
|
on "#{HOSTNAME}/kaya/api/results/:id/reset" do |result_id|
|
181
|
-
result = Kaya::API::Execution.reset(result_id)
|
181
|
+
result = Kaya::API::Execution.reset(result_id, request.ip)
|
182
182
|
res.write result.to_json
|
183
183
|
end
|
184
184
|
|
185
185
|
on "#{HOSTNAME}/kaya/api/suites/:suite/run" do |suite_name|
|
186
186
|
query_string = Kaya::Support::QueryString.new req
|
187
|
-
result = Kaya::API::Execution.start suite_name, query_string.values
|
187
|
+
result = Kaya::API::Execution.start suite_name, query_string.values, request.ip
|
188
188
|
res.write result.to_json
|
189
189
|
end
|
190
190
|
|
@@ -216,7 +216,7 @@ Cuba.define do
|
|
216
216
|
on "#{HOSTNAME}/kaya/api/suites" do
|
217
217
|
(Kaya::Support::Git.reset_hard and Kaya::Support::Git.pull) if Kaya::Support::Configuration.use_git?
|
218
218
|
Kaya::Suites.update_suites
|
219
|
-
output = Kaya::API::Suites.list({
|
219
|
+
output = Kaya::API::Suites.list({active:true, ip:request.ip})
|
220
220
|
res.write output.to_json
|
221
221
|
end
|
222
222
|
|
@@ -243,6 +243,15 @@ module Kaya
|
|
243
243
|
end
|
244
244
|
end
|
245
245
|
|
246
|
+
def self.results_for_suite_id_and_ip suite_id, ip
|
247
|
+
results = self.find_results_for_ip(ip)
|
248
|
+
if results
|
249
|
+
results.select{|result| result["suite"]["id"]==suite_id}
|
250
|
+
else
|
251
|
+
[]
|
252
|
+
end
|
253
|
+
end
|
254
|
+
|
246
255
|
def self.result_data_for_id(result_id)
|
247
256
|
@@results.find({"_id" => ensure_int(result_id)}).to_a.first
|
248
257
|
end
|
@@ -280,6 +289,10 @@ module Kaya
|
|
280
289
|
end
|
281
290
|
end
|
282
291
|
|
292
|
+
def self.find_results_for_ip ip
|
293
|
+
@@results.find({"ip" => ip}, :sort =>["started_at", -1]).to_a
|
294
|
+
end
|
295
|
+
|
283
296
|
def self.find_results_for_status status
|
284
297
|
all_actual_results = self.all_results
|
285
298
|
if !all_actual_results.empty?
|
data/lib/kaya/results/result.rb
CHANGED
@@ -26,7 +26,8 @@ module Kaya
|
|
26
26
|
:pid,
|
27
27
|
:last_check_time,
|
28
28
|
:configuration_values,
|
29
|
-
:timeout
|
29
|
+
:timeout,
|
30
|
+
:ip
|
30
31
|
|
31
32
|
attr_reader :console_output
|
32
33
|
|
@@ -65,6 +66,7 @@ module Kaya
|
|
65
66
|
@last_check_time = now_in_seconds
|
66
67
|
@execution_data = {}
|
67
68
|
@configuration_values = Kaya::Support::Configuration.pretty_configuration_values
|
69
|
+
@ip = data_for_result["ip"]
|
68
70
|
end
|
69
71
|
end
|
70
72
|
|
@@ -106,7 +108,8 @@ module Kaya
|
|
106
108
|
"pid" => pid,
|
107
109
|
"last_check_time" => last_check_time,
|
108
110
|
"execution_data" => execution_data,
|
109
|
-
"configuration_values" => configuration_values
|
111
|
+
"configuration_values" => configuration_values,
|
112
|
+
"ip" => ip
|
110
113
|
}
|
111
114
|
end
|
112
115
|
|
@@ -167,7 +170,6 @@ module Kaya
|
|
167
170
|
self.finished!
|
168
171
|
$K_LOG.debug "[#{@id}] Values updated" if $K_LOG
|
169
172
|
finished = true
|
170
|
-
|
171
173
|
elsif (self.seconds_without_changes > Kaya::Support::Configuration.execution_time_to_live)
|
172
174
|
self.finished_by_timeout!
|
173
175
|
finished = true
|
@@ -268,6 +270,8 @@ module Kaya
|
|
268
270
|
end
|
269
271
|
|
270
272
|
def append_result_to_console_output!
|
273
|
+
$K_LOG.debug "console retrived #{Time.now.to_i}" if $K_LOG
|
274
|
+
$K_LOG.debug "without changes #{self.seconds_without_changes}" if $K_LOG
|
271
275
|
if is_there_console_output_file?
|
272
276
|
begin
|
273
277
|
output = []
|
@@ -278,6 +282,7 @@ module Kaya
|
|
278
282
|
if (text.size > @console_output.size )
|
279
283
|
save_console_output(text)
|
280
284
|
@last_check_time = now_in_seconds
|
285
|
+
self.save!
|
281
286
|
end
|
282
287
|
true
|
283
288
|
rescue
|
@@ -445,7 +450,7 @@ module Kaya
|
|
445
450
|
end
|
446
451
|
|
447
452
|
# Returns the seconds that there is no console output changes only if it is not finished, else returns 0
|
448
|
-
# This is aimed to help to detect if execution is freezed (or
|
453
|
+
# This is aimed to help to detect if execution is freezed (or has a debugger statement)
|
449
454
|
def seconds_without_changes
|
450
455
|
(self.finished? or self.stopped?) ? 0 : (now_in_seconds - @last_check_time)
|
451
456
|
end
|
data/lib/kaya/results/results.rb
CHANGED
@@ -31,6 +31,21 @@ module Kaya
|
|
31
31
|
Kaya::Database::MongoConnector.find_results_for_key key
|
32
32
|
end
|
33
33
|
|
34
|
+
def self.all_results_for_ip ip_address
|
35
|
+
Kaya::Database::MongoConnector.find_results_for_ip ip_address
|
36
|
+
end
|
37
|
+
|
38
|
+
def self.results_for_suite_id_and_ip suite_id, ip
|
39
|
+
Kaya::Database::MongoConnector.results_for_suite_id_and_ip suite_id, ip
|
40
|
+
end
|
41
|
+
|
42
|
+
def self.running_for_suite_id_and_ip? suite_id, ip
|
43
|
+
results = self.results_for_suite_id_and_ip suite_id, ip
|
44
|
+
not results.select do |res|
|
45
|
+
res["status"]=="running"
|
46
|
+
end.empty?
|
47
|
+
end
|
48
|
+
|
34
49
|
# Resets all results with running status
|
35
50
|
def self.reset_defuncts
|
36
51
|
Kaya::Database::MongoConnector.all_results.select do |result|
|
data/lib/kaya/version.rb
CHANGED
data/lib/kaya/view/body.mote
CHANGED
@@ -4,9 +4,6 @@
|
|
4
4
|
|
5
5
|
% title = h1 = section.split.map{|w| w.capitalize}.join " "
|
6
6
|
|
7
|
-
|
8
|
-
<!--partials -->
|
9
|
-
|
10
7
|
% javascript = Mote.parse(File.read("#{Kaya::View.path}/javascript.mote"), self, []).call()
|
11
8
|
|
12
9
|
% styles = Mote.parse(File.read("#{Kaya::View.path}/styles.mote"), self, []).call()
|
@@ -20,7 +17,7 @@
|
|
20
17
|
|
21
18
|
% template_file_path = File.read("#{Kaya::View.path}/#{Kaya::View::Sections.path_for(section)}.mote")
|
22
19
|
|
23
|
-
% content = Mote.parse(template_file_path, self, [:query_string, :suite_name, :log_name]).call(query_string:query_string, suite_name:suite_name, log_name:log_name)
|
20
|
+
% content = Mote.parse(template_file_path, self, [:query_string, :suite_name, :log_name, :ip]).call(query_string:query_string, suite_name:suite_name, log_name:log_name, ip:ip)
|
24
21
|
|
25
22
|
% section = section.gsub(" ","_").downcase
|
26
23
|
|
@@ -13,13 +13,4 @@
|
|
13
13
|
</h4>
|
14
14
|
|
15
15
|
% end
|
16
|
-
% if section.downcase == "all results"
|
17
|
-
<div class='btn-group pull-right' role='group'>
|
18
|
-
<button type='button' class='btn btn-default' aria-label='Left Align' title='Toggle collapse' onclick="autoCollapse()" title='collapse all panels'>
|
19
|
-
<div id='collapse_icon'>
|
20
|
-
<span class='glyphicon glyphicon-minus' aria-hidden='true' style='font-size:18px;'></span>
|
21
|
-
</div>
|
22
|
-
</button>
|
23
|
-
</div>
|
24
|
-
% end
|
25
16
|
</div>
|
@@ -1,6 +1,7 @@
|
|
1
1
|
<?
|
2
2
|
key = query_string.keyword if (query_string.keyword and !query_string.keyword.empty?)
|
3
3
|
status = query_string.status if (query_string.status and !query_string.status.empty?)
|
4
|
+
mine = query_string.mine if query_string.mine
|
4
5
|
|
5
6
|
results = Kaya::API::Results.show()
|
6
7
|
results_list = results["results"]
|
@@ -21,7 +22,22 @@
|
|
21
22
|
|
22
23
|
if status
|
23
24
|
results_list.select! do |res|
|
24
|
-
res["status"].downcase==status.downcase
|
25
|
+
by_status = res["status"].downcase==status.downcase
|
26
|
+
by_first_part_summary = res["summary"].split("step").first.downcase.include? status.downcase
|
27
|
+
first_part = res["summary"].split("step").first
|
28
|
+
if first_part
|
29
|
+
scenarios = first_part.scan(/\(\d.+\)/).first
|
30
|
+
if scenarios
|
31
|
+
by_partial_summary = scenarios.scan(/[a-z]+/).first == status
|
32
|
+
end
|
33
|
+
end
|
34
|
+
by_status or (by_first_part_summary and by_partial_summary)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
if mine
|
39
|
+
results_list.select! do |res|
|
40
|
+
res["ip"] == ip
|
25
41
|
end
|
26
42
|
end
|
27
43
|
|
@@ -50,14 +66,24 @@
|
|
50
66
|
% if key or status
|
51
67
|
<a class='btn btn-danger' href='/{{Kaya::Support::Configuration.hostname}}/kaya/results/all' role='button'>Clear</a>
|
52
68
|
% end
|
69
|
+
<input type='checkbox' {{'checked="checked"' if mine=="on"}} name="mine" onclick="form.submit();" /><label> Only mine</label>
|
70
|
+
|
71
|
+
<div class='btn-group pull-right' role='group'>
|
72
|
+
<button type='button' class='btn btn-default' aria-label='Left Align' title='Toggle collapse' onclick="autoCollapse()" title='collapse all panels'>
|
73
|
+
<div id='collapse_icon'>
|
74
|
+
<span class='glyphicon glyphicon-minus' aria-hidden='true' style='font-size:18px;'></span>
|
75
|
+
</div>
|
76
|
+
</button>
|
77
|
+
</div>
|
53
78
|
</form>
|
79
|
+
|
54
80
|
<br>
|
55
81
|
<p style='text-align:right'>{{results_size_text}}</p>
|
56
82
|
</div>
|
57
83
|
|
58
84
|
% if results_list.size > 0
|
59
|
-
% result_info = Mote.parse(File.read("#{Kaya::View.path}/results/detailed_info.mote"), self, [:result])
|
85
|
+
% result_info = Mote.parse(File.read("#{Kaya::View.path}/results/detailed_info.mote"), self, [:result, :ip])
|
60
86
|
% results_list.each do |result_data|
|
61
|
-
{{result_info.call(result:result_data)}}
|
87
|
+
{{result_info.call(result:result_data, ip:ip)}}
|
62
88
|
% end
|
63
89
|
% end
|
@@ -67,8 +67,10 @@ javascript = Mote.parse(File.read("#{Kaya::View.path}/javascript.mote"), self, [
|
|
67
67
|
<a href='#' class='label label-warning' onclick="window.open('/{{Kaya::Support::Configuration.hostname}}/kaya/api/results/{{result.id}}/data', '_blank', 'toolbar=no, scrollbars=yes, resizable=yes, top=300, left=300, width=800, height=600');" class='btn btn-default'>
|
68
68
|
Execution Data</a>
|
69
69
|
% unless result.status =~ /finished|stopped/
|
70
|
-
|
71
|
-
|
70
|
+
% if result.ip == ip
|
71
|
+
<a href='#' onclick="getAndClose('/{{Kaya::Support::Configuration.hostname}}/kaya/results/{{result.id}}/reset');" class='label label-danger'>
|
72
|
+
Stop execution</a>
|
73
|
+
% end
|
72
74
|
% end
|
73
75
|
</div>
|
74
76
|
</h6>
|
@@ -5,13 +5,6 @@
|
|
5
5
|
<div class='panel-heading' data-toggle='collapse' data-target='#{{result["_id"]}}'>
|
6
6
|
<h4><small>Execution name <b>{{result["execution_name"]}}</b> (Result id: {{result["_id"]}})</small></h4></div>
|
7
7
|
<div class='panel-body collapse in' id='{{result["_id"]}}'>
|
8
|
-
% unless result["status"] =~ /finished|stopped/
|
9
|
-
<div class='pull-right' title='It seems that the execution gone wrong. Click here to force execution stop'>
|
10
|
-
<a href='/{{Kaya::Support::Configuration.hostname}}/kaya/results/{{result["_id"]}}/reset' class='label label-danger'>
|
11
|
-
Stop execution
|
12
|
-
</a>
|
13
|
-
</div>
|
14
|
-
% end
|
15
8
|
|
16
9
|
<table class="table">
|
17
10
|
<tbody>
|
@@ -105,6 +98,16 @@
|
|
105
98
|
Raw
|
106
99
|
</a>
|
107
100
|
|
101
|
+
% unless result["status"] =~ /finished|stopped/
|
102
|
+
% if result["ip"]==ip
|
103
|
+
|
104
|
+
<a href='/{{Kaya::Support::Configuration.hostname}}/kaya/results/{{result["_id"]}}/reset' class='btn btn-danger'>
|
105
|
+
Stop execution
|
106
|
+
</a>
|
107
|
+
|
108
|
+
% end
|
109
|
+
% end
|
110
|
+
|
108
111
|
|
109
112
|
</div>
|
110
113
|
</div>
|
@@ -1,8 +1,19 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
<?
|
2
|
+
last_result_for_ip = Kaya::Results.results_for_suite_id_and_ip(suite["_id"], ip).first
|
3
|
+
status = if last_result_for_ip
|
4
|
+
last_result_for_ip["status"]=="running" ? "running" : "finished"
|
5
|
+
else
|
6
|
+
"READY"
|
7
|
+
end
|
8
|
+
|
9
|
+
color = Kaya::View.color(status)
|
10
|
+
|
11
|
+
?>
|
12
|
+
<div class='starter-template'>
|
13
|
+
<div class='panel panel-{{color}}'>
|
3
14
|
<div class='panel-heading' data-toggle='collapse' data-target='#{{suite["name"].gsub(' ','')}}'>
|
4
15
|
<h4 class='panel-title'>{{suite["name"]}}</h4>
|
5
|
-
%
|
16
|
+
% if status=="running"
|
6
17
|
<div class="spinner">
|
7
18
|
<div class="bounce1"></div>
|
8
19
|
<div class="bounce2"></div>
|
@@ -16,19 +27,19 @@
|
|
16
27
|
<li class='list-group-item'>
|
17
28
|
Command: {{suite["command"]}}
|
18
29
|
</li>
|
19
|
-
% if
|
20
|
-
% unless
|
30
|
+
% if last_result_for_ip
|
31
|
+
% unless status == "running"
|
21
32
|
<li class='list-group-item'>
|
22
|
-
Last result: {{Kaya::View.label_color_for_result_id
|
33
|
+
Last result: {{Kaya::View.label_color_for_result_id last_result_for_ip["_id"]}}
|
23
34
|
</li>
|
24
35
|
<li class='list-group-item'>
|
25
|
-
Started on: {{Kaya::Support::TimeHelper.formatted_time_for(Kaya::Results::Result.get(
|
36
|
+
Started on: {{Kaya::Support::TimeHelper.formatted_time_for(Kaya::Results::Result.get(last_result_for_ip["_id"]).started_at)}}
|
26
37
|
</li>
|
27
38
|
% end
|
28
39
|
% end
|
29
|
-
% if
|
40
|
+
% if status == "running"
|
30
41
|
<li class='list-group-item'>
|
31
|
-
<a href='#' class='btn btn-info' onclick="refreshAndOpen('/{{Kaya::Support::Configuration.hostname}}/kaya/results/log/{{
|
42
|
+
<a href='#' class='btn btn-info' onclick="refreshAndOpen('/{{Kaya::Support::Configuration.hostname}}/kaya/results/log/{{last_result_for_ip["_id"]}}');">
|
32
43
|
See progress
|
33
44
|
</a>
|
34
45
|
</li>
|
@@ -1,10 +1,25 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
<?
|
2
|
+
last_result_for_ip = Kaya::Results.results_for_suite_id_and_ip(suite["_id"], ip).first
|
3
|
+
status = if last_result_for_ip
|
4
|
+
if last_result_for_ip["status"]=="running"
|
5
|
+
"running"
|
6
|
+
else
|
7
|
+
"finished"
|
8
|
+
end
|
9
|
+
else
|
10
|
+
"READY"
|
11
|
+
end
|
12
|
+
|
13
|
+
color = Kaya::View.color(status)
|
14
|
+
|
15
|
+
?>
|
16
|
+
<div class='starter-template'>
|
17
|
+
<div class='panel panel-{{color}}'>
|
3
18
|
<div class='panel-heading'">
|
4
19
|
<h3 class='panel-title' onclick="goClean('/{{Kaya::Support::Configuration.hostname}}/kaya/suites/{{suite["name"].gsub(' ','%20')}}');">
|
5
20
|
{{suite["name"]}}
|
6
21
|
</h3>
|
7
|
-
%
|
22
|
+
% if status=="running"
|
8
23
|
<div class="spinner">
|
9
24
|
<div class="bounce1"></div>
|
10
25
|
<div class="bounce2"></div>
|
@@ -21,8 +36,8 @@
|
|
21
36
|
<a href='#' title='{{suite["info"]}}' class='label label-default' aria-hidden='true' data-toggle='modal' data-target='#myModal' onclick="javascript:info('Information about {{suite["name"]}}','{{suite["info"].gsub('\n','<br>')}}', null);">
|
22
37
|
Information</a>
|
23
38
|
% end
|
24
|
-
% if
|
25
|
-
<a href='#' title='See execution progress' class='label label-warning' onclick="refreshAndOpen('/{{Kaya::Support::Configuration.hostname}}/kaya/results/log/{{
|
39
|
+
% if status=="running"
|
40
|
+
<a href='#' title='See execution progress' class='label label-warning' onclick="refreshAndOpen('/{{Kaya::Support::Configuration.hostname}}/kaya/results/log/{{last_result_for_ip["_id"]}}');">
|
26
41
|
See progress</a>
|
27
42
|
% end
|
28
43
|
</div>
|
@@ -8,13 +8,13 @@
|
|
8
8
|
% end
|
9
9
|
% if number_of_suites > 0
|
10
10
|
% if suite_name
|
11
|
-
% suite_template = Mote.parse(File.read("#{Kaya::View.path}/suites/suite.mote"), self, [:suite])
|
11
|
+
% suite_template = Mote.parse(File.read("#{Kaya::View.path}/suites/suite.mote"), self, [:suite, :ip])
|
12
12
|
% else
|
13
|
-
% suite_template = Mote.parse(File.read("#{Kaya::View.path}/suites/suite_item.mote"), self, [:suite])
|
13
|
+
% suite_template = Mote.parse(File.read("#{Kaya::View.path}/suites/suite_item.mote"), self, [:suite, :ip])
|
14
14
|
% end
|
15
15
|
% suites_list = suites_list["suites"]
|
16
16
|
% suites_list.select!{|suite| suite["name"]==suite_name} if suite_name
|
17
17
|
% suites_list.each do |suite_data|
|
18
|
-
{{suite_template.call(suite:suite_data)}}
|
18
|
+
{{suite_template.call(suite:suite_data, ip:ip)}}
|
19
19
|
% end
|
20
20
|
% end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kaya
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roman Rodriguez
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-04-
|
11
|
+
date: 2015-04-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|