gitlab-org--gitlab-foss/spec
Rémy Coutable eb2d20665f Merge branch 'smart-pipeline-duration' into 'master'
Smartly calculate real running time and pending time

## What does this MR do?

Try to smartly calculate the running time and pending time for pipelines, instead of just use wall clock time from start to end. The algorithm is based on:

> Suppose we have A, B, and C jobs:

> * A: from 1 to 3
> * B: from 2 to 4
> * C: from 6 to 7

> The processing time should be accumulated from 1 to 4, and 6 to 7, totally 4, excluding retires, and calculate on `%w[success failed running canceled]` jobs (if a job is not finished yet, assume it's `Time.now`)

## Are there points in the code the reviewer needs to double check?

I would actually like to test `Gitlab::Ci::PipelineDuration#process_segments`, but it's a private method right now and it's not very convenient to test it. Is there a way to test it without changing the original code too much? Note that I would like to avoid saving merged segments because it's not used and should be garbage collected.

## Screenshots:

![Screen_Shot_2016-09-05_at_6.45.32_PM](/uploads/a82bfaf316661091e383b743a2f11334/Screen_Shot_2016-09-05_at_6.45.32_PM.png)

## Does this MR meet the acceptance criteria?

- [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
- [ ] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)
- Tests
  - [x] Added for this feature/bug

## What are the relevant issue numbers?

Closes #18260, #19804

See merge request !6084
2016-09-08 17:38:20 +00:00
..
config Small refactor and a few documentation fixes 2016-08-04 19:02:39 +02:00
controllers Merge branch 'master' of https://dev.gitlab.org/gitlab/gitlabhq 2016-09-05 17:23:32 +02:00
factories Optimize discussion notes resolving and unresolving 2016-09-06 12:14:09 -03:00
features Merge branch 'dz-bulk-edit-mr' into 'master' 2016-09-08 15:56:37 +00:00
finders Use PipelinesFinder in Pipelines API 2016-09-07 15:38:03 +02:00
fixtures Returns the total number of issues in the JSON response 2016-08-31 09:30:37 +01:00
helpers Merge branch 'dz-mr-version-compare' into 'master' 2016-09-08 13:25:04 +00:00
initializers Give priority to environment variables 2016-08-03 15:48:48 +01:00
javascripts Merge branch 'fix-textarea-expansion' into 'master' 2016-09-07 20:17:00 +00:00
lib Merge branch 'smart-pipeline-duration' into 'master' 2016-09-08 17:38:20 +00:00
mailers Merge branch 'master' into 'expiration-date-on-memberships' 2016-08-19 10:58:01 +00:00
models Merge branch 'smart-pipeline-duration' into 'master' 2016-09-08 17:38:20 +00:00
policies add project_policy_spec to replace .project_abilities spec 2016-08-30 11:35:06 -07:00
requests Code refactor 2016-09-07 12:10:49 +02:00
routing Fix markdown help references 2016-08-26 09:38:21 -05:00
services Add bulk update support for merge requests list 2016-09-08 11:52:20 +03:00
support Make sure DatabaseCleaner.clean runs AFTER Capybara's cleanup 2016-09-04 19:59:00 +03:00
tasks/gitlab Use File::exist? instead of File::exists? 2016-08-11 13:54:45 +03:00
uploaders Remove VideoJS and clean the integration 2016-07-20 11:36:42 +02:00
views add feature test 2016-09-06 14:42:43 +02:00
workers Added cron to prune events older than 12 months. 2016-09-07 19:41:25 +02:00
factories_spec.rb adds second batch of tests changed to active tense 2016-08-09 15:11:39 +01:00
rails_helper.rb
simplecov_env.rb Bump SimpleCov merge timeout to 365 days 2016-08-22 13:44:14 +02:00
spec_helper.rb Merge remote-tracking branch 'upstream/master' into artifacts-from-ref-and-build-name 2016-08-24 20:56:30 +08:00
teaspoon_env.rb Add test coverage analysis for CoffeeScript (!5052) 2016-08-07 21:52:37 +02:00