Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-04-02 09:07:52 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-04-02 09:07:52 +0300
commitba836d98593d68d8d6c22c540e31c8031a786bd8 (patch)
tree09e500506edc566b08ea006ce41aa411990b9236 /lib/gitlab/ci
parent796b00a98a82fcbe082c9343fd4efcccc77478dc (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/ci')
-rw-r--r--lib/gitlab/ci/reports/test_reports.rb8
-rw-r--r--lib/gitlab/ci/reports/test_suite.rb10
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] || {}