Skip to content

Commit 2079d97

Browse files
committed
[full ci]
1 parent 5dd46ee commit 2079d97

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

features/steps/unity_steps.rb

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -157,14 +157,14 @@ def check_span_first_class(span_name, expected)
157157

158158
def check_valid_percentage(value, field_name, attribute_name, request_type)
159159
Maze.check.operator(
160-
value,
161-
:>=,
160+
value,
161+
:>=,
162162
0.0,
163163
"Attribute '#{attribute_name}' in '#{field_name}' is less than 0% for request type '#{request_type}': #{value}"
164164
)
165165
Maze.check.operator(
166-
value,
167-
:<=,
166+
value,
167+
:<=,
168168
100.0,
169169
"Attribute '#{attribute_name}' in '#{field_name}' is greater than 100% for request type '#{request_type}': #{value}"
170170
)
@@ -221,17 +221,17 @@ def check_valid_percentage(value, field_name, attribute_name, request_type)
221221
When('the {request_type} payload field {string} is an array with at least {int} elements') do |request_type, field_name, min_count|
222222
list = Maze::Server.list_for(request_type)
223223
array_value = Maze::Helper.read_key_path(list.current[:body], field_name)
224-
224+
225225
Maze.check.not_nil(
226-
array_value,
226+
array_value,
227227
"Field '#{field_name}' not found in request type '#{request_type}'"
228228
)
229-
229+
230230
Maze.check.true(
231-
array_value.is_a?(Array),
231+
array_value.is_a?(Array),
232232
"Field '#{field_name}' is not an array in request type '#{request_type}', got: #{array_value.class}"
233233
)
234-
234+
235235
actual_count = array_value.length
236236
Maze.check.operator(
237237
actual_count,
@@ -292,3 +292,11 @@ def stop_app
292292
raise "Platform #{platform} has not been considered"
293293
end
294294
end
295+
296+
def spans_from_request_list(list)
297+
list.remaining
298+
.flat_map { |req| req[:body]['resourceSpans'] }
299+
.flat_map { |r| r['scopeSpans'] }
300+
.flat_map { |s| s['spans'] }
301+
.select { |s| !s.nil? }
302+
end

0 commit comments

Comments
 (0)