qat-reporter 6.1.1 → 6.1.2
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/qat/formatter/time_measurements.rb +50 -28
- data/lib/qat/reporter/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: db3a0b385f5f2834c14451dc31112a19c3d0a47618ae568c725a79e921d0c1f6
|
4
|
+
data.tar.gz: b99572aa94b48fb9d1db55fce074cbb3860d0fa437d1ce4c8e05bff285a242fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 661ca8679e1d424c8f7a72c07ac6aebf3402fac2d49deaa84b2dbc5fd365ea60cb0a788f9ee063c138016a3284fc5325203ab3533ac3a61296d6e3575903d4e7
|
7
|
+
data.tar.gz: 60ec0c6498f8d64380595e93d9220a0e81614af962429e296f6bfbaa7f74fe9f8ee2059004005d7115dd471866b71793fc7015122cc0adc5064f1bceb0dd3c8f
|
@@ -40,7 +40,7 @@ module QAT
|
|
40
40
|
name: [],
|
41
41
|
tags: [],
|
42
42
|
timestamp: [],
|
43
|
-
|
43
|
+
test_runs: []
|
44
44
|
}
|
45
45
|
end
|
46
46
|
|
@@ -73,7 +73,7 @@ module QAT
|
|
73
73
|
name: @current_scenario,
|
74
74
|
tags: [],
|
75
75
|
timestamp: @current_scenario_timestamp,
|
76
|
-
|
76
|
+
test_runs: []
|
77
77
|
}
|
78
78
|
end
|
79
79
|
end
|
@@ -85,7 +85,7 @@ module QAT
|
|
85
85
|
name: @current_scenario,
|
86
86
|
tags: [],
|
87
87
|
timestamp: @current_scenario_timestamp,
|
88
|
-
|
88
|
+
test_runs: []
|
89
89
|
}
|
90
90
|
end
|
91
91
|
|
@@ -102,36 +102,37 @@ module QAT
|
|
102
102
|
measurements = []
|
103
103
|
end
|
104
104
|
|
105
|
+
test_run_info = {
|
106
|
+
id: test_run_id,
|
107
|
+
timestamp: Time.now.strftime("%FT%T%z"),
|
108
|
+
measurements: []
|
109
|
+
}
|
110
|
+
|
105
111
|
unless measurements == [] || measurements == {}
|
106
112
|
measurements.each do |id, measure|
|
107
113
|
@measurement_id = id
|
108
114
|
@measurement_name = measure[:name]
|
109
|
-
end
|
110
115
|
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
}
|
124
|
-
}
|
125
|
-
]
|
126
|
-
}
|
127
|
-
|
128
|
-
if @current_scenario.is_a?(::Cucumber::Core::Ast::ScenarioOutline)
|
129
|
-
@outline_scenario_info[:test_run] << test_run_info
|
130
|
-
else
|
131
|
-
@current_scenario_info[:test_run] << test_run_info
|
116
|
+
unless @measurement_id.nil?
|
117
|
+
measurements = {
|
118
|
+
id: @measurement_id,
|
119
|
+
name: @measurement_name,
|
120
|
+
timestamp: Time.now.strftime("%FT%T%z"),
|
121
|
+
time: {
|
122
|
+
secs: duration,
|
123
|
+
human: human_duration
|
124
|
+
}
|
125
|
+
}
|
126
|
+
|
127
|
+
test_run_info[:measurements] << measurements
|
132
128
|
end
|
133
129
|
end
|
134
130
|
end
|
131
|
+
if @current_scenario.is_a?(::Cucumber::Core::Ast::ScenarioOutline)
|
132
|
+
@outline_scenario_info[:test_runs] << test_run_info
|
133
|
+
else
|
134
|
+
@current_scenario_info[:test_runs] << test_run_info
|
135
|
+
end
|
135
136
|
end
|
136
137
|
|
137
138
|
#@api private
|
@@ -156,15 +157,31 @@ module QAT
|
|
156
157
|
#@api private
|
157
158
|
def after_feature(*_)
|
158
159
|
@indexes = []
|
160
|
+
@indexes_test_runs = []
|
159
161
|
@scenarios = @current_feature_info[:scenarios]
|
162
|
+
|
160
163
|
@scenarios.each_with_index do |key, value|
|
161
|
-
|
162
|
-
|
164
|
+
test_run = key[:test_runs]
|
165
|
+
#Verifies if exist measures in a test_run
|
166
|
+
test_run.each_with_index do |key, value|
|
167
|
+
if key[:measurements].empty?
|
168
|
+
@indexes << value
|
169
|
+
end
|
170
|
+
end
|
171
|
+
#Deletes the empty measures
|
172
|
+
@indexes.reverse!.each do |v|
|
173
|
+
test_run.delete_at(v)
|
174
|
+
end
|
175
|
+
#Verifies if exist test_runs in a scenarios
|
176
|
+
if key[:test_runs].empty?
|
177
|
+
@indexes_test_runs << value
|
163
178
|
end
|
164
179
|
end
|
165
|
-
|
180
|
+
#Delete empty test runs:
|
181
|
+
@indexes_test_runs.reverse!.each do |v|
|
166
182
|
@current_feature_info[:scenarios].delete_at(v)
|
167
183
|
end
|
184
|
+
|
168
185
|
@json_content << @current_feature_info unless @scenarios.empty?
|
169
186
|
end
|
170
187
|
|
@@ -175,6 +192,11 @@ module QAT
|
|
175
192
|
|
176
193
|
private
|
177
194
|
|
195
|
+
def format_duration(seconds)
|
196
|
+
m, s = seconds.divmod(60)
|
197
|
+
"#{m}m #{'%.f' % s}s"
|
198
|
+
end
|
199
|
+
|
178
200
|
# Writes results to a JSON file
|
179
201
|
def publish_result
|
180
202
|
@io.puts(JSON.pretty_generate(@json_content))
|
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.1.
|
4
|
+
version: 6.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- QAT
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-09-
|
11
|
+
date: 2019-09-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: qat-cucumber
|