diff options
Diffstat (limited to 'app/models/ci/pipeline.rb')
-rw-r--r-- | app/models/ci/pipeline.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb index e5caa3ffa41..f06a6416307 100644 --- a/app/models/ci/pipeline.rb +++ b/app/models/ci/pipeline.rb @@ -603,6 +603,18 @@ module Ci @latest_builds_with_artifacts ||= builds.latest.with_artifacts_archive.to_a end + def has_test_reports? + complete? && builds.with_test_reports.any? + end + + def test_reports + Gitlab::Ci::Reports::TestReports.new.tap do |test_reports| + builds.with_test_reports.each do |build| + build.collect_test_reports!(test_reports) + end + end + end + private def ci_yaml_from_repo |