summaryrefslogtreecommitdiff
path: root/spec
Commit message (Collapse)AuthorAgeFilesLines
* Hotfix the issuable counters when filtering by multiple labels22421-fix-issuable-counter-when-more-than-one-label-is-selectedRémy Coutable2016-09-221-7/+13
| | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
* fix import/export security specs after mergeJames Lopez2016-09-212-1/+12
|
* Merge branch 'master' of dev.gitlab.org:gitlab/gitlabhqRémy Coutable2016-09-213-2/+23
|\
| * fixing security specs after mergeJames Lopez2016-09-213-2/+23
| |
* | Merge branch 'and-you-get-awards' into 'master' Rémy Coutable2016-09-213-3/+86
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | And Snippets get awards ## What does this MR do? Makes snippets more awesome, by making them awardables ## Why was this MR needed? Because Snippets were left behind. ## What are the relevant issue numbers? Closes #17878 See merge request !4456
| * | Fix tests for Snippets toggling awardsZ.J. van de Weg2016-09-192-6/+8
| | | | | | | | | | | | Also incorporate feedback
| * | API support for Award Emoji on SnippetsZ.J. van de Weg2016-09-191-5/+50
| | |
| * | Snippets get award emoji! :thumbsup:Z.J. van de Weg2016-09-193-2/+38
| | |
* | | Merge branch 'rs-simplify-fetch_members' into 'master' Rémy Coutable2016-09-212-0/+68
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Simplify ProjectTeam#fetch_members to satisfy flog ## What does this MR do? - Add specs for ProjectTeam#fetch_members - Simplify ProjectTeam#fetch_members to satisfy flog ## What are the relevant issue numbers? Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/22200 See merge request !6431
| * | | Fix a logic error in ProjectTeam#fetch_invited_membersRobert Speicher2016-09-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | We were calling `.where` and `.send` on the relation, but never doing anything with the return value, resulting in proper access-level filtering never being of any consequence.
| * | | Add specs for ProjectTeam#fetch_membersRobert Speicher2016-09-202-0/+67
| | | |
* | | | Merge branch 'show-all-pipelines-from-all-diffs' into 'master' Rémy Coutable2016-09-211-6/+53
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Show all pipelines from all merge_request_diffs This way we could also show pipelines from commits which were discarded due to a force push. Closes #21889 See merge request !6414
| * | | | Use factory instead of using new directly. Feedback:show-all-pipelines-from-all-diffsLin Jen-Shin2016-09-211-9/+2
| | | | | | | | | | | | | | | | | | | | https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6414#note_15765156
| * | | | Add a test for non-persisted merge requestLin Jen-Shin2016-09-201-0/+22
| | | | |
| * | | | Test against MergeRequest#all_commits_sha, feedback:Lin Jen-Shin2016-09-201-9/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6414#note_15750344 So that we could just use it in testing for MergeRequest#all_pipelines
| * | | | Show all pipelines from all merge_request_diffs:Lin Jen-Shin2016-09-191-6/+25
| | | | | | | | | | | | | | | | | | | | | | | | | This way we could also show pipelines from commits which were discarded due to a force push.
* | | | | Merge branch 'limit-number-of-shown-environments' into 'master' Rémy Coutable2016-09-213-6/+90
|\ \ \ \ \ | |_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Limit number of shown environments ## What does this MR do? This MR limits in context of Merge Request a list of shown environments. Previously we would show all environments containing the SHA of the head commit of Merge Request. However, with introducing of dynamically created environments this lead to a cases that we would show multiple review apps, for different branches, because these branches would contain a new questioned commit. This MR changes what environments we test against presence of the commit, to: 1. We look for environments with deployments to source_branch of source_project: used for deployments to per-branch environments, 2. We look for environments with deployments to target_branch of target_project: used for deployments to staging / production environments, 3. We look for environments with deployments for tags on target_project: used for staging / production environments. ## Why was this MR needed? To improve a list of returned environments when we introduced ability to create dynamic environments for review apps: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6323 See merge request !6438
| * | | | Scope environments to projectlimit-number-of-shown-environmentsKamil Trzcinski2016-09-211-0/+2
| | | | |
| * | | | Improve specsKamil Trzcinski2016-09-212-4/+5
| | | | |
| * | | | Add tests to verify the correctness of returned environmentsKamil Trzcinski2016-09-212-6/+87
| | | | |
* | | | | Merge branch 'add_spec_for_committer_hash' into 'master' Rémy Coutable2016-09-211-0/+45
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add spec covering 'committer_hash' Adds a missing spec from changes added in !5822 See merge request !6433
| * | | | | Add spec covering 'committer_hash'Dan Dunckel2016-09-201-0/+45
| | | | | |
* | | | | | Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ceDmitriy Zaporozhets2016-09-21111-892/+3324
|\ \ \ \ \ \
| * \ \ \ \ \ Merge branch 'post-merge-improve-of-ci-permissions' into 'master' Rémy Coutable2016-09-213-7/+15
| |\ \ \ \ \ \ | | |_|/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Post-merge improve of CI permissions Improves code from !6409 See merge request !6432
| | * | | | | Improve JwtController implementationpost-merge-improve-of-ci-permissionsKamil Trzcinski2016-09-201-3/+5
| | | | | | |
| | * | | | | Post-merge improve of CI permissionsKamil Trzcinski2016-09-203-7/+13
| | | | | | |
| * | | | | | Merge branch '21170-cycle-analytics' into 'master' Stan Hu2016-09-2121-1/+1044
| |\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cycle Analytics: first iteration ## What does this MR do? - Implement the first iteration of the "Cycle Analytics" feature. ## What are the relevant issue numbers? - Closes #21170 ## Screenshots ![cycle_analytics_screencast.gif](/uploads/d23c3c912caa6935fd47b53ca3a56b97/cycle_analytics.gif) ## Backend Tasks - [x] Implementation - [x] Phases - [x] Issue (Tracker) - [x] Plan (Board) - [x] Code (IDE) - [x] Test (CI) - [x] Review (MR) - [x] Staging (CD) - [x] Production (Total) - [x] Make heuristics more modular - [x] Scope to project - [x] Date range (30 days, 90 days) - [x] Access restriction - [x] Test - [x] Find a better way to test these phases - [x] Phases - [x] Issue (Tracker) - [x] Plan (Board) - [x] Code (IDE) - [x] Test (CI) - [x] Review (MR) - [x] Staging (CD) - [x] Production (Total) - [x] Test for "end case happens before start case" - [x] Consolidate helper - [x] Miniboss review - [x] Performance testing with mock data - [x] Improve performance - [x] Pre-calculate "merge requests closing issues - [x] Pre-calculate everything else - [x] Test performance against 10k issues - [x] Test all pre-calculation code - [x] Ci::Pipeline -> build start/finish - [x] Ci::Pipeline#merge_requests - [x] Issue -> record default metrics after save - [x] MergeRequest -> record default metrics after save - [x] Deployment -> Update "first_deployed_to_production_at" for MR metrics - [x] Git Push -> Update "first commit mention" for issue metrics - [x] Merge request create/update/refresh -> Update "merge requests closing issues" - [x] Remove `MergeRequestsClosingIssues` when necessary - [x] Changes to unblock Fatih - [x] Add summary data - [x] `stats` should be array - [x] Let `stats` be `null` if all `stats` are null - [x] Indexes for "merge requests closing issues" - [x] Test summary data - [x] Scope everything to project - [x] Find out why tests were passing - [x] Filter should include issues/MRs which have made it to production within the range - [x] Don't create duplicate `MergeRequestsClosingIssues` - [x] Fix tests - [x] MySQL median - [x] Assign to Douwe for review - [x] Fix conflicts - [x] Implement suggestions from Yorick's review - [x] Test on PG - [x] Test on MySQL - [x] Refactor - [x] Cleanup - [x] What happens if we have no data at all? - [x] Extract common queries to methods / scopes - [x] Remove unused queries - [x] Downtime for foreign key migrations - [x] Find a way around "if issue.metrics.present?" all over the place - [x] Find a way around "if merge_request.metrics.present?" all over the place - [x] Test migrations on a fresh database - [x] MySQL - [x] Pg - [x] Access issues - While the project is public and the visibility is set to "Everyone with access", you cannot visit the cycle analytics page when signed out. - [x] CHANGELOG - [x] Implement suggestions from Douwe's review - [x] First set of comments - [x] Second set of comments - [x] Third set of comments - [x] Fourth set of comments - [x] Make sure build is green - [ ] Make issue for "polish" - [ ] EE MR See merge request !5986
| | * | | | | | Fix `CreateDeploymentService` spec.Timothy Andrew2016-09-211-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. The spec tests that if: - The merge request is merged - The target branch is deployed to production - The `first_deployed_to_production_at` metric is `nil` (for some reason) - The target branch is deployed to production again - The `first_deployed_to_production_at` metric stays as `nil` (and is not overwritten). 2. Failure only on MySQL due to some datetime weirdness.
| | * | | | | | Reload issues in spec to ensure label<->issue mapping properly loaded21170-cycle-analyticsStan Hu2016-09-201-0/+2
| | | | | | | |
| | * | | | | | Fix build.Timothy Andrew2016-09-213-8/+8
| | | | | | | |
| | * | | | | | Add a spec for merge request metric caching while refreshing a merge request ↵Timothy Andrew2016-09-213-11/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | from a forked project.
| | * | | | | | Use the `IssuableBaseService` lifecycle hooks to cache ↵Timothy Andrew2016-09-213-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `MergeRequestsClosingIssues` - Instead of overriding `create` and `update` in `MergeRequests::BaseService` - Get all merge request service specs passing
| | * | | | | | Implement a second round of review comments from @DouweM.Timothy Andrew2016-09-2111-96/+154
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Don't use `TableReferences` - using `.arel_table` is shorter! - Move some database-related code to `Gitlab::Database` - Remove the `MergeRequest#issues_closed` and `Issue#closed_by_merge_requests` associations. They were either shadowing or were too similar to existing methods. They are not being used anywhere, so it's better to remove them to reduce confusion. - Use Rails 3-style validations - Index for `MergeRequest::Metrics#first_deployed_to_production_at` - Only include `CycleAnalyticsHelpers::TestGeneration` for specs that need it. - Other minor refactorings.
| | * | | | | | Fix rubocop spec.Timothy Andrew2016-09-202-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | And `scss_lint`
| | * | | | | | Fix spec failures.Timothy Andrew2016-09-205-11/+11
| | | | | | | |
| | * | | | | | Merge remote-tracking branch 'origin/master' into 21170-cycle-analyticsTimothy Andrew2016-09-20163-1414/+4292
| | |\ \ \ \ \ \
| | * | | | | | | Fix all cycle analytics specs.Timothy Andrew2016-09-207-16/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A number of failures were introduced due to performance improvements (like pre-calculating metrics).
| | * | | | | | | Test the `CycleAnalytics::Summary` model.Timothy Andrew2016-09-203-4/+78
| | | | | | | | |
| | * | | | | | | Test all cycle analytics pre-calculation code.Timothy Andrew2016-09-198-0/+333
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All the code that pre-calculates metrics for use in the cycle analytics page. - Ci::Pipeline -> build start/finish - Ci::Pipeline#merge_requests - Issue -> record default metrics after save - MergeRequest -> record default metrics after save - Deployment -> Update "first_deployed_to_production_at" for MR metrics - Git Push -> Update "first commit mention" for issue metrics - Merge request create/update/refresh -> Update "merge requests closing issues"
| | * | | | | | | Merge remote-tracking branch 'origin/master' into 21170-cycle-analyticsTimothy Andrew2016-09-07111-716/+2864
| | |\ \ \ \ \ \ \
| | * | | | | | | | Fix rubocop spec.Timothy Andrew2016-09-071-2/+2
| | | | | | | | | |
| | * | | | | | | | Consolidate all cycle analytics helper methods.Timothy Andrew2016-09-078-264/+184
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Move the test generation to `CycleAnalyticsHelpers::TestGeneration` 2. Move all helper methods (previously placed in each individual spec file) to `CycleAnalyticsHelpers`
| | * | | | | | | | Add a test case for "end condition happens before start condition".Timothy Andrew2016-09-071-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - In the cycle analytics specs.
| | * | | | | | | | Test the `test` cycle analytics phase.Timothy Andrew2016-09-071-0/+90
| | | | | | | | | |
| | * | | | | | | | Test the `production` cycle analytics phase.Timothy Andrew2016-09-072-1/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| | * | | | | | | | Test the `staging` cycle analytics phase.Timothy Andrew2016-09-072-4/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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`.
| | * | | | | | | | Generate branch/file names more randomly to avoid failures.Timothy Andrew2016-09-074-6/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Tests would randomly fail because of naming conflicts. - Use a `random_git_name` method instead of using `FFaker` directly.
| | * | | | | | | | Test the 'review' cycle analytics phase.Timothy Andrew2016-09-071-0/+45
| | | | | | | | | |
| | * | | | | | | | Test the `code` cycle analytics phase.Timothy Andrew2016-09-074-25/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Move the "data belongs to other project" test case into the generated tests, and remove the explicit tests from the `code` and `plan` phases.
| | * | | | | | | | Refactor cycle analytics specs.Timothy Andrew2016-09-023-180/+133
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.