2016-11-18 15:38:02 +00:00
|
|
|
module Gitlab
|
|
|
|
module CycleAnalytics
|
|
|
|
class TestStage < BaseStage
|
2017-01-12 11:48:01 +00:00
|
|
|
def start_time_attrs
|
|
|
|
@start_time_attrs ||= mr_metrics_table[:latest_build_started_at]
|
|
|
|
end
|
2016-12-02 16:09:29 +00:00
|
|
|
|
2017-01-12 11:48:01 +00:00
|
|
|
def end_time_attrs
|
|
|
|
@end_time_attrs ||= mr_metrics_table[:latest_build_finished_at]
|
2016-11-21 16:15:25 +00:00
|
|
|
end
|
|
|
|
|
2016-12-09 11:41:15 +00:00
|
|
|
def name
|
2016-12-02 16:09:29 +00:00
|
|
|
:test
|
|
|
|
end
|
|
|
|
|
2017-02-10 08:41:39 +00:00
|
|
|
def legend
|
|
|
|
"Relative Builds Trigger by Commits"
|
|
|
|
end
|
|
|
|
|
2016-12-02 16:09:29 +00:00
|
|
|
def description
|
|
|
|
"Total test time for all commits/merges"
|
2016-11-18 15:38:02 +00:00
|
|
|
end
|
2016-12-09 11:41:15 +00:00
|
|
|
|
|
|
|
def stage_query
|
|
|
|
if @options[:branch]
|
|
|
|
super.where(build_table[:ref].eq(@options[:branch]))
|
|
|
|
else
|
|
|
|
super
|
|
|
|
end
|
|
|
|
end
|
2016-11-18 15:38:02 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|