Commit 0d43b927 authored by Kamil Trzcinski's avatar Kamil Trzcinski

Fix CI tests

parent 86cedb08
...@@ -7,8 +7,10 @@ class Projects::PipelinesController < Projects::ApplicationController ...@@ -7,8 +7,10 @@ class Projects::PipelinesController < Projects::ApplicationController
def index def index
@scope = params[:scope] @scope = params[:scope]
@all_pipelines = project.ci_commits all_pipelines = project.ci_commits
@pipelines = PipelinesFinder.new(project).execute(@all_pipelines, @scope) @pipelines_count = all_pipelines.count
@running_or_pending_count = all_pipelines.running_or_pending.count
@pipelines = PipelinesFinder.new(project).execute(all_pipelines, @scope)
@pipelines = @pipelines.order(id: :desc).page(params[:page]).per(30) @pipelines = @pipelines.order(id: :desc).page(params[:page]).per(30)
end end
...@@ -22,7 +24,7 @@ class Projects::PipelinesController < Projects::ApplicationController ...@@ -22,7 +24,7 @@ class Projects::PipelinesController < Projects::ApplicationController
rescue ArgumentError => e rescue ArgumentError => e
@error = e.message @error = e.message
render 'new' render 'new'
rescue => e rescue
@error = 'Undefined error' @error = 'Undefined error'
render 'new' render 'new'
end end
......
...@@ -354,7 +354,7 @@ class Project < ActiveRecord::Base ...@@ -354,7 +354,7 @@ class Project < ActiveRecord::Base
join_body = "INNER JOIN ( join_body = "INNER JOIN (
SELECT project_id, COUNT(*) AS amount SELECT project_id, COUNT(*) AS amount
FROM notes FROM notes
WHERE created_at >= #{sanitize(since)} WHERE created_at >= #{sanitize(since)}project.ci_commits
GROUP BY project_id GROUP BY project_id
) join_note_counts ON projects.id = join_note_counts.project_id" ) join_note_counts ON projects.id = join_note_counts.project_id"
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
- status = latest.status - status = latest.status
%span{class: "ci-status-link ci-status-icon-#{status}"} %span{class: "ci-status-link ci-status-icon-#{status}"}
= ci_icon_for_status(status) = ci_icon_for_status(status)
- if stage
&nbsp; &nbsp;
= stage.titleize.pluralize = stage.titleize.pluralize
= render latest.ordered, coverage: @project.build_coverage_enabled?, tage: false, ref: false, allow_retry: true = render latest.ordered, coverage: @project.build_coverage_enabled?, tage: false, ref: false, allow_retry: true
......
...@@ -7,13 +7,13 @@ ...@@ -7,13 +7,13 @@
= link_to project_pipelines_path(@project) do = link_to project_pipelines_path(@project) do
All All
%span.badge.js-totalbuilds-count %span.badge.js-totalbuilds-count
= number_with_delimiter(@all_pipelines.count) = number_with_delimiter(@pipelines_count)
%li{class: ('active' if @scope == 'running')} %li{class: ('active' if @scope == 'running')}
= link_to project_pipelines_path(@project, scope: :running) do = link_to project_pipelines_path(@project, scope: :running) do
Running Running
%span.badge.js-running-count %span.badge.js-running-count
= number_with_delimiter(@all_pipelines.running_or_pending.count) = number_with_delimiter(@running_or_pending_count)
%li{class: ('active' if @scope == 'branches')} %li{class: ('active' if @scope == 'branches')}
= link_to project_pipelines_path(@project, scope: :branches) do = link_to project_pipelines_path(@project, scope: :branches) do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment