diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-17 15:09:20 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-17 15:09:20 +0300 |
commit | b84eeb256c4a780d902faee1f99ca9a711b3214a (patch) | |
tree | 32918aadbea9210eace50efbce9afbfb8cd3ba84 /app/serializers | |
parent | 53ae6b7e3f83591ad251a3f771f5bf3b8cf087ba (diff) |
Add latest changes from gitlab-org/gitlab@master
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) |