diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-02 06:07:52 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-02 06:07:52 +0000 |
commit | ba836d98593d68d8d6c22c540e31c8031a786bd8 (patch) | |
tree | 09e500506edc566b08ea006ce41aa411990b9236 /lib | |
parent | 796b00a98a82fcbe082c9343fd4efcccc77478dc (diff) | |
download | gitlab-ce-ba836d98593d68d8d6c22c540e31c8031a786bd8.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/ci/reports/test_reports.rb | 8 | ||||
-rw-r--r-- | lib/gitlab/ci/reports/test_suite.rb | 10 |
2 files changed, 18 insertions, 0 deletions
diff --git a/lib/gitlab/ci/reports/test_reports.rb b/lib/gitlab/ci/reports/test_reports.rb index 7397ff35d46..72323c4343d 100644 --- a/lib/gitlab/ci/reports/test_reports.rb +++ b/lib/gitlab/ci/reports/test_reports.rb @@ -34,6 +34,14 @@ module Gitlab end end + def with_attachment! + @test_suites.keep_if do |_job_name, test_suite| + test_suite.with_attachment!.present? + end + + self + end + TestCase::STATUS_TYPES.each do |status_type| define_method("#{status_type}_count") do # rubocop: disable CodeReuse/ActiveRecord diff --git a/lib/gitlab/ci/reports/test_suite.rb b/lib/gitlab/ci/reports/test_suite.rb index b0391160c15..cf43c5313c0 100644 --- a/lib/gitlab/ci/reports/test_suite.rb +++ b/lib/gitlab/ci/reports/test_suite.rb @@ -37,6 +37,16 @@ module Gitlab end end + def with_attachment! + @test_cases = @test_cases.extract!("failed") + + @test_cases.keep_if do |status, hash| + hash.any? do |key, test_case| + test_case.has_attachment? + end + end + end + TestCase::STATUS_TYPES.each do |status_type| define_method("#{status_type}") do test_cases[status_type] || {} |