Skip to content

Commit 1c99bfb

Browse files
committed
unit test parse
1 parent 0f724c5 commit 1c99bfb

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

app/lib/client/s3/config_objects.rb

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ def retrieve_report(path)
243243
def get_unit_test_results(path)
244244
table = AdminUI::FilterTable.new(
245245
columns: [
246-
AdminUI::Column.new(:path, header: 'path'),
246+
AdminUI::Column.new(:Route, header: 'Route'),
247247
AdminUI::Column.new(:Result, header: 'Result'),
248248
AdminUI::Column.new(:Rows, header: 'Rows', cssclass: 'int'),
249249
AdminUI::Column.new(:Status, header: 'Status Code', cssclass: 'int'),
@@ -255,12 +255,9 @@ def get_unit_test_results(path)
255255
)
256256
row = {}
257257
retrieve_report(path).each_line do |line|
258-
if line.start_with?('/')
259-
row[:status] = 'FAIL' if row[:Result] == 'ERROR' || row.fetch(:Status, 0) >= 400
260-
table.add_row(AdminUI::Row.make_row(table.columns, row)) unless row.empty?
261-
row = { path: line.strip, status: 'PASS' }
262-
next
263-
end
258+
next unless line.start_with?('Route:')
259+
260+
row = { status: 'PASS' }
264261
line.strip.split(';').each do |kv|
265262
k, v = kv.split(': ')
266263
k = k.strip.to_sym
@@ -273,6 +270,8 @@ def get_unit_test_results(path)
273270
end
274271
row[k] = v
275272
end
273+
row[:status] = 'FAIL' if row[:Result] == 'ERROR' || row.fetch(:Status, 0) >= 400
274+
table.add_row(AdminUI::Row.make_row(table.columns, row)) unless row.empty?
276275
end
277276
table.add_row(AdminUI::Row.make_row(table.columns, row)) unless row.empty?
278277
table

0 commit comments

Comments
 (0)