debian-mirror-gitlab/lib/gitlab/cycle_analytics/test_stage.rb

40 lines
787 B
Ruby
Raw Normal View History

2019-02-15 15:39:39 +05:30
# frozen_string_literal: true
2017-08-17 22:00:37 +05:30
module Gitlab
module CycleAnalytics
class TestStage < BaseStage
def start_time_attrs
@start_time_attrs ||= mr_metrics_table[:latest_build_started_at]
end
def end_time_attrs
@end_time_attrs ||= mr_metrics_table[:latest_build_finished_at]
end
def name
:test
end
def title
s_('CycleAnalyticsStage|Test')
end
def legend
_("Related Jobs")
end
def description
_("Total test time for all commits/merges")
end
2018-03-27 19:54:05 +05:30
def stage_query(project_ids)
2017-08-17 22:00:37 +05:30
if @options[:branch]
2018-03-27 19:54:05 +05:30
super(project_ids).where(build_table[:ref].eq(@options[:branch]))
2017-08-17 22:00:37 +05:30
else
2018-03-27 19:54:05 +05:30
super(project_ids)
2017-08-17 22:00:37 +05:30
end
end
end
end
end