debian-mirror-gitlab/app/serializers/test_suite_entity.rb

20 lines
484 B
Ruby
Raw Normal View History

2019-12-21 20:55:43 +05:30
# frozen_string_literal: true
class TestSuiteEntity < Grape::Entity
expose :name
expose :total_time
expose :total_count
expose :success_count
expose :failed_count
expose :skipped_count
expose :error_count
2020-07-28 23:09:34 +05:30
with_options if: -> (_, opts) { opts[:details] } do |test_suite|
expose :suite_error
expose :test_cases, using: TestCaseEntity do |test_suite|
2020-11-24 15:15:51 +05:30
test_suite.suite_error ? [] : test_suite.sorted.test_cases.values.flat_map(&:values)
2020-07-28 23:09:34 +05:30
end
2019-12-21 20:55:43 +05:30
end
end