qat-reporter 6.1.8 → 6.2.0
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 46b13863dc496be2bf36713f57242e92c48497fdbeafcbd44208b1ef4a5b80fa
|
4
|
+
data.tar.gz: 18e26f543d13d310471a383585bdec97c09535d6fff24ef2e6a39b7ccf74b1a9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bf7ca8f3877860433f5544cb96e4356539b035d609ee0b52a4b4b6c64bbf10ffdea2b8a5a952a39fbf755276194162dbc770e001c564c324301996f8da5897cc
|
7
|
+
data.tar.gz: deee1ceed24cd3ace77c84aefec17747e5309d07e943217b6af317ea9eb9271c1ebe0972b14471a4257465a6acaeb0e8c2cde3c1e4eb2277cd6cbaf850f974b2
|
@@ -67,7 +67,11 @@ module QAT
|
|
67
67
|
#@api private
|
68
68
|
def after_test_case(_, status)
|
69
69
|
test_status = if status.is_a? ::Cucumber::Core::Test::Result::Passed
|
70
|
-
|
70
|
+
if QAT::Reporter.const_defined?('Times')
|
71
|
+
Times.test_sla_status
|
72
|
+
else
|
73
|
+
"passed"
|
74
|
+
end
|
71
75
|
elsif status.is_a? ::Cucumber::Core::Test::Result::Failed
|
72
76
|
"failed"
|
73
77
|
else
|
data/lib/qat/reporter/times.rb
CHANGED
@@ -152,11 +152,20 @@ module QAT
|
|
152
152
|
|
153
153
|
end_time = QAT["#{label}_end".to_sym] || Time.now
|
154
154
|
|
155
|
+
measure_duration = end_time.to_f - start_time.to_f
|
156
|
+
|
157
|
+
warn_sla, error_sla, status_sla = sla_info(label, measure_duration)
|
158
|
+
|
155
159
|
list[label] = {
|
156
160
|
name: measure_description(label),
|
157
161
|
start: start_time,
|
158
162
|
end: end_time,
|
159
|
-
duration:
|
163
|
+
duration: measure_duration,
|
164
|
+
sla: {
|
165
|
+
warn: warn_sla,
|
166
|
+
error: error_sla,
|
167
|
+
status: status_sla
|
168
|
+
}
|
160
169
|
}
|
161
170
|
|
162
171
|
list
|
@@ -167,25 +176,77 @@ module QAT
|
|
167
176
|
duration = measure[:duration]
|
168
177
|
|
169
178
|
{
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
179
|
+
"message" => "partial time execution",
|
180
|
+
"_test_id" => test_id,
|
181
|
+
"_id" => id,
|
182
|
+
"_name" => measure[:name],
|
183
|
+
"_time" => {
|
184
|
+
"secs" => duration,
|
185
|
+
"human" => human_formatted_time(duration)
|
186
|
+
},
|
187
|
+
"_os" => {
|
188
|
+
"name" => QAT[:os_name],
|
189
|
+
"version" => QAT[:os_version]
|
190
|
+
},
|
191
|
+
"_browser" => {
|
192
|
+
"name" => QAT[:browser_name],
|
193
|
+
"version" => QAT[:browser_version]
|
194
|
+
}
|
186
195
|
}.deep_compact
|
187
196
|
end
|
188
197
|
|
198
|
+
|
199
|
+
def self.measure_description(key)
|
200
|
+
description = if QAT.configuration.dig(:qat, :reporter, :times, key).is_a?(Hash)
|
201
|
+
QAT.configuration.dig(:qat, :reporter, :times, key, :name)
|
202
|
+
else
|
203
|
+
warn "[WARN] DEPRECATED: Measurements definition without limits will be removed in a 7.0 version, please use following configuration instead:\nmeasure_id:\n name: Test measure\n sla_warn: 10\n sla_error: 15"
|
204
|
+
QAT.configuration.dig(:qat, :reporter, :times, key)
|
205
|
+
end
|
206
|
+
|
207
|
+
raise NoLabelInConfig.new "No description was found in configuration file for key '#{key}'!" unless description
|
208
|
+
description
|
209
|
+
end
|
210
|
+
|
211
|
+
def self.sla_info(key, duration)
|
212
|
+
if QAT.configuration.dig(:qat, :reporter, :times, key).is_a?(Hash)
|
213
|
+
warn_sla = QAT.configuration.dig(:qat, :reporter, :times, key, :sla_warn)&.to_f
|
214
|
+
error_sla = QAT.configuration.dig(:qat, :reporter, :times, key, :sla_error)&.to_f
|
215
|
+
end
|
216
|
+
|
217
|
+
|
218
|
+
status = if error_sla && duration > error_sla
|
219
|
+
"Error"
|
220
|
+
elsif warn_sla && duration > warn_sla
|
221
|
+
"Warning"
|
222
|
+
else
|
223
|
+
"Passed"
|
224
|
+
end
|
225
|
+
|
226
|
+
return warn_sla, error_sla, status
|
227
|
+
end
|
228
|
+
|
229
|
+
|
230
|
+
def self.test_sla_status
|
231
|
+
measures = get_measures
|
232
|
+
measures.any? do |measure_key, info|
|
233
|
+
sla_status = info.dig(:sla, :status)
|
234
|
+
|
235
|
+
test_status = case sla_status
|
236
|
+
when "Passed"
|
237
|
+
"passed"
|
238
|
+
when "Warning"
|
239
|
+
"passed with SLA Warning"
|
240
|
+
else
|
241
|
+
"passed with SLA Error"
|
242
|
+
end
|
243
|
+
|
244
|
+
log.debug "SLA status for measure with key: #{measure_key} is '#{test_status}'"
|
245
|
+
return test_status
|
246
|
+
end
|
247
|
+
"passed"
|
248
|
+
end
|
249
|
+
|
189
250
|
#No start time value error class
|
190
251
|
class NoStartTimeError < StandardError
|
191
252
|
end
|
@@ -195,14 +256,6 @@ module QAT
|
|
195
256
|
#No label in yml configuration error class
|
196
257
|
class NoLabelInConfig < StandardError
|
197
258
|
end
|
198
|
-
|
199
|
-
private
|
200
|
-
|
201
|
-
def self.measure_description(key)
|
202
|
-
description = QAT.configuration.dig(:qat, :reporter, :times, key)
|
203
|
-
raise NoLabelInConfig.new "No description was found in configuration file for key '#{key}'!" unless description
|
204
|
-
description
|
205
|
-
end
|
206
259
|
end
|
207
260
|
end
|
208
261
|
end
|
data/lib/qat/reporter/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: qat-reporter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.
|
4
|
+
version: 6.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- QAT
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-10-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: qat-cucumber
|
@@ -59,9 +59,6 @@ dependencies:
|
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '6.0'
|
62
|
-
- - ">="
|
63
|
-
- !ruby/object:Gem::Version
|
64
|
-
version: 6.0.1
|
65
62
|
type: :development
|
66
63
|
prerelease: false
|
67
64
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -69,9 +66,6 @@ dependencies:
|
|
69
66
|
- - "~>"
|
70
67
|
- !ruby/object:Gem::Version
|
71
68
|
version: '6.0'
|
72
|
-
- - ">="
|
73
|
-
- !ruby/object:Gem::Version
|
74
|
-
version: 6.0.1
|
75
69
|
description: |2
|
76
70
|
QAT Reporter is a collection of tool for generating test report information such as:
|
77
71
|
- Requirement Coverage
|
@@ -117,7 +111,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
117
111
|
- !ruby/object:Gem::Version
|
118
112
|
version: '0'
|
119
113
|
requirements: []
|
120
|
-
|
114
|
+
rubyforge_project:
|
115
|
+
rubygems_version: 2.7.7
|
121
116
|
signing_key:
|
122
117
|
specification_version: 4
|
123
118
|
summary: Utility for Test Reports.
|