Skip to content
Snippets Groups Projects
Commit 49ee28e1 authored by Kamil Trzcinski's avatar Kamil Trzcinski
Browse files

Fix specs

parent 62f3558d
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -138,20 +138,24 @@ class Commit < ActiveRecord::Base
end
 
def builds_without_retry
return unless config_processor
@builds_without_retry ||=
begin
job_types = config_processor.types
grouped_builds = builds.group_by(&:name)
grouped_builds = grouped_builds.map do |name, builds|
grouped_builds.map do |name, builds|
builds.sort_by(&:id).last
end
grouped_builds.sort_by do |build|
[job_types.index(build.job_type), build.name]
end
end
end
 
def builds_without_retry_sorted
return builds_without_retry unless config_processor
job_types = config_processor.types
builds_without_retry.sort_by do |build|
[job_types.index(build.job_type) || -1, build.name || ""]
end
end
def retried_builds
@retried_builds ||= (builds.order(id: :desc) - builds_without_retry)
end
Loading
Loading
Loading
Loading
@@ -10,7 +10,7 @@
#up-build-trace
- if @commit.matrix?
%ul.nav.nav-tabs.append-bottom-10
- @commit.builds_without_retry.each do |build|
- @commit.builds_without_retry_sorted.each do |build|
%li{class: ('active' if build == @build) }
= link_to build_url(build) do
%i{class: build_icon_css_class(build)}
Loading
Loading
Loading
Loading
@@ -75,7 +75,7 @@
- if @project.coverage_enabled?
%th Coverage
%th
= render @commit.builds_without_retry, controls: true
= render @commit.builds_without_retry_sorted, controls: true
 
- if @commit.retried_builds.any?
%h3
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment