diff options
Diffstat (limited to 'app/serializers')
-rw-r--r-- | app/serializers/test_reports_comparer_entity.rb | 1 | ||||
-rw-r--r-- | app/serializers/test_suite_comparer_entity.rb | 15 |
2 files changed, 16 insertions, 0 deletions
diff --git a/app/serializers/test_reports_comparer_entity.rb b/app/serializers/test_reports_comparer_entity.rb index d7a3dd34fdc..5f8a68338cc 100644 --- a/app/serializers/test_reports_comparer_entity.rb +++ b/app/serializers/test_reports_comparer_entity.rb @@ -7,6 +7,7 @@ class TestReportsComparerEntity < Grape::Entity expose :total_count, as: :total expose :resolved_count, as: :resolved expose :failed_count, as: :failed + expose :error_count, as: :errored end expose :suite_comparers, as: :suites, using: TestSuiteComparerEntity diff --git a/app/serializers/test_suite_comparer_entity.rb b/app/serializers/test_suite_comparer_entity.rb index d402a4d5718..78c243f75b8 100644 --- a/app/serializers/test_suite_comparer_entity.rb +++ b/app/serializers/test_suite_comparer_entity.rb @@ -11,6 +11,7 @@ class TestSuiteComparerEntity < Grape::Entity expose :total_count, as: :total expose :resolved_count, as: :resolved expose :failed_count, as: :failed + expose :error_count, as: :errored end # rubocop: disable CodeReuse/ActiveRecord @@ -28,6 +29,20 @@ class TestSuiteComparerEntity < Grape::Entity max_tests(suite.new_failures, suite.existing_failures)) end + expose :new_errors, using: TestCaseEntity do |suite| + suite.new_errors.take(max_tests) + end + + expose :existing_errors, using: TestCaseEntity do |suite| + suite.existing_errors.take( + max_tests(suite.new_errors)) + end + + expose :resolved_errors, using: TestCaseEntity do |suite| + suite.resolved_errors.take( + max_tests(suite.new_errors, suite.existing_errors)) + end + private def max_tests(*used) |