Commit graph

26 commits

Author SHA1 Message Date
Shinya Maeda
1b481342a0 Fix spec 2017-09-03 23:49:11 +09:00
Shinya Maeda
5547baa3eb Fix spec 2017-09-03 23:49:11 +09:00
Grzegorz Bizon
f906591094 Fix cycle analytics test data generation and specs 2017-08-23 13:48:48 +02:00
Jarka Kadlecova
9ef3c431e4 Move some after_create parts to worker to improve performance 2017-08-07 15:57:56 +02:00
Grzegorz Bizon
1a581a6afc Use a previous approach for cycle analytics dummy pipeline 2017-07-05 21:23:10 +02:00
Lin Jen-Shin
60b8156a25 Fix cycle analytics tests by making pipeline valid 2017-07-05 19:29:18 +08:00
Lin Jen-Shin
63bf2457e4 Follow feedback on the merge request 2017-07-04 03:08:30 +08:00
Lin Jen-Shin
d8ab0d609d Give project to the dummy pipeline 2017-07-03 14:17:43 +08:00
Lin Jen-Shin
4968f226a0 Make sure that environment was created before deploying 2017-06-02 21:34:31 +08:00
Lin Jen-Shin
f62603286d Fix other use of CreateDeploymentService and make
it a bit more robust against missing options,
which we did guard on for some cases.
2017-06-02 02:46:34 +08:00
James Edwards-Jones
29519edb55 Cycle analytics specs needed Commit to reference issue
The plan stage both measures time taken and lists related commits. We test for commits being listed, so needed to actually mention the issue in them. An alternative would have been adding “allow_any_instance_of(Commit).to receive(:matches_cross_reference_regex?).and_return(true)” but this felt too coupled to implementation.
2017-05-04 20:03:47 +01:00
Rémy Coutable
169dc4cec1 Fix brittle specs
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-04-03 18:54:48 +02:00
Rémy Coutable
4e3516788f Don't use FFaker in factories, use sequences instead
FFaker can generate data that randomly break our test suite. This
simplifies our factories and use sequences which are more predictive.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-04-03 18:54:48 +02:00
Douwe Maan
faa2e2df8f Rename commit_file, commit_dir and remove_file and update specs 2017-02-24 09:55:01 -06:00
Douwe Maan
0625af3bcb Consistently create, update, and delete files, taking CRLF settings into account 2017-02-24 09:55:01 -06:00
Lin Jen-Shin
07b9b80a88 Fix tests to use the new API 2016-12-08 19:11:52 +08:00
Douwe Maan
bf061d0aff
Merge branch 'issue_23548_dev' into 'master'
disable markdown in comments when referencing disabled features

fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/23548

This MR prevents the following references when tool is disabled:

- issues
- snippets
- commits - when repo is disabled
- commit range - when repo is disabled
- milestones

This MR does not prevent references to repository files, since they are just markdown links and don't leak
information.

See merge request !2011

Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-11-09 12:25:17 +01:00
Timothy Andrew
c0ecef79fe Fix the "Commits" section of the cycle analytics summary.
- The commit count was capped at 10, due to
  `Gitlab::Git::Repository#log` enforcing a limit, with the default set
  to 10.

- Reimplement a small portion of this `log` function to get just the
  data we need.
2016-09-26 18:38:40 +05:30
Timothy Andrew
d0e101e997 Fix all cycle analytics specs.
A number of failures were introduced due to performance
improvements (like pre-calculating metrics).
2016-09-20 13:23:14 +05:30
Timothy Andrew
204419e9e9 Test the CycleAnalytics::Summary model. 2016-09-20 13:23:14 +05:30
Timothy Andrew
0a767f7b61 Consolidate all cycle analytics helper methods.
1. Move the test generation to `CycleAnalyticsHelpers::TestGeneration`

2. Move all helper methods (previously placed in each individual spec
   file) to `CycleAnalyticsHelpers`
2016-09-07 14:29:12 +05:30
Timothy Andrew
32147ddf54 Add a test case for "end condition happens before start condition".
- In the cycle analytics specs.
2016-09-07 14:22:03 +05:30
Timothy Andrew
de483c6834 Test the production cycle analytics phase.
Add a `before_end_fn` option to the code that generates cycle analytics
specs. `before_end_fn` is called before the end conditions are. Used for
data setup that needs to be called after the start conditions and before
the end conditions.
2016-09-07 13:06:58 +05:30
Timothy Andrew
dd112ef117 Test the staging cycle analytics phase.
Remove overlap from the "start + end" durations in the happy test
case. For the `staging` phase, the end time is the _first_ deployment
that happens after the MR merge.

If we have 5 MRs where the `start_time`s (merge time) are the
same, and all the `end_time`s (deploy to production) a few days from
now, only the earliest deploy will get picked up, because that
consitutes a deploy for _all_ the MRs.

We fix this by removing overlap. Every `start_time` is now generated to
be _after_ the preceding `end_time`.
2016-09-07 12:12:51 +05:30
Timothy Andrew
f77c952ae7 Test the code cycle analytics phase.
- Move the "data belongs to other project" test case into the generated
  tests, and remove the explicit tests from the `code` and `plan` phases.
2016-09-07 10:39:46 +05:30
Timothy Andrew
98c9d12077 Refactor cycle analytics specs.
1. Generalise the specs that will be common across all cycle analytics
   phases.

2. Rewrite specs `issue` and `plan` to use this abstracted testing
   strategy.

3. Specs that are specific to a given phase, or unwieldy to test in an
   abstracted manner, are added to each phase's spec.
2016-09-02 17:43:03 +05:30