summaryrefslogtreecommitdiff
path: root/spec/support
Commit message (Collapse)AuthorAgeFilesLines
* Replace '.team << [user, role]' with 'add_role(user)' in specs36782-replace-team-user-role-with-add_role-user-in-specsblackst0ne2017-12-227-10/+10
|
* Only include the user's ID in the time_spent command's update hashRobert Speicher2017-12-192-6/+6
| | | | | | | | | Previously, this would include the entire User record in the update hash, which was rendered in the response using `to_json`, erroneously exposing every attribute of that record, including their (now removed) private token. Now we only include the user ID, and perform the lookup on-demand.
* Merge branch 'rc/use-factory_bot_rails' into 'master'Robert Speicher2017-12-153-4/+4
|\ | | | | | | | | Replace factory_girl_rails with factory_bot_rails See merge request gitlab-org/gitlab-ce!15919
| * Replace factory_girl_rails with factory_bot_railsrc/use-factory_bot_railsRémy Coutable2017-12-143-4/+4
| | | | | | | | | | | | | | | | | | | | | | I've followed the [upgrade guide](https://github.com/thoughtbot/factory_bot/blob/4-9-0-stable/UPGRADE_FROM_FACTORY_GIRL.md) and ran these two commands: ``` grep -e FactoryGirl **/*.rake **/*.rb -s -l | xargs sed -i "" "s|FactoryGirl|FactoryBot|" grep -e factory_girl **/*.rake **/*.rb -s -l | xargs sed -i "" "s|factory_girl|factory_bot|" ``` Signed-off-by: Rémy Coutable <remy@rymai.me>
* | Merge branch 'ignore-markdown-cache-when-stubbing-application-settings' into ↵Nick Thomas2017-12-151-0/+3
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | 'master' Don't use Markdown cache for stubbed settings in specs Closes #41130 See merge request gitlab-org/gitlab-ce!15954
| * | Don't use Markdown cache for stubbed settings in specsignore-markdown-cache-when-stubbing-application-settingsSean McGivern2017-12-151-0/+3
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ApplicationSetting model uses the CacheMarkdownField concern, which updates the cached HTML when the field is updated in the database. However, in specs, when we want to test conditions using ApplicationSetting, we stub it, because this is accessed in different ways throughout the application. This means that if a spec runs that caches one of the Markdown fields, and a later spec uses `stub_application_setting` to set the raw value of that field, the cached value was still the original one. We can work around this by ignoring the Markdown cache in contexts where we're using `stub_application_setting`. We could be smarter, and only do this on the Markdown fields of the model, but this is probably fine.
* | Import gitlab_projects.rb from gitlab-shellNick Thomas2017-12-141-0/+2
|/ | | | | | | | | By importing this Ruby code into gitlab-rails (and gitaly-ruby), we avoid 200ms of startup time for each gitlab_projects subprocess we are eliminating. By not having a gitlab_projects subprocess between gitlab-rails / sidekiq and any git subprocesses (e.g. for fork_project, fetch_remote, etc, calls), we can also manage these git processes more cleanly, and avoid sending SIGKILL to them
* Clear BatchLoader after each spec to prevent holding onto records longer ↵dm-batchloader-projectDouwe Maan2017-12-141-0/+5
| | | | than necessary
* Move the circuitbreaker check out in a separate processbvl-circuitbreaker-processBob Van Landuyt2017-12-082-1/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | Moving the check out of the general requests, makes sure we don't have any slowdown in the regular requests. To keep the process performing this checks small, the check is still performed inside a unicorn. But that is called from a process running on the same server. Because the checks are now done outside normal request, we can have a simpler failure strategy: The check is now performed in the background every `circuitbreaker_check_interval`. Failures are logged in redis. The failures are reset when the check succeeds. Per check we will try `circuitbreaker_access_retries` times within `circuitbreaker_storage_timeout` seconds. When the number of failures exceeds `circuitbreaker_failure_count_threshold`, we will block access to the storage. After `failure_reset_time` of no checks, we will clear the stored failures. This could happen when the process that performs the checks is not running.
* Support uploads for groupsJarka Kadlecova2017-12-071-0/+240
|
* Merge branch '40573-rename-gke-as-kubernetes-engine' into 'master'Kamil Trzciński2017-12-071-1/+1
|\ | | | | | | | | | | | | Rename GKE as Kubernetes Engine Closes #40537 See merge request gitlab-org/gitlab-ce!15608
| * Rename GKE as Kubernetes EngineTakuya Noguchi2017-12-061-1/+1
| |
* | Merge branch 'mk-add-old-attachments-to-uploads-table' into 'master'Stan Hu2017-12-071-0/+20
|\ \ | |/ |/| | | | | Add old files to uploads table See merge request gitlab-org/gitlab-ce!15270
| * Fix specs after rebaseMichael Kozono2017-12-061-0/+6
| | | | | | | | | | | | | | | | Later migrations added fields to the EE DB which were used by factories which were used in these specs. And in CE on MySQL, a single appearance row is enforced. The migration and migration specs should not depend on the codebase staying the same.
| * Move temp table creation into the prepare jobMichael Kozono2017-12-011-10/+4
| | | | | | | | | | * Hopefully fixes spec failures in which the table doesn’t exist * Decouples the background migration from the post-deploy migration, e.g. we could easily run it again even though the table is dropped when finished.
| * Drop temporary tracking table when finishedMichael Kozono2017-12-011-0/+14
| |
| * Refactor specsMichael Kozono2017-12-011-9/+3
| |
| * Refactor, no change in behaviorMichael Kozono2017-12-011-0/+12
| |
* | Throttle the number of UPDATEs triggered by touchYorick Peterse2017-12-061-0/+20
| | | | | | | | | | | | | | This throttles the number of UPDATE queries that can be triggered by calling "touch" on a Note, Issue, or MergeRequest. For Note objects we also take care of updating the associated "noteable" relation in a smarter way than Rails does by default.
* | Merge branch 'zj-multiple-artifacts' into 'master'Grzegorz Bizon2017-12-051-0/+5
|\ \ | | | | | | | | | | | | Multiple artifacts See merge request gitlab-org/gitlab-ce!14367
| * | Fix legacy migration testZeger-Jan van de Weg2017-12-031-0/+5
| |/
* | Count occurrences of a specific query in the query recorder.bvl-limit-fork-queries-on-project-showBob Van Landuyt2017-12-041-5/+14
|/
* Merge branch 'backstage/gb/build-pipeline-in-a-separate-class' into 'master'Kamil Trzciński2017-12-011-0/+6
|\ | | | | | | | | | | | | Extract class responsible for building a pipeline Closes #38460 See merge request gitlab-org/gitlab-ce!14762
| * Merge branch 'master' into backstage/gb/build-pipeline-in-a-separate-classGrzegorz Bizon2017-11-3064-220/+742
| |\ | | | | | | | | | * master: (1794 commits)
| * | Set pipeline config source attribute in a build stepGrzegorz Bizon2017-10-111-0/+6
| | |
* | | Merge branch 'clean-capybara-config' into 'master'Stan Hu2017-11-301-8/+28
|\ \ \ | |_|/ |/| | | | | | | | | | | | | | Clean up Capybara configuration Closes #40599 See merge request gitlab-org/gitlab-ce!15644
| * | add logging back to capybara config and clean up selenium option instantiationclean-capybara-configMike Greiling2017-11-291-8/+28
| | |
* | | Aling shared_exmaples to "same behavior between KubernetesService and ↵Shinya Maeda2017-11-281-3/+3
| | | | | | | | | | | | Platform::Kubernetes"
* | | Replce kubernetes_service and deployment_service to deployment_platformShinya Maeda2017-11-281-1/+1
| | |
* | | Add test suit for platform::kubernetesShinya Maeda2017-11-281-7/+21
|/ /
* | Merge branch 'jej/fix-protected-branch-validations-ce' into 'master'Rémy Coutable2017-11-242-3/+3
|\ \ | | | | | | | | | | | | Fix ProtectedBranch access level validations See merge request gitlab-org/gitlab-ce!15586
| * | Deduplicate protected ref human_access_levelsjej/fix-protected-branch-validations-ceJames Edwards-Jones2017-11-242-3/+3
| | | | | | | | | | | | | | | | | | Previously these were duplicated so they could be different for push/merge, but this was no longer necessary after https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/11232
* | | Allow password authentication to be disabled entirelyMarkus Koller2017-11-231-1/+5
| | |
* | | Fix encoding bugs in Gitlab::Git::UserJacob Vosmaer (GitLab)2017-11-231-0/+9
| | |
* | | Merge branch '40295-fix-reply-quote-shortcut-on-mr' into 'master'Clement Ho2017-11-221-0/+6
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Fix reply quote keyboard shortcut on MRs Closes #40295 See merge request gitlab-org/gitlab-ce!15523
| * | | Fix reply quote keyboard shortcut on MRs40295-fix-reply-quote-shortcut-on-mrEric Eastwood2017-11-211-0/+6
| | | | | | | | | | | | | | | | Fix https://gitlab.com/gitlab-org/gitlab-ce/issues/40295
* | | | Merge branch 'improve-extra-queries-output' into 'master'Rémy Coutable2017-11-221-2/+9
|\ \ \ \ | |_|/ / |/| | | | | | | | | | | Improve output for extra queries in specs See merge request gitlab-org/gitlab-ce!15537
| * | | Improve output for extra queries in specsimprove-extra-queries-outputSean McGivern2017-11-221-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, this used `Array#-`, which would remove all queries that matches the query text in the original set. However, sometimes we have a problem with parameterised queries, where the query text is identical both times, so we'd run a query N times instead of once, and it would be hidden from the output. Replace the logic to only remove a given query N times from the actual log, where N is the number of times it appears in the expected log.
* | | | Add QUERY_RECORDER_DEBUG environment variable to improve performance debuggingsh-add-query-recorder-debuggingStan Hu2017-11-211-0/+7
|/ / /
* | | Adds Rubocop rule for line break after guard clauseJacopo2017-11-163-0/+3
|/ / | | | | | | Adds a rubocop rule (with autocorrect) to ensure line break after guard clauses.
* | we need to disable gitaly for some testsKim "BKC" Carlbäcker2017-11-141-2/+6
| |
* | Merge branch '36099-api-responses-missing-x-content-type-options-header' ↵Douwe Maan2017-11-081-0/+5
| | | | | | | | | | | | | | | | | | | | | | into '10-1-stable' Include X-Content-Type-Options (XCTO) header into API responses See merge request gitlab/gitlabhq!2211 (cherry picked from commit 6c818e77f2abeef2dd7b17a269611b018701fa79) e087e075 Include X-Content-Type-Options (XCTO) header into API responses
* | Merge branch 'github-importer-refactor' into 'master'Douwe Maan2017-11-081-18/+18
|\ \ | | | | | | | | | | | | | | | | | | Rewrite the GitHub importer to perform work in parallel and greatly improve performance Closes #33135, #38621, and #39361 See merge request gitlab-org/gitlab-ce!14731
| * | Rewrite the GitHub importer from scratchYorick Peterse2017-11-071-18/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prior to this MR there were two GitHub related importers: * Github::Import: the main importer used for GitHub projects * Gitlab::GithubImport: importer that's somewhat confusingly used for importing Gitea projects (apparently they have a compatible API) This MR renames the Gitea importer to Gitlab::LegacyGithubImport and introduces a new GitHub importer in the Gitlab::GithubImport namespace. This new GitHub importer uses Sidekiq for importing multiple resources in parallel, though it also has the ability to import data sequentially should this be necessary. The new code is spread across the following directories: * lib/gitlab/github_import: this directory contains most of the importer code such as the classes used for importing resources. * app/workers/gitlab/github_import: this directory contains the Sidekiq workers, most of which simply use the code from the directory above. * app/workers/concerns/gitlab/github_import: this directory provides a few modules that are included in every GitHub importer worker. == Stages The import work is divided into separate stages, with each stage importing a specific set of data. Stages will schedule the work that needs to be performed, followed by scheduling a job for the "AdvanceStageWorker" worker. This worker will periodically check if all work is completed and schedule the next stage if this is the case. If work is not yet completed this worker will reschedule itself. Using this approach we don't have to block threads by calling `sleep()`, as doing so for large projects could block the thread from doing any work for many hours. == Retrying Work Workers will reschedule themselves whenever necessary. For example, hitting the GitHub API's rate limit will result in jobs rescheduling themselves. These jobs are not processed until the rate limit has been reset. == User Lookups Part of the importing process involves looking up user details in the GitHub API so we can map them to GitLab users. The old importer used an in-memory cache, but this obviously doesn't work when the work is spread across different threads. The new importer uses a Redis cache and makes sure we only perform API/database calls if absolutely necessary. Frequently used keys are refreshed, and lookup misses are also cached; removing the need for performing API/database calls if we know we don't have the data we're looking for. == Performance & Models The new importer in various places uses raw INSERT statements (as generated by `Gitlab::Database.bulk_insert`) instead of using Rails models. This allows us to bypass any validations and callbacks, drastically reducing the number of SQL queries and Gitaly RPC calls necessary to import projects. To ensure the code produces valid data the corresponding tests check if the produced rows are valid according to the model validation rules.
* | | Add helper methods to redirect legacy pathsBob Van Landuyt2017-11-071-0/+13
|/ /
* | Merge branch 'fix-comments-spec' into 'master'Rémy Coutable2017-11-071-1/+1
|\ \ | | | | | | | | | | | | Fix merge_request_spec See merge request gitlab-org/gitlab-ce!15250
| * | Fix merge_request_specAnnabel Dunstone Gray2017-11-071-1/+1
| | |
* | | Merge branch 'master' into 38464-k8s-appsShinya Maeda2017-11-081-0/+1
|\ \ \ | |/ /
| * | Merge branch 'fix/gb/ensure-that-job-belongs-to-stage' into 'master'Kamil Trzciński2017-11-071-0/+1
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | Make sure that every job has a stage assigned Closes #37979 See merge request gitlab-org/gitlab-ce!14724
| | * | Fix cycle analytics specsGrzegorz Bizon2017-11-061-0/+1
| | | |