Commit b3e4ec8e authored by GitLab Bot's avatar GitLab Bot

Add latest changes from gitlab-org/gitlab@master

parent 90cdc939
......@@ -102,6 +102,7 @@ export function initUserTracking() {
window.snowplow('enableActivityTracking', 30, 30);
window.snowplow('trackPageView'); // must be after enableActivityTracking
if (opts.userId) window.snowplow('setUserId', opts.userId);
if (opts.formTracking) window.snowplow('enableFormTracking');
if (opts.linkClickTracking) window.snowplow('enableLinkClickTracking');
......
......@@ -483,6 +483,7 @@ class IssuableFinder
# rubocop: disable CodeReuse/ActiveRecord
def by_search(items)
return items unless search
return items if items.is_a?(ActiveRecord::NullRelation)
if use_cte_for_search?
cte = Gitlab::SQL::RecursiveCTE.new(klass.table_name)
......
......@@ -128,82 +128,37 @@ module SystemNoteService
# Called when 'merge when pipeline succeeds' is executed
def merge_when_pipeline_succeeds(noteable, project, author, sha)
body = "enabled an automatic merge when the pipeline for #{sha} succeeds"
create_note(NoteSummary.new(noteable, project, author, body, action: 'merge'))
::SystemNotes::MergeRequestsService.new(noteable: noteable, project: project, author: author).merge_when_pipeline_succeeds(sha)
end
# Called when 'merge when pipeline succeeds' is canceled
def cancel_merge_when_pipeline_succeeds(noteable, project, author)
body = 'canceled the automatic merge'
create_note(NoteSummary.new(noteable, project, author, body, action: 'merge'))
::SystemNotes::MergeRequestsService.new(noteable: noteable, project: project, author: author).cancel_merge_when_pipeline_succeeds
end
# Called when 'merge when pipeline succeeds' is aborted
def abort_merge_when_pipeline_succeeds(noteable, project, author, reason)
body = "aborted the automatic merge because #{reason}"
##
# TODO: Abort message should be sent by the system, not a particular user.
# See https://gitlab.com/gitlab-org/gitlab-foss/issues/63187.
create_note(NoteSummary.new(noteable, project, author, body, action: 'merge'))
::SystemNotes::MergeRequestsService.new(noteable: noteable, project: project, author: author).abort_merge_when_pipeline_succeeds(reason)
end
def handle_merge_request_wip(noteable, project, author)
prefix = noteable.work_in_progress? ? "marked" : "unmarked"
body = "#{prefix} as a **Work In Progress**"
create_note(NoteSummary.new(noteable, project, author, body, action: 'title'))
::SystemNotes::MergeRequestsService.new(noteable: noteable, project: project, author: author).handle_merge_request_wip
end
def add_merge_request_wip_from_commit(noteable, project, author, commit)
body = "marked as a **Work In Progress** from #{commit.to_reference(project)}"
create_note(NoteSummary.new(noteable, project, author, body, action: 'title'))
::SystemNotes::MergeRequestsService.new(noteable: noteable, project: project, author: author).add_merge_request_wip_from_commit(commit)
end
def resolve_all_discussions(merge_request, project, author)
body = "resolved all threads"
create_note(NoteSummary.new(merge_request, project, author, body, action: 'discussion'))
::SystemNotes::MergeRequestsService.new(noteable: merge_request, project: project, author: author).resolve_all_discussions
end
def discussion_continued_in_issue(discussion, project, author, issue)
body = "created #{issue.to_reference} to continue this discussion"
note_attributes = discussion.reply_attributes.merge(project: project, author: author, note: body)
note = Note.create(note_attributes.merge(system: true, created_at: issue.system_note_timestamp))
note.system_note_metadata = SystemNoteMetadata.new(action: 'discussion')
note
::SystemNotes::MergeRequestsService.new(project: project, author: author).discussion_continued_in_issue(discussion, issue)
end
def diff_discussion_outdated(discussion, project, author, change_position)
merge_request = discussion.noteable
diff_refs = change_position.diff_refs
version_index = merge_request.merge_request_diffs.viewable.count
position_on_text = change_position.on_text?
text_parts = ["changed this #{position_on_text ? 'line' : 'file'} in"]
if version_params = merge_request.version_params_for(diff_refs)
repository = project.repository
anchor = position_on_text ? change_position.line_code(repository) : change_position.file_hash
url = url_helpers.diffs_project_merge_request_path(project, merge_request, version_params.merge(anchor: anchor))
text_parts << "[version #{version_index} of the diff](#{url})"
else
text_parts << "version #{version_index} of the diff"
end
body = text_parts.join(' ')
note_attributes = discussion.reply_attributes.merge(project: project, author: author, note: body)
note = Note.create(note_attributes.merge(system: true))
note.system_note_metadata = SystemNoteMetadata.new(action: 'outdated')
note
::SystemNotes::MergeRequestsService.new(project: project, author: author).diff_discussion_outdated(discussion, change_position)
end
def change_title(noteable, project, author, old_title)
......@@ -233,9 +188,7 @@ module SystemNoteService
#
# Returns the created Note object
def change_branch(noteable, project, author, branch_type, old_branch, new_branch)
body = "changed #{branch_type} branch from `#{old_branch}` to `#{new_branch}`"
create_note(NoteSummary.new(noteable, project, author, body, action: 'branch'))
::SystemNotes::MergeRequestsService.new(noteable: noteable, project: project, author: author).change_branch(branch_type, old_branch, new_branch)
end
# Called when a branch in Noteable is added or deleted
......@@ -253,16 +206,7 @@ module SystemNoteService
#
# Returns the created Note object
def change_branch_presence(noteable, project, author, branch_type, branch, presence)
verb =
if presence == :add
'restored'
else
'deleted'
end
body = "#{verb} #{branch_type} branch `#{branch}`"
create_note(NoteSummary.new(noteable, project, author, body, action: 'branch'))
::SystemNotes::MergeRequestsService.new(noteable: noteable, project: project, author: author).change_branch_presence(branch_type, branch, presence)
end
# Called when a branch is created from the 'new branch' button on a issue
......@@ -270,18 +214,11 @@ module SystemNoteService
#
# "created branch `201-issue-branch-button`"
def new_issue_branch(issue, project, author, branch, branch_project: nil)
branch_project ||= project
link = url_helpers.project_compare_path(branch_project, from: branch_project.default_branch, to: branch)
body = "created branch [`#{branch}`](#{link}) to address this issue"
create_note(NoteSummary.new(issue, project, author, body, action: 'branch'))
::SystemNotes::MergeRequestsService.new(noteable: issue, project: project, author: author).new_issue_branch(branch, branch_project: branch_project)
end
def new_merge_request(issue, project, author, merge_request)
body = "created merge request #{merge_request.to_reference(project)} to address this issue"
create_note(NoteSummary.new(issue, project, author, body, action: 'merge'))
::SystemNotes::MergeRequestsService.new(noteable: issue, project: project, author: author).new_merge_request(merge_request)
end
def cross_reference(noteable, mentioner, author)
......
# frozen_string_literal: true
module SystemNotes
class MergeRequestsService < ::SystemNotes::BaseService
# Called when 'merge when pipeline succeeds' is executed
def merge_when_pipeline_succeeds(sha)
body = "enabled an automatic merge when the pipeline for #{sha} succeeds"
create_note(NoteSummary.new(noteable, project, author, body, action: 'merge'))
end
# Called when 'merge when pipeline succeeds' is canceled
def cancel_merge_when_pipeline_succeeds
body = 'canceled the automatic merge'
create_note(NoteSummary.new(noteable, project, author, body, action: 'merge'))
end
# Called when 'merge when pipeline succeeds' is aborted
def abort_merge_when_pipeline_succeeds(reason)
body = "aborted the automatic merge because #{reason}"
##
# TODO: Abort message should be sent by the system, not a particular user.
# See https://gitlab.com/gitlab-org/gitlab-foss/issues/63187.
create_note(NoteSummary.new(noteable, project, author, body, action: 'merge'))
end
def handle_merge_request_wip
prefix = noteable.work_in_progress? ? "marked" : "unmarked"
body = "#{prefix} as a **Work In Progress**"
create_note(NoteSummary.new(noteable, project, author, body, action: 'title'))
end
def add_merge_request_wip_from_commit(commit)
body = "marked as a **Work In Progress** from #{commit.to_reference(project)}"
create_note(NoteSummary.new(noteable, project, author, body, action: 'title'))
end
def resolve_all_discussions
body = "resolved all threads"
create_note(NoteSummary.new(noteable, project, author, body, action: 'discussion'))
end
def discussion_continued_in_issue(discussion, issue)
body = "created #{issue.to_reference} to continue this discussion"
note_attributes = discussion.reply_attributes.merge(project: project, author: author, note: body)
Note.create(note_attributes.merge(system: true, created_at: issue.system_note_timestamp)).tap do |note|
note.system_note_metadata = SystemNoteMetadata.new(action: 'discussion')
end
end
def diff_discussion_outdated(discussion, change_position)
merge_request = discussion.noteable
diff_refs = change_position.diff_refs
version_index = merge_request.merge_request_diffs.viewable.count
position_on_text = change_position.on_text?
text_parts = ["changed this #{position_on_text ? 'line' : 'file'} in"]
if version_params = merge_request.version_params_for(diff_refs)
repository = project.repository
anchor = position_on_text ? change_position.line_code(repository) : change_position.file_hash
url = url_helpers.diffs_project_merge_request_path(project, merge_request, version_params.merge(anchor: anchor))
text_parts << "[version #{version_index} of the diff](#{url})"
else
text_parts << "version #{version_index} of the diff"
end
body = text_parts.join(' ')
note_attributes = discussion.reply_attributes.merge(project: project, author: author, note: body)
Note.create(note_attributes.merge(system: true)).tap do |note|
note.system_note_metadata = SystemNoteMetadata.new(action: 'outdated')
end
end
# Called when a branch in Noteable is changed
#
# branch_type - 'source' or 'target'
# old_branch - old branch name
# new_branch - new branch name
#
# Example Note text:
#
# "changed target branch from `Old` to `New`"
#
# Returns the created Note object
def change_branch(branch_type, old_branch, new_branch)
body = "changed #{branch_type} branch from `#{old_branch}` to `#{new_branch}`"
create_note(NoteSummary.new(noteable, project, author, body, action: 'branch'))
end
# Called when a branch in Noteable is added or deleted
#
# branch_type - :source or :target
# branch - branch name
# presence - :add or :delete
#
# Example Note text:
#
# "restored target branch `feature`"
#
# Returns the created Note object
def change_branch_presence(branch_type, branch, presence)
verb =
if presence == :add
'restored'
else
'deleted'
end
body = "#{verb} #{branch_type} branch `#{branch}`"
create_note(NoteSummary.new(noteable, project, author, body, action: 'branch'))
end
# Called when a branch is created from the 'new branch' button on a issue
# Example note text:
#
# "created branch `201-issue-branch-button`"
def new_issue_branch(branch, branch_project: nil)
branch_project ||= project
link = url_helpers.project_compare_path(branch_project, from: branch_project.default_branch, to: branch)
body = "created branch [`#{branch}`](#{link}) to address this issue"
create_note(NoteSummary.new(noteable, project, author, body, action: 'branch'))
end
def new_merge_request(merge_request)
body = "created merge request #{merge_request.to_reference(project)} to address this issue"
create_note(NoteSummary.new(noteable, project, author, body, action: 'merge'))
end
end
end
SystemNotes::MergeRequestsService.prepend_if_ee('::EE::SystemNotes::MergeRequestsService')
......@@ -7,4 +7,4 @@
};p[i].q=p[i].q||[];n=l.createElement(o);g=l.getElementsByTagName(o)[0];n.async=1;
n.src=w;g.parentNode.insertBefore(n,g)}}(window,document,"script","#{asset_url('snowplow/sp.js')}","snowplow"));
window.snowplowOptions = #{Gitlab::Tracking.snowplow_options(@group).to_json}
window.snowplowOptions = #{Gitlab::Tracking.snowplow_options(@group, current_user).to_json}
---
title: Make 'Sidekiq::Testing.fake!' mode as default
merge_request: 31662
author: "@blackst0ne"
type: other
......@@ -142,11 +142,6 @@ the Gitaly server. The easiest way to accomplish this is to copy `/etc/gitlab/gi
from an existing GitLab server to the Gitaly server. Without this shared secret,
Git operations in GitLab will result in an API error.
NOTE: **Note:**
In most or all cases, the storage paths below end in `/repositories` which is
not the case with `path` in `git_data_dirs` of Omnibus GitLab installations.
Check the directory layout on your Gitaly server to be sure.
**For Omnibus GitLab**
1. Edit `/etc/gitlab/gitlab.rb`:
......@@ -193,24 +188,26 @@ Check the directory layout on your Gitaly server to be sure.
On `gitaly1.internal`:
```
gitaly['storage'] = [
{ 'name' => 'default' },
{ 'name' => 'storage1' },
]
git_data_dirs({
'default' => {
'path' => '/var/opt/gitlab/git-data'
},
'storage1' => {
'path' => '/mnt/gitlab/git-data'
},
})
```
On `gitaly2.internal`:
```
gitaly['storage'] = [
{ 'name' => 'storage2' },
]
git_data_dirs({
'storage2' => {
'path' => '/srv/gitlab/git-data'
},
})
```
NOTE: **Note:**
In some cases, you'll have to set `path` for `gitaly['storage']` in the
format `'path' => '/mnt/gitlab/<storage name>/repositories'`.
1. Save the file and [reconfigure GitLab](../restart_gitlab.md#omnibus-gitlab-reconfigure).
**For installations from source**
......@@ -236,9 +233,11 @@ Check the directory layout on your Gitaly server to be sure.
```toml
[[storage]]
name = 'default'
path = '/var/opt/gitlab/git-data/repositories'
[[storage]]
name = 'storage1'
path = '/mnt/gitlab/git-data/repositories'
```
On `gitaly2.internal`:
......@@ -246,12 +245,9 @@ Check the directory layout on your Gitaly server to be sure.
```toml
[[storage]]
name = 'storage2'
path = '/srv/gitlab/git-data/repositories'
```
NOTE: **Note:**
In some cases, you'll have to set `path` for each `[[storage]]` in the
format `path = '/mnt/gitlab/<storage name>/repositories'`.
1. Save the file and [restart GitLab](../restart_gitlab.md#installations-from-source).
### 4. Converting clients to use the Gitaly server
......
......@@ -102,6 +102,23 @@ To be safe, we recommend you only restart one server agent at a time to ensure t
For larger clusters, it is possible to restart multiple agents at a time. See the [Consul consensus document](https://www.consul.io/docs/internals/consensus.html#deployment-table) for how many failures it can tolerate. This will be the number of simulateneous restarts it can sustain.
## Upgrades for bundled Consul
Nodes running GitLab-bundled Consul should be:
- Members of a healthy cluster prior to upgrading the GitLab Omnibus package.
- Upgraded one node at a time.
NOTE: **NOTE:**
Running `curl http://127.0.0.1:8500/v1/health/state/critical` from any Consul node will identify existing health issues in the cluster. The command will return an empty array if the cluster is healthy.
Consul clusters communicate using the raft protocol. If the current leader goes offline, there needs to be a leader election. A leader node must exist to facilitate synchronization across the cluster. If too many nodes go offline at the same time, the cluster will lose quorum and not elect a leader due to [broken consensus](https://www.consul.io/docs/internals/consensus.html).
Consult the [troubleshooting section](#troubleshooting) if the cluster is not able to recover after the upgrade. The [outage recovery](#outage-recovery) may be of particular interest.
NOTE: **NOTE:**
GitLab only uses Consul to store transient data that is easily regenerated. If the bundled Consul was not used by any process other than GitLab itself, then [rebuilding the cluster from scratch](#recreate-from-scratch) is fine.
## Troubleshooting
### Consul server agents unable to communicate
......
......@@ -14,7 +14,7 @@ tasks such as:
To request access to Chatops on GitLab.com:
1. Log into <https://ops.gitlab.net/users/sign_in> **using the same username** as for GitLab.com (you may have to rename it).
1. Ask [an owner/maintainer in the `chatops` project](https://gitlab.com/gitlab-com/chatops/-/project_members?search=&sort=access_level_desc) to add you by running `/chatops run member add <username> gitlab-com/chatops --ops`.
1. Ask [a project member in the `chatops` project](https://ops.gitlab.net/gitlab-com/chatops/-/project_members) to add you by running `/chatops run member add <username> gitlab-com/chatops --ops`.
## See also
......
......@@ -357,9 +357,16 @@ However, if a spec makes direct Redis calls, it should mark itself with the
`:clean_gitlab_redis_queues` traits as appropriate.
Sidekiq jobs are typically not run in specs, but this behaviour can be altered
in each spec through the use of `perform_enqueued_jobs` blocks. Any spec that
causes Sidekiq jobs to be pushed to Redis should use the `:sidekiq` trait, to
ensure that they are removed once the spec completes.
in each spec through the use of `perform_enqueued_jobs` blocks.
Any spec that causes Sidekiq jobs to be pushed to Redis should use the
`:sidekiq_inline` trait, to ensure that they are removed once the spec completes.
The `:sidekiq_might_not_need_inline` trait was added when [Sidekiq inline mode was
changed to fake mode](https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/31662)
to all the examples that needed Sidekiq to actually process jobs. Examples with
this trait should be either fixed to not rely on Sidekiq processing jobs, or their
`:sidekiq_might_not_need_inline` trait should be updated to `:sidekiq_inline` if the
processing of background jobs is needed/expected.
#### Filesystem
......
......@@ -9,19 +9,24 @@ local network, these may be vulnerable to exploitation via Webhooks.
With [Webhooks](../user/project/integrations/webhooks.md), you and your project
maintainers and owners can set up URLs to be triggered when specific changes
occur in your projects. Normally, these requests are sent to external web services
specifically set up for this purpose, that process the request and its attached
data in some appropriate way.
occur in your projects. Normally, these requests are sent to external web
services specifically set up for this purpose, that process the request and its
attached data in some appropriate way.
Things get hairy, however, when a Webhook is set up with a URL that doesn't
point to an external, but to an internal service, that may do something
completely unintended when the webhook is triggered and the POST request is
sent.
Because Webhook requests are made by the GitLab server itself, these have
complete access to everything running on the server (`http://localhost:123`) or
within the server's local network (`http://192.168.1.12:345`), even if these
services are otherwise protected and inaccessible from the outside world.
Webhook requests are made by the GitLab server itself and use a single
(optional) secret token per hook for authorization (instead of a user or
repo-specific token). As a result, these may have broader access than
intended to everything running on the server hosting the webhook (which
may include the GitLab server or API itself, e.g., `http://localhost:123`).
Depending on the called webhook, this may also result in network access
to other servers within that webhook server's local network (e.g.,
`http://192.168.1.12:345`), even if these services are otherwise protected
and inaccessible from the outside world.
If a web service does not require authentication, Webhooks can be used to
trigger destructive commands by getting the GitLab server to make POST requests
......
......@@ -94,8 +94,19 @@ always take the latest License Compliance artifact available. Behind the scenes,
[GitLab License Compliance Docker image](https://gitlab.com/gitlab-org/security-products/license-management)
is used to detect the languages/frameworks and in turn analyzes the licenses.
The License Compliance settings can be changed through environment variables by using the
[`variables`](../../../ci/yaml/README.md#variables) parameter in `.gitlab-ci.yml`. These variables are documented in the [License Compliance documentation](https://gitlab.com/gitlab-org/security-products/license-management#settings).
The License Compliance settings can be changed through [environment variables](#available-variables) by using the
[`variables`](../../../ci/yaml/README.md#variables) parameter in `.gitlab-ci.yml`.
### Available variables
License Compliance can be configured using environment variables.
| Environment variable | Required | Description |
|-----------------------|----------|-------------|
| `MAVEN_CLI_OPTS` | no | Additional arguments for the mvn executable. If not supplied, defaults to `-DskipTests`. |
| `LM_JAVA_VERSION` | no | Version of Java. If set to `11`, Maven and Gradle use Java 11 instead of Java 8. |
| `LM_PYTHON_VERSION` | no | Version of Python. If set to `3`, dependencies are installed using Python 3 instead of Python 2.7. |
| `SETUP_CMD` | no | Custom setup for the dependency installation. (experimental) |
### Installing custom dependencies
......
......@@ -7,12 +7,6 @@ module Gitlab
@storage = storage
end
def exists?(name)
request = Gitaly::NamespaceExistsRequest.new(storage_name: @storage, name: name)
gitaly_client_call(:namespace_exists, request, timeout: GitalyClient.fast_timeout).exists
end
def add(name)
request = Gitaly::AddNamespaceRequest.new(storage_name: @storage, name: name)
......
......@@ -285,18 +285,6 @@ module Gitlab
end
end
# Check if such directory exists in repositories.
#
# Usage:
# exists?(storage, 'gitlab')
# exists?(storage, 'gitlab/cookies.git')
#
# rubocop: disable CodeReuse/ActiveRecord
def exists?(storage, dir_name)
Gitlab::GitalyClient::NamespaceService.new(storage).exists?(dir_name)
end
# rubocop: enable CodeReuse/ActiveRecord
def repository_exists?(storage, dir_name)
Gitlab::Git::Repository.new(storage, dir_name, nil, nil).exists?
rescue GRPC::Internal
......
......@@ -39,7 +39,7 @@ module Gitlab
snowplow.track_self_describing_event(event_json, context, Time.now.to_i)
end
def snowplow_options(group)
def snowplow_options(group, user)
additional_features = Feature.enabled?(:additional_snowplow_tracking, group)
{
namespace: SNOWPLOW_NAMESPACE,
......@@ -47,7 +47,8 @@ module Gitlab
cookie_domain: Gitlab::CurrentSettings.snowplow_cookie_domain,
app_id: Gitlab::CurrentSettings.snowplow_site_id,
form_tracking: additional_features,
link_click_tracking: additional_features
link_click_tracking: additional_features,
user_id: user&.id
}.transform_keys! { |key| key.to_s.camelize(:lower).to_sym }
end
......
......@@ -407,6 +407,7 @@ module QA
module DockerRun
autoload :Base, 'qa/service/docker_run/base'
autoload :LDAP, 'qa/service/docker_run/ldap'
autoload :Maven, 'qa/service/docker_run/maven'
autoload :NodeJs, 'qa/service/docker_run/node_js'
autoload :GitlabRunner, 'qa/service/docker_run/gitlab_runner'
end
......
# frozen_string_literal: true
module QA
module Service
module DockerRun
class Maven < Base
def initialize(volume_host_path)
@image = 'maven:3.6.2-ibmjava-8-alpine'
@name = "qa-maven-#{SecureRandom.hex(8)}"
@volume_host_path = volume_host_path
super()
end
def publish!
# When we run the tests via gitlab-qa, we use docker-in-docker
# which means that host of a volume mount would be the host that
# started the gitlab-qa QA container (e.g., the CI runner),
# not the gitlab-qa container itself. That means we can't
# mount a volume from the file system inside the gitlab-qa
# container.
#
# Instead, we copy the files into the container.
shell <<~CMD.tr("\n", ' ')
docker run -d --rm
--network #{network}
--hostname #{host_name}
--name #{@name}
--volume #{@volume_host_path}:/home/maven
#{@image} sh -c "sleep 60"
CMD
shell "docker cp #{@volume_host_path}/. #{@name}:/home/maven"
shell "docker exec -t #{@name} sh -c 'cd /home/maven && mvn deploy -s settings.xml'"
end
end
end
end
end
......@@ -62,7 +62,8 @@ class AutomatedCleanup
gitlab.deployments(project_path, per_page: DEPLOYMENTS_PER_PAGE).auto_paginate do |deployment|
environment = deployment.environment
next unless !environment.nil? && environment.name.start_with?('review/')
next unless environment
next unless environment.name.start_with?('review/')
next if checked_environments.include?(environment.slug)
last_deploy = deployment.created_at
......
......@@ -27,7 +27,7 @@ describe Admin::SpamLogsController do
expect(response).to have_gitlab_http_status(200)
end
it 'removes user and his spam logs when removing the user' do
it 'removes user and his spam logs when removing the user', :sidekiq_might_not_need_inline do
delete :destroy, params: { id: first_spam.id, remove_user: true }
expect(flash[:notice]).to eq "User #{user.username} was successfully removed."
......
......@@ -35,7 +35,7 @@ describe Admin::UsersController do
end
end
describe 'DELETE #user with projects' do
describe 'DELETE #user with projects', :sidekiq_might_not_need_inline do
let(:project) { create(:project, namespace: user.namespace) }
let!(:issue) { create(:issue, author: user) }
......
......@@ -45,7 +45,7 @@ describe GroupsController do
it { is_expected.to render_template('groups/show') }
it 'assigns events for all the projects in the group' do
it 'assigns events for all the projects in the group', :sidekiq_might_not_need_inline do
subject
expect(assigns(:events)).to contain_exactly(event)
end
......@@ -125,7 +125,7 @@ describe GroupsController do
end
context 'as json' do
it 'includes events from all projects in group and subgroups' do
it 'includes events from all projects in group and subgroups', :sidekiq_might_not_need_inline do
2.times do
project = create(:project, group: group)
create(:event, project: project)
......@@ -255,7 +255,7 @@ describe GroupsController do
end
end
describe 'GET #issues' do
describe 'GET #issues', :sidekiq_might_not_need_inline do
let(:issue_1) { create(:issue, project: project, title: 'foo') }
let(:issue_2) { create(:issue, project: project, title: 'bar') }
......@@ -304,7 +304,7 @@ describe GroupsController do
end
end
describe 'GET #merge_requests' do
describe 'GET #merge_requests', :sidekiq_might_not_need_inline do
let(:merge_request_1) { create(:merge_request, source_project: project) }
let(:merge_request_2) { create(:merge_request, :simple, source_project: project) }
......
......@@ -52,7 +52,7 @@ describe Import::PhabricatorController do
namespace_id: current_user.namespace_id }
end
it 'creates a project to import' do
it 'creates a project to import', :sidekiq_might_not_need_inline do
expect_next_instance_of(Gitlab::PhabricatorImport::Importer) do |importer|
expect(importer).to receive(:execute)
end
......
......@@ -320,7 +320,7 @@ describe Projects::BlobController do
default_params[:project_id] = forked_project
end
it 'redirects to blob' do
it 'redirects to blob', :sidekiq_might_not_need_inline do
put :update, params: default_params
expect(response).to redirect_to(project_blob_path(forked_project, 'master/CHANGELOG'))
......@@ -328,7 +328,7 @@ describe Projects::BlobController do
end
context 'when editing on the original repository' do
it "redirects to forked project new merge request" do
it "redirects to forked project new merge request", :sidekiq_might_not_need_inline do
default_params[:branch_name] = "fork-test-1"
default_params[:create_merge_request] = 1
......
......@@ -1252,7 +1252,7 @@ describe Projects::IssuesController do
stub_feature_flags(create_confidential_merge_request: true)
end
it 'creates a new merge request' do
it 'creates a new merge request', :sidekiq_might_not_need_inline do
expect { create_merge_request }.to change(target_project.merge_requests, :count).by(1)
end
end
......
......@@ -154,7 +154,7 @@ describe Projects::JobsController, :clean_gitlab_redis_shared_state do
.and_return(merge_request)
end
it 'does not serialize builds in exposed stages' do
it 'does not serialize builds in exposed stages', :sidekiq_might_not_need_inline do
get_show_json
json_response.dig('pipeline', 'details', 'stages').tap do |stages|
......@@ -183,7 +183,7 @@ describe Projects::JobsController, :clean_gitlab_redis_shared_state do
context 'job is cancelable' do
let(:job) { create(:ci_build, :running, pipeline: pipeline) }
it 'cancel_path is present with correct redirect' do
it 'cancel_path is present with correct redirect', :sidekiq_might_not_need_inline do
expect(response).to have_gitlab_http_status(:ok)
expect(response).to match_response_schema('job/job_details')
expect(json_response['cancel_path']).to include(CGI.escape(json_response['build_path']))
......@@ -193,7 +193,7 @@ describe Projects::JobsController, :clean_gitlab_redis_shared_state do
context 'with web terminal' do
let(:job) { create(:ci_build, :running, :with_runner_session, pipeline: pipeline) }
it 'exposes the terminal path' do
it 'exposes the terminal path', :sidekiq_might_not_need_inline do
expect(response).to have_gitlab_http_status(:ok)
expect(response).to match_response_schema('job/job_details')
expect(json_response['terminal_path']).to match(%r{/terminal})
......@@ -268,7 +268,7 @@ describe Projects::JobsController, :clean_gitlab_redis_shared_state do
project.add_maintainer(user) # Need to be a maintianer to view cluster.path
end
it 'exposes the deployment information' do
it 'exposes the deployment information', :sidekiq_might_not_need_inline do
get_show_json
expect(response).to have_gitlab_http_status(:ok)
......@@ -292,7 +292,7 @@ describe Projects::JobsController, :clean_gitlab_redis_shared_state do
sign_in(user)
end
it 'user can edit runner' do
it 'user can edit runner', :sidekiq_might_not_need_inline do
get_show_json
expect(response).to have_gitlab_http_status(:ok)
......@@ -312,7 +312,7 @@ describe Projects::JobsController, :clean_gitlab_redis_shared_state do
sign_in(user)
end
it 'user can not edit runner' do
it 'user can not edit runner', :sidekiq_might_not_need_inline do
get_show_json
expect(response).to have_gitlab_http_status(:ok)
......@@ -331,7 +331,7 @@ describe Projects::JobsController, :clean_gitlab_redis_shared_state do
sign_in(user)
end
it 'user can not edit runner' do
it 'user can not edit runner', :sidekiq_might_not_need_inline do
get_show_json
expect(response).to have_gitlab_http_status(:ok)
......@@ -412,7 +412,7 @@ describe Projects::JobsController, :clean_gitlab_redis_shared_state do
context 'when job has trace' do
let(:job) { create(:ci_build, :running, :trace_live, pipeline: pipeline) }
it "has_trace is true" do
it "has_trace is true", :sidekiq_might_not_need_inline do
get_show_json
expect(response).to match_response_schema('job/job_details')
......@@ -458,7 +458,7 @@ describe Projects::JobsController, :clean_gitlab_redis_shared_state do
create(:ci_pipeline_variable, pipeline: pipeline, key: :TRIGGER_KEY_1, value: 'TRIGGER_VALUE_1')
end
context 'user is a maintainer' do
context 'user is a maintainer', :sidekiq_might_not_need_inline do
before do
project.add_maintainer(user)
......
......@@ -431,7 +431,7 @@ describe Projects::MergeRequestsController do
context 'when a squash commit message is passed' do
let(:message) { 'My custom squash commit message' }
it 'passes the same message to SquashService' do
it 'passes the same message to SquashService', :sidekiq_might_not_need_inline do
params = { squash: '1', squash_commit_message: message }
expect_next_instance_of(MergeRequests::SquashService, project, user, params.merge(merge_request: merge_request)) do |squash_service|
......@@ -724,7 +724,7 @@ describe Projects::MergeRequestsController do
context 'with private builds' do
context 'for the target project member' do
it 'does not respond with serialized pipelines' do
it 'does not respond with serialized pipelines', :sidekiq_might_not_need_inline do
expect(json_response['pipelines']).to be_empty
expect(json_response['count']['all']).to eq(0)
expect(response).to include_pagination_headers
......@@ -734,7 +734,7 @@ describe Projects::MergeRequestsController do
context 'for the source project member' do
let(:user) { fork_user }
it 'responds with serialized pipelines' do
it 'responds with serialized pipelines', :sidekiq_might_not_need_inline do
expect(json_response['pipelines']).to be_present
expect(json_response['count']['all']).to eq(1)
expect(response).to include_pagination_headers
......@@ -750,7 +750,7 @@ describe Projects::MergeRequestsController do
end
context 'for the target project member' do
it 'does not respond with serialized pipelines' do
it 'does not respond with serialized pipelines', :sidekiq_might_not_need_inline do
expect(json_response['pipelines']).to be_present
expect(json_response['count']['all']).to eq(1)
expect(response).to include_pagination_headers
......@@ -760,7 +760,7 @@ describe Projects::MergeRequestsController do
context 'for the source project member' do
let(:user) { fork_user }
it 'responds with serialized pipelines' do
it 'responds with serialized pipelines', :sidekiq_might_not_need_inline do
expect(json_response['pipelines']).to be_present
expect(json_response['count']['all']).to eq(1)
expect(response).to include_pagination_headers
......@@ -1203,13 +1203,13 @@ describe Projects::MergeRequestsController do
create(:merge_request, source_project: forked, target_project: project, target_branch: 'master', head_pipeline: pipeline)
end
it 'links to the environment on that project' do
it 'links to the environment on that project', :sidekiq_might_not_need_inline do
get_ci_environments_status
expect(json_response.first['url']).to match /#{forked.full_path}/
end
context "when environment_target is 'merge_commit'" do
context "when environment_target is 'merge_commit'", :sidekiq_might_not_need_inline do
it 'returns nothing' do
get_ci_environments_status(environment_target: 'merge_commit')
......@@ -1240,13 +1240,13 @@ describe Projects::MergeRequestsController do
# we're trying to reduce the overall number of queries for this method.
# set a hard limit for now. https://gitlab.com/gitlab-org/gitlab-foss/issues/52287
it 'keeps queries in check' do
it 'keeps queries in check', :sidekiq_might_not_need_inline do
control_count = ActiveRecord::QueryRecorder.new { get_ci_environments_status }.count
expect(control_count).to be <= 137
end
it 'has no N+1 SQL issues for environments', :request_store, retry: 0 do
it 'has no N+1 SQL issues for environments', :request_store, :sidekiq_might_not_need_inline, retry: 0 do
# First run to insert test data from lets, which does take up some 30 queries
get_ci_environments_status
......@@ -1464,7 +1464,7 @@ describe Projects::MergeRequestsController do
sign_in(fork_owner)
end
it 'returns 200' do
it 'returns 200', :sidekiq_might_not_need_inline do
expect_rebase_worker_for(fork_owner)
post_rebase
......
......@@ -51,10 +51,6 @@ describe Projects::MirrorsController do
sign_in(project.owner)
end
around do |example|
Sidekiq::Testing.fake! { example.run }
end
context 'With valid URL for a push' do
let(:remote_mirror_attributes) do
{ "0" => { "enabled" => "0", url: 'https://updated.example.com' } }
......
......@@ -518,7 +518,7 @@ describe Projects::NotesController do
project.id && Project.maximum(:id).succ
end
it 'returns a 404' do
it 'returns a 404', :sidekiq_might_not_need_inline do
create!
expect(response).to have_gitlab_http_status(404)
end
......@@ -527,13 +527,13 @@ describe Projects::NotesController do
context 'when the user has no access to the fork' do
let(:fork_visibility) { Gitlab::VisibilityLevel::PRIVATE }
it 'returns a 404' do
it 'returns a 404', :sidekiq_might_not_need_inline do
create!
expect(response).to have_gitlab_http_status(404)
end
end
context 'when the user has access to the fork' do
context 'when the user has access to the fork', :sidekiq_might_not_need_inline do
let!(:discussion) { forked_project.notes.find_discussion(existing_comment.discussion_id) }
let(:fork_visibility) { Gitlab::VisibilityLevel::PUBLIC }
......
......@@ -93,7 +93,7 @@ describe Projects::PipelinesController do
end
context 'when performing gitaly calls', :request_store do
it 'limits the Gitaly requests' do
it 'limits the Gitaly requests', :sidekiq_might_not_need_inline do
# Isolate from test preparation (Repository#exists? is also cached in RequestStore)
RequestStore.end!
RequestStore.clear!
......@@ -571,7 +571,7 @@ describe Projects::PipelinesController do
format: :json
end
it 'cancels a pipeline without returning any content' do
it 'cancels a pipeline without returning any content', :sidekiq_might_not_need_inline do
expect(response).to have_gitlab_http_status(:no_content)
expect(pipeline.reload).to be_canceled
end
......
......@@ -653,7 +653,7 @@ describe ProjectsController do
describe "#destroy" do
let(:admin) { create(:admin) }
it "redirects to the dashboard" do
it "redirects to the dashboard", :sidekiq_might_not_need_inline do
controller.instance_variable_set(:@project, project)
sign_in(admin)
......@@ -674,7 +674,7 @@ describe ProjectsController do
target_project: project)
end
it "closes all related merge requests" do
it "closes all related merge requests", :sidekiq_might_not_need_inline do
project.merge_requests << merge_request
sign_in(admin)
......
......@@ -234,10 +234,7 @@ FactoryBot.define do
trait :broken_repo do
after(:create) do |project|
raise "Failed to create repository!" unless project.create_repository
project.gitlab_shell.rm_directory(project.repository_storage,
File.join("#{project.disk_path}.git", 'refs'))
TestEnv.rm_storage_dir(project.repository_storage, "#{project.disk_path}.git/refs")
end
end
......
......@@ -134,11 +134,9 @@ describe 'Contributions Calendar', :js do
shared_examples 'a day with activity' do |contribution_count:|
include_context 'visit user page'
it 'displays calendar activity square color for 1 contribution' do
it 'displays calendar activity square for 1 contribution', :sidekiq_might_not_need_inline do
expect(find('#js-overview')).to have_selector(get_cell_color_selector(contribution_count), count: 1)
end
it 'displays calendar activity square on the correct date' do
today = Date.today.strftime(date_format)
expect(find('#js-overview')).to have_selector(get_cell_date_selector(contribution_count, today), count: 1)
end
......@@ -154,7 +152,7 @@ describe 'Contributions Calendar', :js do
describe 'issue title is shown on activity page' do
include_context 'visit user page'
it 'displays calendar activity log' do
it 'displays calendar activity log', :sidekiq_might_not_need_inline do
expect(find('#js-overview .overview-content-list .event-target-title')).to have_content issue_title
end
end
......@@ -186,11 +184,11 @@ describe 'Contributions Calendar', :js do
end
include_context 'visit user page'
it 'displays calendar activity squares for both days' do
it 'displays calendar activity squares for both days', :sidekiq_might_not_need_inline do
expect(find('#js-overview')).to have_selector(get_cell_color_selector(1), count: 2)
end
it 'displays calendar activity square for yesterday' do
it 'displays calendar activity square for yesterday', :sidekiq_might_not_need_inline do
yesterday = Date.yesterday.strftime(date_format)
expect(find('#js-overview')).to have_selector(get_cell_date_selector(1, yesterday), count: 1)
end
......
......@@ -102,7 +102,7 @@ describe 'Commits' do
end
describe 'Cancel all builds' do
it 'cancels commit', :js do
it 'cancels commit', :js, :sidekiq_might_not_need_inline do
visit pipeline_path(pipeline)
click_on 'Cancel running'
expect(page).to have_content 'canceled'
......@@ -110,7 +110,7 @@ describe 'Commits' do
end
describe 'Cancel build' do
it 'cancels build', :js do
it 'cancels build', :js, :sidekiq_might_not_need_inline do
visit pipeline_path(pipeline)
find('.js-btn-cancel-pipeline').click
expect(page).to have_content 'canceled'
......
......@@ -42,7 +42,7 @@ describe 'Container Registry', :js do
expect(page).to have_content('my/image')
end
it 'user removes entire container repository' do
it 'user removes entire container repository', :sidekiq_might_not_need_inline do
visit_container_registry
expect_any_instance_of(ContainerRepository).to receive(:delete_tags!).and_return(true)
......
......@@ -56,7 +56,7 @@ describe 'Cycle Analytics', :js do
expect(deploys_counter).to have_content('1')
end
it 'shows data on each stage' do
it 'shows data on each stage', :sidekiq_might_not_need_inline do
expect_issue_to_be_present
click_stage('Plan')
......
......@@ -189,7 +189,7 @@ describe 'Group' do
expect(page).to have_selector '#confirm_name_input:focus'
end
it 'removes group' do
it 'removes group', :sidekiq_might_not_need_inline do
expect { remove_with_confirm('Remove group', group.path) }.to change {Group.count}.by(-1)
expect(group.members.all.count).to be_zero
expect(page).to have_content "scheduled for deletion"
......
......@@ -24,7 +24,7 @@ describe 'Import multiple repositories by uploading a manifest file', :js do
expect(page).to have_content('https://android-review.googlesource.com/platform/build/blueprint')
end
it 'imports successfully imports a project' do
it 'imports successfully imports a project', :sidekiq_might_not_need_inline do
visit new_import_manifest_path
attach_file('manifest', Rails.root.join('spec/fixtures/aosp_manifest.xml'))
......
......@@ -64,7 +64,7 @@ describe "Internal references", :js do
visit(project_issue_path(public_project, public_project_issue))
end
it "shows references" do
it "shows references", :sidekiq_might_not_need_inline do
page.within("#merge-requests .merge-requests-title") do
expect(page).to have_content("Related merge requests")
expect(page).to have_css(".mr-count-badge")
......@@ -133,7 +133,7 @@ describe "Internal references", :js do
visit(project_merge_request_path(public_project, public_project_merge_request))
end
it "shows references" do
it "shows references", :sidekiq_might_not_need_inline do
expect(page).to have_content("mentioned in merge request #{private_project_merge_request.to_reference(public_project)}")
.and have_content(private_project_user.name)
end
......
......@@ -46,7 +46,7 @@ describe "Jira", :js do
end
end
it "creates a note on the referenced issues" do
it "creates a note on the referenced issues", :sidekiq_might_not_need_inline do
click_button("Comment")
wait_for_requests
......
......@@ -23,7 +23,7 @@ describe 'Create notes on issues', :js do
submit_comment(note_text)
end
it 'creates a note with reference and cross references the issue' do
it 'creates a note with reference and cross references the issue', :sidekiq_might_not_need_inline do
page.within('div#notes li.note div.note-text') do
expect(page).to have_content(note_text)
expect(page.find('a')).to have_content(mention.to_reference)
......
......@@ -67,7 +67,7 @@ describe 'User creates branch and merge request on issue page', :js do
end
context 'when branch name is auto-generated' do
it 'creates a merge request' do
it 'creates a merge request', :sidekiq_might_not_need_inline do
perform_enqueued_jobs do
select_dropdown_option('create-mr')
......@@ -96,7 +96,7 @@ describe 'User creates branch and merge request on issue page', :js do
context 'when branch name is custom' do
let(:branch_name) { 'custom-branch-name' }
it 'creates a merge request' do
it 'creates a merge request', :sidekiq_might_not_need_inline do
perform_enqueued_jobs do
select_dropdown_option('create-mr', branch_name)
......
......@@ -42,7 +42,7 @@ describe 'User creates confidential merge request on issue page', :js do
visit_confidential_issue
end
it 'create merge request in fork' do
it 'create merge request in fork', :sidekiq_might_not_need_inline do
click_button 'Create confidential merge request'
page.within '.create-confidential-merge-request-dropdown-menu' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe 'Metrics rendering', :js, :use_clean_rails_memory_store_caching do
describe 'Metrics rendering', :js, :use_clean_rails_memory_store_caching, :sidekiq_might_not_need_inline do
include PrometheusHelpers
let(:user) { create(:user) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe 'a maintainer edits files on a source-branch of an MR from a fork', :js do
describe 'a maintainer edits files on a source-branch of an MR from a fork', :js, :sidekiq_might_not_need_inline do
include ProjectForksHelper
let(:user) { create(:user, username: 'the-maintainer') }
let(:target_project) { create(:project, :public, :repository) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe 'User accepts a merge request', :js do
describe 'User accepts a merge request', :js, :sidekiq_might_not_need_inline do
let(:merge_request) { create(:merge_request, :with_diffs, :simple, source_project: project) }
let(:project) { create(:project, :public, :repository) }
let(:user) { create(:user) }
......
......@@ -23,7 +23,7 @@ describe 'create a merge request, allowing commits from members who can merge to
sign_in(user)
end
it 'allows setting possible' do
it 'allows setting possible', :sidekiq_might_not_need_inline do
visit_new_merge_request
check 'Allow commits from members who can merge to the target branch'
......@@ -35,7 +35,7 @@ describe 'create a merge request, allowing commits from members who can merge to
expect(page).to have_content('Allows commits from members who can merge to the target branch')
end
it 'shows a message when one of the projects is private' do
it 'shows a message when one of the projects is private', :sidekiq_might_not_need_inline do
source_project.update!(visibility_level: Gitlab::VisibilityLevel::PRIVATE)
visit_new_merge_request
......@@ -43,7 +43,7 @@ describe 'create a merge request, allowing commits from members who can merge to
expect(page).to have_content('Not available for private projects')
end
it 'shows a message when the source branch is protected' do
it 'shows a message when the source branch is protected', :sidekiq_might_not_need_inline do
create(:protected_branch, project: source_project, name: 'fix')
visit_new_merge_request
......
......@@ -36,7 +36,7 @@ describe "User creates a merge request", :js do
context "to a forked project" do
let(:forked_project) { fork_project(project, user, namespace: user.namespace, repository: true) }
it "creates a merge request" do
it "creates a merge request", :sidekiq_might_not_need_inline do
visit(project_new_merge_request_path(forked_project))
expect(page).to have_content("Source branch").and have_content("Target branch")
......
......@@ -10,7 +10,7 @@ describe "User merges a merge request", :js do
end
shared_examples "fast forward merge a merge request" do
it "merges a merge request" do
it "merges a merge request", :sidekiq_might_not_need_inline do
expect(page).to have_content("Fast-forward merge without a merge commit").and have_button("Merge")
page.within(".mr-state-widget") do
......
......@@ -142,7 +142,7 @@ describe 'Merge request > User merges when pipeline succeeds', :js do
refresh
end
it 'merges merge request' do
it 'merges merge request', :sidekiq_might_not_need_inline do
expect(page).to have_content 'The changes were merged'
expect(merge_request.reload).to be_merged
end
......
......@@ -20,7 +20,7 @@ describe 'User reverts a merge request', :js do
visit(merge_request_path(merge_request))
end
it 'reverts a merge request' do
it 'reverts a merge request', :sidekiq_might_not_need_inline do
find("a[href='#modal-revert-commit']").click
page.within('#modal-revert-commit') do
......@@ -33,7 +33,7 @@ describe 'User reverts a merge request', :js do
wait_for_requests
end
it 'does not revert a merge request that was previously reverted' do
it 'does not revert a merge request that was previously reverted', :sidekiq_might_not_need_inline do
find("a[href='#modal-revert-commit']").click
page.within('#modal-revert-commit') do
......@@ -51,7 +51,7 @@ describe 'User reverts a merge request', :js do
expect(page).to have_content('Sorry, we cannot revert this merge request automatically.')
end
it 'reverts a merge request in a new merge request' do
it 'reverts a merge request in a new merge request', :sidekiq_might_not_need_inline do
find("a[href='#modal-revert-commit']").click
page.within('#modal-revert-commit') do
......
......@@ -62,7 +62,7 @@ describe 'Merge request > User sees diff', :js do
end
context 'as author' do
it 'shows direct edit link' do
it 'shows direct edit link', :sidekiq_might_not_need_inline do
sign_in(author_user)
visit diffs_project_merge_request_path(project, merge_request)
......@@ -72,7 +72,7 @@ describe 'Merge request > User sees diff', :js do
end
context 'as user who needs to fork' do
it 'shows fork/cancel confirmation' do
it 'shows fork/cancel confirmation', :sidekiq_might_not_need_inline do
sign_in(user)
visit diffs_project_merge_request_path(project, merge_request)
......
......@@ -67,13 +67,13 @@ describe 'Merge request > User sees pipelines triggered by merge request', :js d
end
end
it 'sees the latest detached merge request pipeline as the head pipeline' do
it 'sees the latest detached merge request pipeline as the head pipeline', :sidekiq_might_not_need_inline do
page.within('.ci-widget-content') do
expect(page).to have_content("##{detached_merge_request_pipeline.id}")
end
end
context 'when a user updated a merge request in the parent project' do
context 'when a user updated a merge request in the parent project', :sidekiq_might_not_need_inline do
let!(:push_pipeline_2) do
Ci::CreatePipelineService.new(project, user, ref: 'feature')
.execute(:push)
......@@ -133,7 +133,7 @@ describe 'Merge request > User sees pipelines triggered by merge request', :js d
end
end
context 'when a user merges a merge request in the parent project' do
context 'when a user merges a merge request in the parent project', :sidekiq_might_not_need_inline do
before do
click_button 'Merge when pipeline succeeds'
......@@ -196,7 +196,7 @@ describe 'Merge request > User sees pipelines triggered by merge request', :js d
end
end
it 'sees the latest branch pipeline as the head pipeline' do
it 'sees the latest branch pipeline as the head pipeline', :sidekiq_might_not_need_inline do
page.within('.ci-widget-content') do
expect(page).to have_content("##{push_pipeline.id}")
end
......@@ -204,7 +204,7 @@ describe 'Merge request > User sees pipelines triggered by merge request', :js d
end
end
context 'when a user created a merge request from a forked project to the parent project' do
context 'when a user created a merge request from a forked project to the parent project', :sidekiq_might_not_need_inline do
let(:merge_request) do
create(:merge_request,
source_project: forked_project,
......
......@@ -76,7 +76,7 @@ describe 'Merge request > User sees merge widget', :js do
expect(find('.accept-merge-request')['disabled']).not_to be(true)
end
it 'allows me to merge, see cherry-pick modal and load branches list' do
it 'allows me to merge, see cherry-pick modal and load branches list', :sidekiq_might_not_need_inline do
wait_for_requests
click_button 'Merge'
......@@ -191,7 +191,7 @@ describe 'Merge request > User sees merge widget', :js do
end
shared_examples 'pipeline widget' do
it 'shows head pipeline information' do
it 'shows head pipeline information', :sidekiq_might_not_need_inline do
within '.ci-widget-content' do
expect(page).to have_content("Detached merge request pipeline ##{pipeline.id} pending for #{pipeline.short_sha}")
end
......@@ -230,7 +230,7 @@ describe 'Merge request > User sees merge widget', :js do
end
shared_examples 'pipeline widget' do
it 'shows head pipeline information' do
it 'shows head pipeline information', :sidekiq_might_not_need_inline do
within '.ci-widget-content' do
expect(page).to have_content("Merged result pipeline ##{pipeline.id} pending for #{pipeline.short_sha}")
end
......@@ -371,7 +371,7 @@ describe 'Merge request > User sees merge widget', :js do
visit project_merge_request_path(project, merge_request)
end
it 'updates the MR widget' do
it 'updates the MR widget', :sidekiq_might_not_need_inline do
click_button 'Merge'
page.within('.mr-widget-body') do
......@@ -417,7 +417,7 @@ describe 'Merge request > User sees merge widget', :js do
visit project_merge_request_path(project, merge_request)
end
it 'user cannot remove source branch' do
it 'user cannot remove source branch', :sidekiq_might_not_need_inline do
expect(page).not_to have_field('remove-source-branch-input')
expect(page).to have_content('Deletes source branch')
end
......
......@@ -21,7 +21,7 @@ describe 'Merge request > User sees notes from forked project', :js do
sign_in(user)
end
it 'user can reply to the comment' do
it 'user can reply to the comment', :sidekiq_might_not_need_inline do
visit project_merge_request_path(project, merge_request)
expect(page).to have_content('A commit comment')
......
......@@ -28,7 +28,7 @@ describe 'Merge request > User sees pipelines from forked project', :js do
visit project_merge_request_path(target_project, merge_request)
end
it 'user visits a pipelines page' do
it 'user visits a pipelines page', :sidekiq_might_not_need_inline do
page.within('.merge-request-tabs') { click_link 'Pipelines' }
page.within('.ci-table') do
......
......@@ -124,7 +124,7 @@ describe 'Merge request > User sees pipelines', :js do
threads.each { |thr| thr.join }
end
it 'user sees pipeline in merge request widget' do
it 'user sees pipeline in merge request widget', :sidekiq_might_not_need_inline do
visit project_merge_request_path(project, @merge_request)
expect(page.find(".ci-widget")).to have_content(TestEnv::BRANCH_SHA['feature'])
......
......@@ -10,7 +10,7 @@ describe 'User squashes a merge request', :js do
let!(:original_head) { project.repository.commit('master') }
shared_examples 'squash' do
it 'squashes the commits into a single commit, and adds a merge commit' do
it 'squashes the commits into a single commit, and adds a merge commit', :sidekiq_might_not_need_inline do
expect(page).to have_content('Merged')
latest_master_commits = project.repository.commits_between(original_head.sha, 'master').map(&:raw)
......@@ -31,7 +31,7 @@ describe 'User squashes a merge request', :js do
end
shared_examples 'no squash' do
it 'accepts the merge request without squashing' do
it 'accepts the merge request without squashing', :sidekiq_might_not_need_inline do
expect(page).to have_content('Merged')
expect(project.repository).to be_merged_to_root_ref(source_branch)
end
......
......@@ -22,7 +22,7 @@ describe 'Profile account page', :js do
expect(User.exists?(user.id)).to be_truthy
end
it 'deletes user', :js do
it 'deletes user', :js, :sidekiq_might_not_need_inline do
click_button 'Delete account'
fill_in 'password', with: '12345678'
......
......@@ -22,7 +22,7 @@ describe 'Pipeline Badge' do
let!(:job) { create(:ci_build, pipeline: pipeline) }
context 'when the pipeline was successful' do
it 'displays so on the badge' do
it 'displays so on the badge', :sidekiq_might_not_need_inline do
job.success
visit pipeline_project_badges_path(project, ref: ref, format: :svg)
......@@ -33,7 +33,7 @@ describe 'Pipeline Badge' do
end
context 'when the pipeline failed' do
it 'shows displays so on the badge' do
it 'shows displays so on the badge', :sidekiq_might_not_need_inline do
job.drop
visit pipeline_project_badges_path(project, ref: ref, format: :svg)
......@@ -52,7 +52,7 @@ describe 'Pipeline Badge' do
allow(job).to receive(:prerequisites).and_return([double])
end
it 'displays the preparing badge' do
it 'displays the preparing badge', :sidekiq_might_not_need_inline do
job.enqueue
visit pipeline_project_badges_path(project, ref: ref, format: :svg)
......@@ -63,7 +63,7 @@ describe 'Pipeline Badge' do
end
context 'when the pipeline is running' do
it 'shows displays so on the badge' do
it 'shows displays so on the badge', :sidekiq_might_not_need_inline do
create(:ci_build, pipeline: pipeline, name: 'second build', status_event: 'run')
visit pipeline_project_badges_path(project, ref: ref, format: :svg)
......
......@@ -71,7 +71,7 @@ describe 'Projects > Files > User creates a directory', :js do
visit(project2_tree_path_root_ref)
end
it 'creates a directory in a forked project' do
it 'creates a directory in a forked project', :sidekiq_might_not_need_inline do
find('.add-to-tree').click
click_link('New directory')
......
......@@ -42,7 +42,7 @@ describe 'Projects > Files > User creates files' do
visit(project2_tree_path_root_ref)
end
it 'opens new file page on a forked project' do
it 'opens new file page on a forked project', :sidekiq_might_not_need_inline do
find('.add-to-tree').click
click_link('New file')
......@@ -159,7 +159,7 @@ describe 'Projects > Files > User creates files' do
end
end
context 'when an user does not have write access' do
context 'when an user does not have write access', :sidekiq_might_not_need_inline do
before do
project2.add_reporter(user)
visit(project2_tree_path_root_ref)
......
......@@ -47,7 +47,7 @@ describe 'Projects > Files > User deletes files', :js do
wait_for_requests
end
it 'deletes the file in a forked project', :js do
it 'deletes the file in a forked project', :js, :sidekiq_might_not_need_inline do
click_link('.gitignore')
expect(page).to have_content('.gitignore')
......
......@@ -136,7 +136,7 @@ describe 'Projects > Files > User edits files', :js do
)
end
it 'inserts a content of a file in a forked project' do
it 'inserts a content of a file in a forked project', :sidekiq_might_not_need_inline do
click_link('.gitignore')
click_button('Edit')
......@@ -154,7 +154,7 @@ describe 'Projects > Files > User edits files', :js do
expect(evaluate_script('ace.edit("editor").getValue()')).to eq('*.rbca')
end
it 'opens the Web IDE in a forked project' do
it 'opens the Web IDE in a forked project', :sidekiq_might_not_need_inline do
click_link('.gitignore')
click_button('Web IDE')
......@@ -168,7 +168,7 @@ describe 'Projects > Files > User edits files', :js do
expect(page).to have_css('.ide .multi-file-tab', text: '.gitignore')
end
it 'commits an edited file in a forked project' do
it 'commits an edited file in a forked project', :sidekiq_might_not_need_inline do
click_link('.gitignore')
find('.js-edit-blob').click
......@@ -199,7 +199,7 @@ describe 'Projects > Files > User edits files', :js do
wait_for_requests
end
it 'links to the forked project for editing' do
it 'links to the forked project for editing', :sidekiq_might_not_need_inline do
click_link('.gitignore')
find('.js-edit-blob').click
......
......@@ -55,7 +55,7 @@ describe 'Projects > Files > User replaces files', :js do
wait_for_requests
end
it 'replaces an existed file with a new one in a forked project' do
it 'replaces an existed file with a new one in a forked project', :sidekiq_might_not_need_inline do
click_link('.gitignore')
expect(page).to have_content('.gitignore')
......
......@@ -76,7 +76,7 @@ describe 'Projects > Files > User uploads files' do
visit(project2_tree_path_root_ref)
end
it 'uploads and commit a new file to a forked project', :js do
it 'uploads and commit a new file to a forked project', :js, :sidekiq_might_not_need_inline do
find('.add-to-tree').click
click_link('Upload file')
......
......@@ -27,7 +27,7 @@ describe 'Project fork' do
expect(page).to have_css('a.disabled', text: 'Fork')
end
it 'forks the project' do
it 'forks the project', :sidekiq_might_not_need_inline do
visit project_path(project)
click_link 'Fork'
......@@ -174,7 +174,7 @@ describe 'Project fork' do
expect(page).to have_css('.fork-thumbnail.disabled')
end
it 'links to the fork if the project was already forked within that namespace' do
it 'links to the fork if the project was already forked within that namespace', :sidekiq_might_not_need_inline do
forked_project = fork_project(project, user, namespace: group, repository: true)
visit new_project_fork_path(project)
......
......@@ -15,7 +15,7 @@ describe 'listing forks of a project' do
sign_in(user)
end
it 'shows the forked project in the list with commit as description' do
it 'shows the forked project in the list with commit as description', :sidekiq_might_not_need_inline do
visit project_forks_path(source)
page.within('li.project-row') do
......
......@@ -38,7 +38,7 @@ describe 'Import/Export - project export integration test', :js do
sign_in(user)
end
it 'exports a project successfully' do
it 'exports a project successfully', :sidekiq_might_not_need_inline do
visit edit_project_path(project)
expect(page).to have_content('Export project')
......
......@@ -27,7 +27,7 @@ describe 'Import/Export - project import integration test', :js do
let(:project_path) { 'test-project-name' + randomHex }
context 'prefilled the path' do
it 'user imports an exported project successfully' do
it 'user imports an exported project successfully', :sidekiq_might_not_need_inline do
visit new_project_path
fill_in :project_name, with: project_name, visible: true
......@@ -53,7 +53,7 @@ describe 'Import/Export - project import integration test', :js do
end
context 'path is not prefilled' do
it 'user imports an exported project successfully' do
it 'user imports an exported project successfully', :sidekiq_might_not_need_inline do
visit new_project_path
click_import_project_tab
click_link 'GitLab export'
......
......@@ -166,7 +166,7 @@ describe 'Jobs', :clean_gitlab_redis_shared_state do
let(:source_project) { fork_project(project, user, repository: true) }
let(:target_project) { project }
it 'shows merge request iid and source branch' do
it 'shows merge request iid and source branch', :sidekiq_might_not_need_inline do
visit project_job_path(source_project, job)
within '.js-pipeline-info' do
......@@ -214,7 +214,7 @@ describe 'Jobs', :clean_gitlab_redis_shared_state do
let(:source_project) { fork_project(project, user, repository: true) }
let(:target_project) { project }
it 'shows merge request iid and source branch' do
it 'shows merge request iid and source branch', :sidekiq_might_not_need_inline do
visit project_job_path(source_project, job)
within '.js-pipeline-info' do
......
......@@ -128,7 +128,7 @@ describe 'Pipeline', :js do
end
end
it 'cancels the running build and shows retry button' do
it 'cancels the running build and shows retry button', :sidekiq_might_not_need_inline do
find('#ci-badge-deploy .ci-action-icon-container').click
page.within('#ci-badge-deploy') do
......@@ -146,7 +146,7 @@ describe 'Pipeline', :js do
end
end
it 'cancels the preparing build and shows retry button' do
it 'cancels the preparing build and shows retry button', :sidekiq_might_not_need_inline do
find('#ci-badge-deploy .ci-action-icon-container').click
page.within('#ci-badge-deploy') do
......@@ -186,7 +186,7 @@ describe 'Pipeline', :js do
end
end
it 'unschedules the delayed job and shows play button as a manual job' do
it 'unschedules the delayed job and shows play button as a manual job', :sidekiq_might_not_need_inline do
find('#ci-badge-delayed-job .ci-action-icon-container').click
page.within('#ci-badge-delayed-job') do
......@@ -305,7 +305,9 @@ describe 'Pipeline', :js do
find('.js-retry-button').click
end
it { expect(page).not_to have_content('Retry') }
it 'does not show a "Retry" button', :sidekiq_might_not_need_inline do
expect(page).not_to have_content('Retry')
end
end
end
......@@ -321,7 +323,9 @@ describe 'Pipeline', :js do
click_on 'Cancel running'
end
it { expect(page).not_to have_content('Cancel running') }
it 'does not show a "Cancel running" button', :sidekiq_might_not_need_inline do
expect(page).not_to have_content('Cancel running')
end
end
end
......@@ -400,7 +404,7 @@ describe 'Pipeline', :js do
visit project_pipeline_path(source_project, pipeline)
end
it 'shows the pipeline information' do
it 'shows the pipeline information', :sidekiq_might_not_need_inline do
within '.pipeline-info' do
expect(page).to have_content("#{pipeline.statuses.count} jobs " \
"for !#{merge_request.iid} " \
......@@ -473,7 +477,7 @@ describe 'Pipeline', :js do
visit project_pipeline_path(source_project, pipeline)
end
it 'shows the pipeline information' do
it 'shows the pipeline information', :sidekiq_might_not_need_inline do
within '.pipeline-info' do
expect(page).to have_content("#{pipeline.statuses.count} jobs " \
"for !#{merge_request.iid} " \
......@@ -651,7 +655,9 @@ describe 'Pipeline', :js do
find('.js-retry-button').click
end
it { expect(page).not_to have_content('Retry') }
it 'does not show a "Retry" button', :sidekiq_might_not_need_inline do
expect(page).not_to have_content('Retry')
end
end
end
......@@ -663,7 +669,9 @@ describe 'Pipeline', :js do
click_on 'Cancel running'
end
it { expect(page).not_to have_content('Cancel running') }
it 'does not show a "Cancel running" button', :sidekiq_might_not_need_inline do
expect(page).not_to have_content('Cancel running')
end
end
end
......
......@@ -133,14 +133,14 @@ describe 'Pipelines', :js do
wait_for_requests
end
it 'indicated that pipelines was canceled' do
it 'indicated that pipelines was canceled', :sidekiq_might_not_need_inline do
expect(page).not_to have_selector('.js-pipelines-cancel-button')
expect(page).to have_selector('.ci-canceled')
end
end
end
context 'when pipeline is retryable' do
context 'when pipeline is retryable', :sidekiq_might_not_need_inline do
let!(:build) do
create(:ci_build, pipeline: pipeline,
stage: 'test')
......@@ -185,33 +185,29 @@ describe 'Pipelines', :js do
visit project_pipelines_path(source_project)
end
shared_examples_for 'showing detached merge request pipeline information' do
it 'shows detached tag for the pipeline' do
shared_examples_for 'detached merge request pipeline' do
it 'shows pipeline information without pipeline ref', :sidekiq_might_not_need_inline do
within '.pipeline-tags' do
expect(page).to have_content('detached')
end
end
it 'shows the link of the merge request' do
within '.branch-commit' do
expect(page).to have_link(merge_request.iid,
href: project_merge_request_path(project, merge_request))
end
end
it 'does not show the ref of the pipeline' do
within '.branch-commit' do
expect(page).not_to have_link(pipeline.ref)
end
end
end
it_behaves_like 'showing detached merge request pipeline information'
it_behaves_like 'detached merge request pipeline'
context 'when source project is a forked project' do
let(:source_project) { fork_project(project, user, repository: true) }
it_behaves_like 'showing detached merge request pipeline information'
it_behaves_like 'detached merge request pipeline'
end
end
......@@ -233,20 +229,16 @@ describe 'Pipelines', :js do
end
shared_examples_for 'Correct merge request pipeline information' do
it 'does not show detached tag for the pipeline' do
it 'does not show detached tag for the pipeline, and shows the link of the merge request, and does not show the ref of the pipeline', :sidekiq_might_not_need_inline do
within '.pipeline-tags' do
expect(page).not_to have_content('detached')
end
end
it 'shows the link of the merge request' do
within '.branch-commit' do
expect(page).to have_link(merge_request.iid,
href: project_merge_request_path(project, merge_request))
end
end
it 'does not show the ref of the pipeline' do
within '.branch-commit' do
expect(page).not_to have_link(pipeline.ref)
end
......@@ -429,7 +421,7 @@ describe 'Pipelines', :js do
find('.js-modal-primary-action').click
end
it 'indicates that pipeline was canceled' do
it 'indicates that pipeline was canceled', :sidekiq_might_not_need_inline do
expect(page).not_to have_selector('.js-pipelines-cancel-button')
expect(page).to have_selector('.ci-canceled')
end
......@@ -452,7 +444,7 @@ describe 'Pipelines', :js do
expect(page).not_to have_selector('.js-pipelines-retry-button')
end
it 'has failed pipeline' do
it 'has failed pipeline', :sidekiq_might_not_need_inline do
expect(page).to have_selector('.ci-failed')
end
end
......
......@@ -190,7 +190,7 @@ describe 'Project' do
sign_in user
end
it 'shows a link to the source project when it is available' do
it 'shows a link to the source project when it is available', :sidekiq_might_not_need_inline do
visit project_path(forked_project)
expect(page).to have_content('Forked from')
......@@ -206,7 +206,7 @@ describe 'Project' do
expect(page).not_to have_content('Forked from')
end
it 'shows the name of the deleted project when the source was deleted' do
it 'shows the name of the deleted project when the source was deleted', :sidekiq_might_not_need_inline do
forked_project
Projects::DestroyService.new(base_project, base_project.owner).execute
......@@ -218,7 +218,7 @@ describe 'Project' do
context 'a fork of a fork' do
let(:fork_of_fork) { fork_project(forked_project, user, repository: true) }
it 'links to the base project if the source project is removed' do
it 'links to the base project if the source project is removed', :sidekiq_might_not_need_inline do
fork_of_fork
Projects::DestroyService.new(forked_project, user).execute
......@@ -263,7 +263,7 @@ describe 'Project' do
expect(page).to have_selector '#confirm_name_input:focus'
end
it 'removes a project' do
it 'removes a project', :sidekiq_might_not_need_inline do
expect { remove_with_confirm('Remove project', project.path) }.to change { Project.count }.by(-1)
expect(page).to have_content "Project '#{project.full_name}' is in the process of being deleted."
expect(Project.all.count).to be_zero
......
......@@ -5,7 +5,7 @@ require 'spec_helper'
describe 'GPG signed commits' do
let(:project) { create(:project, :public, :repository) }
it 'changes from unverified to verified when the user changes his email to match the gpg key' do
it 'changes from unverified to verified when the user changes his email to match the gpg key', :sidekiq_might_not_need_inline do
ref = GpgHelpers::SIGNED_AND_AUTHORED_SHA
user = create(:user, email: 'unrelated.user@example.org')
......@@ -30,7 +30,7 @@ describe 'GPG signed commits' do
expect(page).to have_button 'Verified'
end
it 'changes from unverified to verified when the user adds the missing gpg key' do
it 'changes from unverified to verified when the user adds the missing gpg key', :sidekiq_might_not_need_inline do
ref = GpgHelpers::SIGNED_AND_AUTHORED_SHA
user = create(:user, email: GpgHelpers::User1.emails.first)
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe 'Unsubscribe links' do
describe 'Unsubscribe links', :sidekiq_might_not_need_inline do
include Warden::Test::Helpers
let(:recipient) { create(:user) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe 'Merge request > User sees revert modal', :js do
describe 'Merge request > User sees revert modal', :js, :sidekiq_might_not_need_inline do
let(:project) { create(:project, :public, :repository) }
let(:user) { project.creator }
let(:merge_request) { create(:merge_request, source_project: project) }
......
......@@ -163,6 +163,20 @@ describe IssuesFinder do
end
end
context 'filtering by nonexistent author ID and issue term using CTE for search' do
let(:params) do
{
author_id: 'does-not-exist',
search: 'git',
attempt_group_search_optimizations: true
}
end
it 'returns no results' do
expect(issues).to be_empty
end
end
context 'filtering by milestone' do
let(:params) { { milestone_title: milestone.title } }
......
......@@ -23,6 +23,18 @@ describe MergeRequestsFinder do
expect(merge_requests).to contain_exactly(merge_request1)
end
it 'filters by nonexistent author ID and MR term using CTE for search' do
params = {
author_id: 'does-not-exist',
search: 'git',
attempt_group_search_optimizations: true
}
merge_requests = described_class.new(user, params).execute
expect(merge_requests).to be_empty
end
it 'filters by projects' do
params = { projects: [project2.id, project3.id] }
......
......@@ -2,8 +2,7 @@
class="js-kubernetes-logs"
data-current-environment-name="production"
data-environments-path="/root/my-project/environments.json"
data-logs-page="/root/my-project/environments/1/logs"
data-logs-path="/root/my-project/environments/1/logs.json"
data-logs-endpoint="/root/my-project/environments/1/logs.json"
>
<div class="build-page-pod-logs">
<div class="build-trace-container prepend-top-default">
......
......@@ -11,6 +11,7 @@ describe('Tracking', () => {
namespace: '_namespace_',
hostname: 'app.gitfoo.com',
cookieDomain: '.gitfoo.com',
userId: null,
};
snowplowSpy = jest.spyOn(window, 'snowplow');
});
......@@ -34,6 +35,7 @@ describe('Tracking', () => {
contexts: { webPage: true },
formTracking: false,
linkClickTracking: false,
userId: null,
});
});
......@@ -41,15 +43,18 @@ describe('Tracking', () => {
initUserTracking();
expect(snowplowSpy).toHaveBeenCalledWith('enableActivityTracking', 30, 30);
expect(snowplowSpy).toHaveBeenCalledWith('trackPageView');
expect(snowplowSpy).not.toHaveBeenCalledWith('setUserId');
expect(snowplowSpy).not.toHaveBeenCalledWith('enableFormTracking');
expect(snowplowSpy).not.toHaveBeenCalledWith('enableLinkClickTracking');
window.snowplowOptions = Object.assign({}, window.snowplowOptions, {
formTracking: true,
linkClickTracking: true,
userId: '1',
});
initUserTracking();
expect(snowplowSpy).toHaveBeenCalledWith('setUserId', '1');
expect(snowplowSpy).toHaveBeenCalledWith('enableFormTracking');
expect(snowplowSpy).toHaveBeenCalledWith('enableLinkClickTracking');
});
......
......@@ -70,7 +70,7 @@ describe Backup::Repository do
end
context 'restoring object pools' do
it 'schedules restoring of the pool' do
it 'schedules restoring of the pool', :sidekiq_might_not_need_inline do
pool_repository = create(:pool_repository, :failed)
pool_repository.delete_object_pool
......
......@@ -33,7 +33,7 @@ describe ScheduleCalculateWikiSizes, :migration, :sidekiq do
end
end
it 'calculates missing wiki sizes' do
it 'calculates missing wiki sizes', :sidekiq_might_not_need_inline do
expect(project_statistics.find_by(id: 2).wiki_size).to be_nil
expect(project_statistics.find_by(id: 3).wiki_size).to be_nil
......
......@@ -26,7 +26,7 @@ describe Gitlab::Badge::Pipeline::Status do
end
end
context 'pipeline exists' do
context 'pipeline exists', :sidekiq_might_not_need_inline do
let!(:pipeline) { create_pipeline(project, sha, branch) }
context 'pipeline success' do
......
......@@ -90,7 +90,7 @@ describe Gitlab::BareRepositoryImport::Importer, :seed_helper do
hook_path = File.join(repo_path, 'hooks')
expect(gitlab_shell.repository_exists?(project.repository_storage, repo_path)).to be(true)
expect(gitlab_shell.exists?(project.repository_storage, hook_path)).to be(true)
expect(TestEnv.storage_dir_exists?(project.repository_storage, hook_path)).to be(true)
end
context 'hashed storage enabled' do
......
......@@ -58,7 +58,7 @@ describe Gitlab::Checks::LfsIntegrity do
end
end
context 'for forked project' do
context 'for forked project', :sidekiq_might_not_need_inline do
let(:parent_project) { create(:project, :repository) }
let(:project) { fork_project(parent_project, nil, repository: true) }
......
......@@ -129,7 +129,7 @@ describe 'cycle analytics events' do
end
end
describe '#test_events' do
describe '#test_events', :sidekiq_might_not_need_inline do
let(:stage) { :test }
let(:merge_request) { MergeRequest.first }
......@@ -234,7 +234,7 @@ describe 'cycle analytics events' do
end
end
describe '#staging_events' do
describe '#staging_events', :sidekiq_might_not_need_inline do
let(:stage) { :staging }
let(:merge_request) { MergeRequest.first }
......@@ -306,7 +306,7 @@ describe 'cycle analytics events' do
end
end
describe '#production_events' do
describe '#production_events', :sidekiq_might_not_need_inline do
let(:stage) { :production }
let!(:context) { create(:issue, project: project, created_at: 2.days.ago) }
......
......@@ -71,7 +71,7 @@ describe Gitlab::CycleAnalytics::UsageData do
}
end
it 'returns the aggregated usage data of every selected project' do
it 'returns the aggregated usage data of every selected project', :sidekiq_might_not_need_inline do
result = subject.to_json
expect(result).to have_key(:avg_cycle_analytics)
......
......@@ -43,7 +43,7 @@ RSpec.describe Gitlab::Gpg::InvalidGpgSignatureUpdater do
verification_status: 'verified'
end
it 'assigns the gpg key to the signature when the missing gpg key is added' do
it 'assigns the gpg key to the signature when the missing gpg key is added', :sidekiq_might_not_need_inline do
# InvalidGpgSignatureUpdater is called by the after_create hook
gpg_key = create :gpg_key,
key: GpgHelpers::User1.public_key,
......@@ -86,7 +86,7 @@ RSpec.describe Gitlab::Gpg::InvalidGpgSignatureUpdater do
verification_status: 'unknown_key'
end
it 'updates the signature to being valid when the missing gpg key is added' do
it 'updates the signature to being valid when the missing gpg key is added', :sidekiq_might_not_need_inline do
# InvalidGpgSignatureUpdater is called by the after_create hook
gpg_key = create :gpg_key,
key: GpgHelpers::User1.public_key,
......@@ -133,7 +133,7 @@ RSpec.describe Gitlab::Gpg::InvalidGpgSignatureUpdater do
verification_status: 'unknown_key'
end
it 'updates the signature to being valid when the user updates the email address' do
it 'updates the signature to being valid when the user updates the email address', :sidekiq_might_not_need_inline do
gpg_key = create :gpg_key,
key: GpgHelpers::User1.public_key,
user: user
......@@ -152,7 +152,7 @@ RSpec.describe Gitlab::Gpg::InvalidGpgSignatureUpdater do
)
end
it 'keeps the signature at being invalid when the changed email address is still unrelated' do
it 'keeps the signature at being invalid when the changed email address is still unrelated', :sidekiq_might_not_need_inline do
gpg_key = create :gpg_key,
key: GpgHelpers::User1.public_key,
user: user
......@@ -192,7 +192,7 @@ RSpec.describe Gitlab::Gpg::InvalidGpgSignatureUpdater do
verification_status: 'unknown_key'
end
it 'updates the signature to being valid when the missing gpg key is added' do
it 'updates the signature to being valid when the missing gpg key is added', :sidekiq_might_not_need_inline do
# InvalidGpgSignatureUpdater is called by the after_create hook
gpg_key = create(:gpg_key, key: GpgHelpers::User3.public_key, user: user)
subkey = gpg_key.subkeys.last
......
......@@ -42,7 +42,7 @@ describe Gitlab::HashedStorage::Migrator, :sidekiq, :redis do
subject.bulk_migrate(start: ids.min, finish: ids.max)
end
it 'has all projects migrated and set as writable' do
it 'has all projects migrated and set as writable', :sidekiq_might_not_need_inline do
perform_enqueued_jobs do
subject.bulk_migrate(start: ids.min, finish: ids.max)
end
......@@ -79,7 +79,7 @@ describe Gitlab::HashedStorage::Migrator, :sidekiq, :redis do
subject.bulk_rollback(start: ids.min, finish: ids.max)
end
it 'has all projects rolledback and set as writable' do
it 'has all projects rolledback and set as writable', :sidekiq_might_not_need_inline do
perform_enqueued_jobs do
subject.bulk_rollback(start: ids.min, finish: ids.max)
end
......@@ -108,7 +108,7 @@ describe Gitlab::HashedStorage::Migrator, :sidekiq, :redis do
expect { subject.migrate(project) }.not_to raise_error
end
it 'migrates project storage' do
it 'migrates project storage', :sidekiq_might_not_need_inline do
perform_enqueued_jobs do
subject.migrate(project)
end
......@@ -154,7 +154,7 @@ describe Gitlab::HashedStorage::Migrator, :sidekiq, :redis do
expect { subject.rollback(project) }.not_to raise_error
end
it 'rolls-back project storage' do
it 'rolls-back project storage', :sidekiq_might_not_need_inline do
perform_enqueued_jobs do
subject.rollback(project)
end
......
......@@ -47,7 +47,7 @@ describe 'forked project import' do
end
end
it 'can access the MR' do
it 'can access the MR', :sidekiq_might_not_need_inline do
project.merge_requests.first.fetch_ref!
expect(project.repository.ref_exists?('refs/merge-requests/1/head')).to be_truthy
......
......@@ -11,7 +11,7 @@ describe Gitlab::PhabricatorImport::ProjectCreator do
subject(:creator) { described_class.new(user, params) }
describe '#execute' do
it 'creates a project correctly and schedule an import' do
it 'creates a project correctly and schedule an import', :sidekiq_might_not_need_inline do
expect_next_instance_of(Gitlab::PhabricatorImport::Importer) do |importer|
expect(importer).to receive(:execute)
end
......
......@@ -310,18 +310,18 @@ describe Gitlab::Shell do
let(:disk_path) { "#{project.disk_path}.git" }
it 'returns true when the command succeeds' do
expect(gitlab_shell.exists?(project.repository_storage, disk_path)).to be(true)
expect(TestEnv.storage_dir_exists?(project.repository_storage, disk_path)).to be(true)
expect(gitlab_shell.remove_repository(project.repository_storage, project.disk_path)).to be(true)
expect(gitlab_shell.exists?(project.repository_storage, disk_path)).to be(false)
expect(TestEnv.storage_dir_exists?(project.repository_storage, disk_path)).to be(false)
end
it 'keeps the namespace directory' do
gitlab_shell.remove_repository(project.repository_storage, project.disk_path)
expect(gitlab_shell.exists?(project.repository_storage, disk_path)).to be(false)
expect(gitlab_shell.exists?(project.repository_storage, project.disk_path.gsub(project.name, ''))).to be(true)
expect(TestEnv.storage_dir_exists?(project.repository_storage, disk_path)).to be(false)
expect(TestEnv.storage_dir_exists?(project.repository_storage, project.disk_path.gsub(project.name, ''))).to be(true)
end
end
......@@ -332,18 +332,18 @@ describe Gitlab::Shell do
old_path = project2.disk_path
new_path = "project/new_path"
expect(gitlab_shell.exists?(project2.repository_storage, "#{old_path}.git")).to be(true)
expect(gitlab_shell.exists?(project2.repository_storage, "#{new_path}.git")).to be(false)
expect(TestEnv.storage_dir_exists?(project2.repository_storage, "#{old_path}.git")).to be(true)
expect(TestEnv.storage_dir_exists?(project2.repository_storage, "#{new_path}.git")).to be(false)
expect(gitlab_shell.mv_repository(project2.repository_storage, old_path, new_path)).to be_truthy
expect(gitlab_shell.exists?(project2.repository_storage, "#{old_path}.git")).to be(false)
expect(gitlab_shell.exists?(project2.repository_storage, "#{new_path}.git")).to be(true)
expect(TestEnv.storage_dir_exists?(project2.repository_storage, "#{old_path}.git")).to be(false)
expect(TestEnv.storage_dir_exists?(project2.repository_storage, "#{new_path}.git")).to be(true)
end
it 'returns false when the command fails' do
expect(gitlab_shell.mv_repository(project2.repository_storage, project2.disk_path, '')).to be_falsy
expect(gitlab_shell.exists?(project2.repository_storage, "#{project2.disk_path}.git")).to be(true)
expect(TestEnv.storage_dir_exists?(project2.repository_storage, "#{project2.disk_path}.git")).to be(true)
end
end
......@@ -403,56 +403,32 @@ describe Gitlab::Shell do
it 'creates a namespace' do
subject.add_namespace(storage, "mepmep")
expect(subject.exists?(storage, "mepmep")).to be(true)
expect(TestEnv.storage_dir_exists?(storage, "mepmep")).to be(true)
end
end
describe '#exists?' do
context 'when the namespace does not exist' do
describe '#repository_exists?' do
context 'when the repository does not exist' do
it 'returns false' do
expect(subject.exists?(storage, "non-existing")).to be(false)
expect(subject.repository_exists?(storage, "non-existing.git")).to be(false)
end
end
context 'when the namespace exists' do
context 'when the repository exists' do
it 'returns true' do
subject.add_namespace(storage, "mepmep")
project = create(:project, :repository, :legacy_storage)
expect(subject.exists?(storage, "mepmep")).to be(true)
expect(subject.repository_exists?(storage, project.repository.disk_path + ".git")).to be(true)
end
end
end
describe '#repository_exists?' do
context 'when the storage path does not exist' do
subject { described_class.new.repository_exists?(storage, "non-existing.git") }
it { is_expected.to be_falsey }
end
context 'when the repository does not exist' do
let(:project) { create(:project, :repository, :legacy_storage) }
subject { described_class.new.repository_exists?(storage, "#{project.repository.disk_path}-some-other-repo.git") }
it { is_expected.to be_falsey }
end
context 'when the repository exists' do
let(:project) { create(:project, :repository, :legacy_storage) }
subject { described_class.new.repository_exists?(storage, "#{project.repository.disk_path}.git") }
it { is_expected.to be_truthy }
end
end
describe '#remove' do
it 'removes the namespace' do
subject.add_namespace(storage, "mepmep")
subject.rm_namespace(storage, "mepmep")
expect(subject.exists?(storage, "mepmep")).to be(false)
expect(TestEnv.storage_dir_exists?(storage, "mepmep")).to be(false)
end
end
......@@ -461,8 +437,8 @@ describe Gitlab::Shell do
subject.add_namespace(storage, "mepmep")
subject.mv_namespace(storage, "mepmep", "2mep")
expect(subject.exists?(storage, "mepmep")).to be(false)
expect(subject.exists?(storage, "2mep")).to be(true)
expect(TestEnv.storage_dir_exists?(storage, "mepmep")).to be(false)
expect(TestEnv.storage_dir_exists?(storage, "2mep")).to be(true)
end
end
end
......
......@@ -19,7 +19,7 @@ describe Gitlab::SidekiqMiddleware::CorrelationLogger do
end
end
it 'injects into payload the correlation id' do
it 'injects into payload the correlation id', :sidekiq_might_not_need_inline do
expect_any_instance_of(described_class).to receive(:call).and_call_original
expect_any_instance_of(TestWorker).to receive(:perform).with(1234) do
......
......@@ -13,14 +13,17 @@ describe Gitlab::Tracking do
describe '.snowplow_options' do
it 'returns useful client options' do
expect(described_class.snowplow_options(nil)).to eq(
expected_fields = {
namespace: 'gl',
hostname: 'gitfoo.com',
cookieDomain: '.gitfoo.com',
appId: '_abc123_',
formTracking: true,
linkClickTracking: true
)
linkClickTracking: true,
userId: nil
}
expect(subject.snowplow_options(nil, nil)).to match(expected_fields)
end
it 'enables features using feature flags' do
......@@ -29,11 +32,12 @@ describe Gitlab::Tracking do
:additional_snowplow_tracking,
'_group_'
).and_return(false)
expect(described_class.snowplow_options('_group_')).to include(
addition_feature_fields = {
formTracking: false,
linkClickTracking: false
)
}
expect(subject.snowplow_options('_group_', nil)).to include(addition_feature_fields)
end
end
......
......@@ -148,7 +148,7 @@ describe Gitlab::UserAccess do
)
end
it 'allows users that have push access to the canonical project to push to the MR branch' do
it 'allows users that have push access to the canonical project to push to the MR branch', :sidekiq_might_not_need_inline do
canonical_project.add_developer(user)
expect(access.can_push_to_branch?('awesome-feature')).to be_truthy
......
......@@ -32,7 +32,7 @@ describe ScheduleSetConfidentialNoteEventsOnServices, :migration, :sidekiq do
end
end
it 'correctly processes services' do
it 'correctly processes services', :sidekiq_might_not_need_inline do
perform_enqueued_jobs do
expect(services_table.where(confidential_note_events: nil).count).to eq 4
expect(services_table.where(confidential_note_events: true).count).to eq 1
......
......@@ -20,7 +20,7 @@ describe BackfillStoreProjectFullPathInRepo, :migration do
describe '#up' do
shared_examples_for 'writes the full path to git config' do
it 'writes the git config' do
it 'writes the git config', :sidekiq_might_not_need_inline do
expect_next_instance_of(Gitlab::GitalyClient::RepositoryService) do |repository_service|
allow(repository_service).to receive(:cleanup)
expect(repository_service).to receive(:set_config).with('gitlab.fullpath' => expected_path)
......@@ -29,7 +29,7 @@ describe BackfillStoreProjectFullPathInRepo, :migration do
migration.up
end
it 'retries in case of failure' do
it 'retries in case of failure', :sidekiq_might_not_need_inline do
repository_service = spy(:repository_service)
allow(Gitlab::GitalyClient::RepositoryService).to receive(:new).and_return(repository_service)
......@@ -40,7 +40,7 @@ describe BackfillStoreProjectFullPathInRepo, :migration do
migration.up
end
it 'cleans up repository before writing the config' do
it 'cleans up repository before writing the config', :sidekiq_might_not_need_inline do
expect_next_instance_of(Gitlab::GitalyClient::RepositoryService) do |repository_service|
expect(repository_service).to receive(:cleanup).ordered
expect(repository_service).to receive(:set_config).ordered
......@@ -87,7 +87,7 @@ describe BackfillStoreProjectFullPathInRepo, :migration do
context 'project in group' do
let!(:project) { projects.create!(namespace_id: group.id, name: 'baz', path: 'baz') }
it 'deletes the gitlab full config value' do
it 'deletes the gitlab full config value', :sidekiq_might_not_need_inline do
expect_any_instance_of(Gitlab::GitalyClient::RepositoryService)
.to receive(:delete_config).with(['gitlab.fullpath'])
......
......@@ -23,7 +23,7 @@ describe FillFileStore, :migration do
uploads.create!(size: 10, path: 'path', uploader: 'uploader', mount_point: 'file_name', store: nil)
end
it 'correctly migrates nullified file_store/store column' do
it 'correctly migrates nullified file_store/store column', :sidekiq_might_not_need_inline do
expect(job_artifacts.where(file_store: nil).count).to eq(1)
expect(lfs_objects.where(file_store: nil).count).to eq(1)
expect(uploads.where(store: nil).count).to eq(1)
......
......@@ -3,7 +3,7 @@
require 'spec_helper'
require Rails.root.join('db', 'post_migrate', '20190703185326_fix_wrong_pages_access_level.rb')
describe FixWrongPagesAccessLevel, :migration, :sidekiq, schema: 20190628185004 do
describe FixWrongPagesAccessLevel, :migration, :sidekiq_might_not_need_inline, schema: 20190628185004 do
using RSpec::Parameterized::TableSyntax
let(:migration_class) { described_class::MIGRATION }
......
......@@ -42,7 +42,7 @@ describe MigrateLegacyArtifactsToJobArtifacts, :migration, :sidekiq do
end
end
it 'migrates legacy artifacts to ci_job_artifacts table' do
it 'migrates legacy artifacts to ci_job_artifacts table', :sidekiq_might_not_need_inline do
migrate!
expect(job_artifacts.order(:job_id, :file_type).pluck('project_id, job_id, file_type, file_store, size, expire_at, file, file_sha256, file_location'))
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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