Commit 58a1f0f9 authored by Jan Provaznik's avatar Jan Provaznik

Merge branch 'ee-22992-default-sidekiq-to-fake-mode-in-test-env' into 'master'

Change Sidekiq testing mode to `fake` instead of `inline`

See merge request gitlab-org/gitlab!15479
parents a2f03694 6309f06b
---
title: Make 'Sidekiq::Testing.fake!' mode as default
merge_request: 31662
author: "@blackst0ne"
type: other
......@@ -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
......
......@@ -111,7 +111,7 @@ describe ProjectsController do
stub_uploads_object_storage(FileUploader)
end
it 'creates the project from project template' do
it 'creates the project from project template', :sidekiq_might_not_need_inline do
post :create, params: { project: templates_params }
created_project = Project.find_by_path('foo')
......
......@@ -2,7 +2,7 @@
require "spec_helper"
describe "Admin sends notification", :js do
describe "Admin sends notification", :js, :sidekiq_might_not_need_inline do
let(:group) { create(:group) }
let!(:project) { create(:project, group: group) }
let(:admin) { create(:admin) }
......
......@@ -169,7 +169,7 @@ describe 'Group Cycle Analytics', :js do
{ title: "Production", description: "From issue creation until deploy to production", events_count: 1, median: "5 days" }
]
it 'each stage will have median values' do
it 'each stage will have median values', :sidekiq_might_not_need_inline do
stages = page.all(".stage-nav .stage-median").collect(&:text)
stages.each_with_index do |median, index|
......@@ -177,7 +177,7 @@ describe 'Group Cycle Analytics', :js do
end
end
it 'each stage will display the events description when selected' do
it 'each stage will display the events description when selected', :sidekiq_might_not_need_inline do
dummy_stages.each do |stage|
select_stage(stage[:title])
......@@ -185,7 +185,7 @@ describe 'Group Cycle Analytics', :js do
end
end
it 'each stage with events will display the stage events list when selected' do
it 'each stage with events will display the stage events list when selected', :sidekiq_might_not_need_inline do
dummy_stages.each do |stage|
select_stage(stage[:title])
......
......@@ -105,7 +105,7 @@ describe 'Referencing Epics', :js do
wait_for_requests
end
it 'creates a note with reference and cross references the epic' do
it 'creates a note with reference and cross references the epic', :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(epic.to_reference(full: true))
......@@ -131,7 +131,7 @@ describe 'Referencing Epics', :js do
wait_for_requests
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(issue.to_reference(full: true))
......
......@@ -49,13 +49,13 @@ describe 'Issues csv' do
expect(page).to have_content "emailed to #{user.notification_email}"
end
it 'includes a csv attachment' do
it 'includes a csv attachment', :sidekiq_might_not_need_inline do
request_csv
expect(attachment.content_type).to include('text/csv')
end
it 'ignores pagination' do
it 'ignores pagination', :sidekiq_might_not_need_inline do
create_list(:issue, 30, project: project, author: user)
request_csv
......@@ -63,13 +63,13 @@ describe 'Issues csv' do
expect(csv.count).to eq 31
end
it 'uses filters from issue index' do
it 'uses filters from issue index', :sidekiq_might_not_need_inline do
request_csv(state: :closed)
expect(csv.count).to eq 0
end
it 'ignores sorting from issue index' do
it 'ignores sorting from issue index', :sidekiq_might_not_need_inline do
issue2 = create(:labeled_issue, project: project, author: user, labels: [feature_label])
request_csv(sort: :label_priority)
......@@ -78,7 +78,7 @@ describe 'Issues csv' do
expect(csv.map { |row| row['Issue ID'] }).to eq expected
end
it 'uses array filters, such as label_name' do
it 'uses array filters, such as label_name', :sidekiq_might_not_need_inline do
issue.update!(labels: [idea_label])
request_csv("label_name[]" => 'Bug')
......
......@@ -70,7 +70,7 @@ describe 'Merge request > User sees merge widget', :js do
let(:traits) { [:with_detached_merge_request_pipeline] }
let(:options) { {} }
it 'shows a warning that fork project cannot create merge request pipelines' do
it 'shows a warning that fork project cannot create merge request pipelines', :sidekiq_might_not_need_inline do
visit project_merge_request_path(project, merge_request)
within('.warning_message') do
......
......@@ -24,7 +24,7 @@ describe 'Merge request > User sets approval rules', :js do
wait_for_requests
end
it "shows approval rules from target project" do
it "shows approval rules from target project", :sidekiq_might_not_need_inline do
names = page_rule_names
regular_rules.each_with_index do |rule, idx|
expect(names[idx]).to have_text(rule.name)
......
......@@ -45,7 +45,7 @@ describe 'Merge request > User sets approvers', :js do
visit project_new_merge_request_path(forked_project, merge_request: { target_branch: 'master', source_branch: 'feature' })
end
it 'allows setting other users as approvers but does not allow setting the current user as an approver, and filters non members from approvers list' do
it 'allows setting other users as approvers but does not allow setting the current user as an approver, and filters non members from approvers list', :sidekiq_might_not_need_inline do
open_modal
open_approver_select
......
......@@ -48,7 +48,7 @@ describe 'Two merge requests on a merge train' do
merge_request_2.reload
end
it 'creates a pipeline for merge request 1' do
it 'creates a pipeline for merge request 1', :sidekiq_might_not_need_inline do
expect(merge_request_1.merge_train.pipeline).to be_merge_request_pipeline
expect(merge_request_1.merge_train.pipeline.user).to eq(maintainer_1)
expect(merge_request_1.merge_train.pipeline.ref).to eq(merge_request_1.train_ref_path)
......@@ -56,7 +56,7 @@ describe 'Two merge requests on a merge train' do
.to eq(project.repository.commit('refs/heads/master').sha)
end
it 'creates a pipeline for merge request 2' do
it 'creates a pipeline for merge request 2', :sidekiq_might_not_need_inline do
expect(merge_request_2.merge_train.pipeline).to be_merge_request_pipeline
expect(merge_request_2.merge_train.pipeline.user).to eq(maintainer_2)
expect(merge_request_2.merge_train.pipeline.ref).to eq(merge_request_2.train_ref_path)
......@@ -70,7 +70,7 @@ describe 'Two merge requests on a merge train' do
end
shared_examples_for 'drops merge request 1 from the merge train' do
it 'drops merge request 1 from the merge train' do
it 'drops merge request 1 from the merge train', :sidekiq_might_not_need_inline do
expect(merge_request_1).to be_opened
expect(merge_request_1.merge_train).to be_nil
expect(merge_request_1.notes.last.note).to eq(system_note)
......@@ -78,7 +78,7 @@ describe 'Two merge requests on a merge train' do
end
shared_examples_for 'has an intact pipeline for merge request 2' do
it 'does not create a new pipeline for merge request 2' do
it 'does not create a new pipeline for merge request 2', :sidekiq_might_not_need_inline do
expect(merge_request_2.all_pipelines.count).to eq(1)
end
......@@ -89,7 +89,7 @@ describe 'Two merge requests on a merge train' do
merge_request_2.reload
end
it 'merges merge request 2' do
it 'merges merge request 2', :sidekiq_might_not_need_inline do
expect(merge_request_2).to be_merged
expect(merge_request_2.metrics.merged_by).to eq(maintainer_2)
expect(merge_request_2.merge_train).to be_nil
......@@ -98,7 +98,7 @@ describe 'Two merge requests on a merge train' do
end
shared_examples_for 're-creates a pipeline for merge request 2' do
it 'has recreated pipeline' do
it 'has recreated pipeline', :sidekiq_might_not_need_inline do
expect(merge_request_2.all_pipelines.count).to eq(2)
expect(merge_request_2.merge_train.pipeline.target_sha)
.to eq(target_branch_sha)
......@@ -111,7 +111,7 @@ describe 'Two merge requests on a merge train' do
merge_request_2.reload
end
it 'merges merge request 2' do
it 'merges merge request 2', :sidekiq_might_not_need_inline do
expect(merge_request_2).to be_merged
expect(merge_request_2.metrics.merged_by).to eq(maintainer_2)
expect(merge_request_2.merge_train).to be_nil
......@@ -127,7 +127,7 @@ describe 'Two merge requests on a merge train' do
merge_request_2.reload
end
it 'merges merge request 1' do
it 'merges merge request 1', :sidekiq_might_not_need_inline do
expect(merge_request_1).to be_merged
expect(merge_request_1.metrics.merged_by).to eq(maintainer_1)
expect(merge_request_1.merge_train).to be_nil
......@@ -194,7 +194,7 @@ describe 'Two merge requests on a merge train' do
end
end
context 'when master got a new commit and pipeline for merge request 1 finished' do
context 'when master got a new commit and pipeline for merge request 1 finished', :sidekiq_might_not_need_inline do
before do
create_file_in_repo(project, 'master', 'master', 'test.txt', 'This is test')
......
......@@ -61,7 +61,7 @@ describe 'User adds a merge request to a merge train', :js do
end
end
context 'when pipeline for merge train succeeds' do
context 'when pipeline for merge train succeeds', :sidekiq_might_not_need_inline do
before do
visit project_merge_request_path(project, merge_request)
merge_request.merge_train.pipeline.builds.map(&:success!)
......
......@@ -35,7 +35,7 @@ describe 'Environment > Pod Logs', :js do
end
context 'with logs', :use_clean_rails_memory_store_caching do
it "shows pod logs" do
it "shows pod logs", :sidekiq_might_not_need_inline do
visit logs_project_environment_path(environment.project, environment, pod_name: pod_name)
wait_for_requests
......
......@@ -85,7 +85,7 @@ describe 'New project' do
end
end
it 'creates CI/CD project from repo URL' do
it 'creates CI/CD project from repo URL', :sidekiq_might_not_need_inline do
visit new_project_path
find('#ci-cd-project-tab').click
......
......@@ -75,7 +75,7 @@ describe 'Global elastic search', :elastic do
Gitlab::Elastic::Helper.refresh_index
end
it "has a pagination" do
it "has a pagination", :sidekiq_might_not_need_inline do
visit dashboard_projects_path
submit_search('initial')
......@@ -93,7 +93,7 @@ describe 'Global elastic search', :elastic do
Gitlab::Elastic::Helper.refresh_index
end
it "has a pagination" do
it "has a pagination", :sidekiq_might_not_need_inline do
visit dashboard_projects_path
submit_search('foo')
......@@ -112,7 +112,7 @@ describe 'Global elastic search', :elastic do
Gitlab::Elastic::Helper.refresh_index
end
it "finds files" do
it "finds files", :sidekiq_might_not_need_inline do
visit dashboard_projects_path
submit_search('application.js')
......@@ -153,7 +153,7 @@ describe 'Global elastic search', :elastic do
Gitlab::Elastic::Helper.refresh_index
end
it "finds files" do
it "finds files", :sidekiq_might_not_need_inline do
visit dashboard_projects_path
submit_search('term')
......@@ -171,7 +171,7 @@ describe 'Global elastic search', :elastic do
Gitlab::Elastic::Helper.refresh_index
end
it "finds commits" do
it "finds commits", :sidekiq_might_not_need_inline do
visit dashboard_projects_path
submit_search('add')
......@@ -181,7 +181,7 @@ describe 'Global elastic search', :elastic do
expect(page).to have_selector('.project-namespace')
end
it 'shows proper page 2 results' do
it 'shows proper page 2 results', :sidekiq_might_not_need_inline do
visit dashboard_projects_path
submit_search('add')
......@@ -207,7 +207,7 @@ describe 'Global elastic search', :elastic do
submit_search('project')
end
it 'displays result counts for all categories' do
it 'displays result counts for all categories', :sidekiq_might_not_need_inline do
expect(page).to have_content('Projects 1')
expect(page).to have_content('Issues 1')
expect(page).to have_content('Merge requests 0')
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe 'Group elastic search', :js, :elastic do
describe 'Group elastic search', :js, :elastic, :sidekiq_might_not_need_inline do
let(:user) { create(:user) }
let(:group) { create(:group) }
let(:project) { create(:project, :repository, :wiki_repo, namespace: group) }
......
......@@ -16,7 +16,7 @@ describe 'Project elastic search', :js, :elastic do
end
describe 'searching' do
it 'finds issues' do
it 'finds issues', :sidekiq_might_not_need_inline do
create(:issue, project: project, title: 'Test searching for an issue')
submit_search('Test')
......@@ -25,7 +25,7 @@ describe 'Project elastic search', :js, :elastic do
expect(page).to have_selector('.results', text: 'Test searching for an issue')
end
it 'finds merge requests' do
it 'finds merge requests', :sidekiq_might_not_need_inline do
create(:merge_request, source_project: project, target_project: project, title: 'Test searching for an MR')
submit_search('Test')
......@@ -34,7 +34,7 @@ describe 'Project elastic search', :js, :elastic do
expect(page).to have_selector('.results', text: 'Test searching for an MR')
end
it 'finds milestones' do
it 'finds milestones', :sidekiq_might_not_need_inline do
create(:milestone, project: project, title: 'Test searching for a milestone')
submit_search('Test')
......@@ -43,7 +43,7 @@ describe 'Project elastic search', :js, :elastic do
expect(page).to have_selector('.results', text: 'Test searching for a milestone')
end
it 'finds wiki pages' do
it 'finds wiki pages', :sidekiq_might_not_need_inline do
project.wiki.create_page('test.md', 'Test searching for a wiki page')
project.wiki.index_wiki_blobs
......@@ -53,7 +53,7 @@ describe 'Project elastic search', :js, :elastic do
expect(page).to have_selector('.results', text: 'Test searching for a wiki page')
end
it 'finds notes' do
it 'finds notes', :sidekiq_might_not_need_inline do
create(:note, project: project, note: 'Test searching for a comment')
submit_search('Test')
......@@ -62,7 +62,7 @@ describe 'Project elastic search', :js, :elastic do
expect(page).to have_selector('.results', text: 'Test searching for a comment')
end
it 'finds commits' do
it 'finds commits', :sidekiq_might_not_need_inline do
project.repository.index_commits_and_blobs
submit_search('initial')
......@@ -71,7 +71,7 @@ describe 'Project elastic search', :js, :elastic do
expect(page).to have_selector('.results', text: 'Initial commit')
end
it 'finds blobs' do
it 'finds blobs', :sidekiq_might_not_need_inline do
project.repository.index_commits_and_blobs
submit_search('def')
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe 'Snippet elastic search', :js, :elastic do
describe 'Snippet elastic search', :js, :elastic, :sidekiq_might_not_need_inline do
let(:public_project) { create(:project, :public) }
let(:authorized_user) { create(:user) }
let(:authorized_project) { create(:project, namespace: authorized_user.namespace) }
......
# frozen_string_literal: true
require 'spec_helper'
describe 'Analytics (JavaScript fixtures)' do
describe 'Analytics (JavaScript fixtures)', :sidekiq_inline do
include JavaScriptFixturesHelpers
let(:group) { create(:group)}
......
......@@ -59,7 +59,7 @@ describe SearchHelper do
stub_ee_application_setting(elasticsearch_search: true, elasticsearch_indexing: true)
end
it "returns parsed result" do
it "returns parsed result", :sidekiq_might_not_need_inline do
project = create :project, :repository
project.repository.index_commits_and_blobs
......@@ -96,7 +96,7 @@ describe SearchHelper do
)[:blobs][:results]
end
it 'returns all projects in the result page without causing an N+1' do
it 'returns all projects in the result page without causing an N+1', :sidekiq_might_not_need_inline do
control_count = ActiveRecord::QueryRecorder.new { blob_projects(es_blob_search) }.count
projects = create_list :project, 3, :repository, :public
......
......@@ -28,7 +28,7 @@ describe Gitlab::Elastic::ProjectSearchResults, :elastic do
it { expect(results.query).to eq('hello world') }
end
describe "search" do
describe "search", :sidekiq_might_not_need_inline do
it "returns correct amounts" do
project = create :project, :public, :repository, :wiki_repo
project1 = create :project, :public, :repository, :wiki_repo
......@@ -140,7 +140,7 @@ describe Gitlab::Elastic::ProjectSearchResults, :elastic do
end
end
describe 'confidential issues' do
describe 'confidential issues', :sidekiq_might_not_need_inline do
let(:query) { 'issue' }
let(:author) { create(:user) }
let(:assignee) { create(:user) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::Elastic::SearchResults, :elastic do
describe Gitlab::Elastic::SearchResults, :elastic, :sidekiq_might_not_need_inline do
before do
stub_ee_application_setting(elasticsearch_search: true, elasticsearch_indexing: true)
end
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::Elastic::SnippetSearchResults, :elastic do
describe Gitlab::Elastic::SnippetSearchResults, :elastic, :sidekiq_might_not_need_inline do
let(:snippet) { create(:personal_snippet, content: 'foo', file_name: 'foo') }
let(:results) { described_class.new(snippet.author, 'foo', []) }
......
......@@ -15,7 +15,7 @@ describe UpdateCsVulnerabilityConfidenceColumn, :migration, :sidekiq do
stub_const("#{described_class}::BATCH_SIZE", 2)
end
it 'updates confidence levels for container scanning reports' do
it 'updates confidence levels for container scanning reports', :sidekiq_might_not_need_inline do
projects.create!(id: 123, namespace_id: 12, name: 'gitlab', path: 'gitlab')
identifiers.create!(id: 1,
......
......@@ -48,7 +48,7 @@ describe Ci::Build do
let(:job) { create(:ci_build, :running, pipeline: pipeline) }
%w(success drop cancel).each do |event|
it "for event #{event}" do
it "for event #{event}", :sidekiq_might_not_need_inline do
expect(UpdateBuildMinutesService)
.to receive(:new).and_call_original
......
......@@ -18,7 +18,7 @@ describe MergeRequest, :elastic do
end
end
it "searches merge requests" do
it "searches merge requests", :sidekiq_might_not_need_inline do
project = create :project, :public, :repository
Sidekiq::Testing.inline! do
......@@ -40,7 +40,7 @@ describe MergeRequest, :elastic do
expect(described_class.elastic_search('term3', options: { project_ids: :any, public_and_internal_projects: true }).total_count).to eq(1)
end
it "searches by iid and scopes to type: merge_request only" do
it "searches by iid and scopes to type: merge_request only", :sidekiq_might_not_need_inline do
project = create :project, :public, :repository
merge_request = nil
......
......@@ -16,7 +16,7 @@ describe Milestone, :elastic do
end
end
it "searches milestones" do
it "searches milestones", :sidekiq_might_not_need_inline do
project = create :project
Sidekiq::Testing.inline! do
......
......@@ -36,7 +36,7 @@ describe Note, :elastic do
end
end
it "searches notes" do
it "searches notes", :sidekiq_might_not_need_inline do
issue = create :issue
Sidekiq::Testing.inline! do
......@@ -135,7 +135,7 @@ describe Note, :elastic do
expect(Note.elastic_search('term', options: options).total_count).to eq(0)
end
it "finds note when user is authorized to see it" do
it "finds note when user is authorized to see it", :sidekiq_might_not_need_inline do
user = create :user
issue = create :issue, :confidential, author: user
......@@ -150,7 +150,7 @@ describe Note, :elastic do
end
[:admin, :auditor].each do |user_type|
it "finds note for #{user_type}" do
it "finds note for #{user_type}", :sidekiq_might_not_need_inline do
superuser = create(user_type)
issue = create(:issue, :confidential, author: create(:user))
......@@ -165,7 +165,7 @@ describe Note, :elastic do
end
end
it "return notes with matching content for project members" do
it "return notes with matching content for project members", :sidekiq_might_not_need_inline do
user = create :user
issue = create :issue, :confidential, author: user
......
......@@ -62,7 +62,7 @@ describe Repository, :elastic do
search_and_check!(project.repository, '-foo', type: :commit)
end
describe 'class method find_commits_by_message_with_elastic' do
describe 'class method find_commits_by_message_with_elastic', :sidekiq_might_not_need_inline do
let(:project) { create :project, :repository }
let(:project1) { create :project, :repository }
let(:results) { Repository.find_commits_by_message_with_elastic('initial') }
......
......@@ -33,14 +33,14 @@ describe Snippet, :elastic do
Gitlab::Elastic::Helper.refresh_index
end
it 'returns only public snippets when user is blank' do
it 'returns only public snippets when user is blank', :sidekiq_might_not_need_inline do
result = described_class.elastic_search_code('password', options: { current_user: nil })
expect(result.total_count).to eq(1)
expect(result.records).to match_array [public_snippet]
end
it 'returns only public and internal personal snippets for non-members' do
it 'returns only public and internal personal snippets for non-members', :sidekiq_might_not_need_inline do
non_member = create(:user)
result = described_class.elastic_search_code('password', options: { current_user: non_member })
......@@ -49,7 +49,7 @@ describe Snippet, :elastic do
expect(result.records).to match_array [public_snippet, internal_snippet]
end
it 'returns public, internal snippets, and project private snippets for project members' do
it 'returns public, internal snippets, and project private snippets for project members', :sidekiq_might_not_need_inline do
member = create(:user)
project.add_developer(member)
......@@ -59,14 +59,14 @@ describe Snippet, :elastic do
expect(result.records).to match_array [public_snippet, internal_snippet, project_public_snippet, project_internal_snippet, project_private_snippet]
end
it 'returns private snippets where the user is the author' do
it 'returns private snippets where the user is the author', :sidekiq_might_not_need_inline do
result = described_class.elastic_search_code('password', options: { current_user: author })
expect(result.total_count).to eq(3)
expect(result.records).to match_array [public_snippet, internal_snippet, private_snippet]
end
it 'supports advanced search syntax' do
it 'supports advanced search syntax', :sidekiq_might_not_need_inline do
member = create(:user)
project.add_reporter(member)
......@@ -77,7 +77,7 @@ describe Snippet, :elastic do
end
[:admin, :auditor].each do |user_type|
it "returns all snippets for #{user_type}" do
it "returns all snippets for #{user_type}", :sidekiq_might_not_need_inline do
superuser = create(user_type)
result = described_class.elastic_search_code('password', options: { current_user: superuser })
......@@ -92,7 +92,7 @@ describe Snippet, :elastic do
allow(Ability).to receive(:allowed?).and_call_original
end
it 'returns public, internal snippets, but not project snippets' do
it 'returns public, internal snippets, but not project snippets', :sidekiq_might_not_need_inline do
member = create(:user)
project.add_developer(member)
expect(Ability).to receive(:allowed?).with(member, :read_cross_project) { false }
......
......@@ -19,7 +19,7 @@ describe ProjectImportState, type: :model do
context 'with a mirrored project' do
let(:import_state) { create(:import_state, :mirror) }
it 'calls RepositoryImportWorker and inserts in front of the mirror scheduler queue' do
it 'calls RepositoryImportWorker and inserts in front of the mirror scheduler queue', :sidekiq_might_not_need_inline do
allow_any_instance_of(EE::Project).to receive(:repository_exists?).and_return(false, true)
expect_any_instance_of(EE::ProjectImportState).to receive(:force_import_job!)
expect(RepositoryImportWorker).to receive(:perform_async).with(import_state.project_id).and_call_original
......
......@@ -83,7 +83,7 @@ describe Repository do
end
describe "class method find_commits_by_message_with_elastic" do
it "returns commits" do
it "returns commits", :sidekiq_might_not_need_inline do
project = create :project, :repository
project1 = create :project, :repository
......@@ -99,7 +99,7 @@ describe Repository do
end
describe "find_commits_by_message_with_elastic" do
it "returns commits" do
it "returns commits", :sidekiq_might_not_need_inline do
project = create :project, :repository
project.repository.index_commits_and_blobs
......
......@@ -95,7 +95,7 @@ describe API::Jobs do
end
context 'when artifacts are stored locally' do
it 'returns specific job artifacts' do
it 'returns specific job artifacts', :sidekiq_might_not_need_inline do
subject
expect(response).to have_gitlab_http_status(200)
......
......@@ -40,7 +40,7 @@ describe API::Search do
stub_ee_application_setting(elasticsearch_search: true, elasticsearch_indexing: true)
end
context 'for wiki_blobs scope' do
context 'for wiki_blobs scope', :sidekiq_might_not_need_inline do
before do
wiki = create(:project_wiki, project: project)
create(:wiki_page, wiki: wiki, attrs: { title: 'home', content: "Awesome page" })
......@@ -54,7 +54,7 @@ describe API::Search do
it_behaves_like 'response is correct', schema: 'public_api/v4/blobs'
end
context 'for commits scope' do
context 'for commits scope', :sidekiq_might_not_need_inline do
before do
repo_project.repository.index_commits_and_blobs
Gitlab::Elastic::Helper.refresh_index
......@@ -65,7 +65,7 @@ describe API::Search do
it_behaves_like 'response is correct', schema: 'public_api/v4/commits_details', size: 2
end
context 'for blobs scope' do
context 'for blobs scope', :sidekiq_might_not_need_inline do
before do
repo_project.repository.index_commits_and_blobs
Gitlab::Elastic::Helper.refresh_index
......
......@@ -86,7 +86,7 @@ describe 'cycle analytics events' do
expect(json_response['events'].first['iid']).to eq(first_mr_iid)
end
it 'lists the test events' do
it 'lists the test events', :sidekiq_might_not_need_inline do
get group_cycle_analytics_test_path(group, format: :json)
expect(json_response['events']).not_to be_empty
......@@ -102,14 +102,14 @@ describe 'cycle analytics events' do
expect(json_response['events'].first['iid']).to eq(first_mr_iid)
end
it 'lists the staging events' do
it 'lists the staging events', :sidekiq_might_not_need_inline do
get group_cycle_analytics_staging_path(group, format: :json)
expect(json_response['events']).not_to be_empty
expect(json_response['events'].first['date']).not_to be_empty
end
it 'lists the production events' do
it 'lists the production events', :sidekiq_might_not_need_inline do
get group_cycle_analytics_production_path(group, format: :json)
first_issue_iid = project.issues.sort_by_attribute(:created_desc).pluck(:iid).first.to_s
......@@ -119,7 +119,7 @@ describe 'cycle analytics events' do
end
context 'specific branch' do
it 'lists the test events' do
it 'lists the test events', :sidekiq_might_not_need_inline do
branch = project.merge_requests.first.source_branch
get group_cycle_analytics_test_path(group, format: :json, branch: branch)
......
......@@ -29,7 +29,7 @@ describe Ci::ProcessPipelineService, '#execute' do
stub_ci_pipeline_to_return_yaml_file
end
it 'creates a downstream cross-project pipeline' do
it 'creates a downstream cross-project pipeline', :sidekiq_might_not_need_inline do
pipeline.process!
expect_statuses(%w[test pending], %w[cross created], %w[deploy created])
......
......@@ -271,7 +271,7 @@ describe DesignManagement::SaveDesignsService do
expect { run_service }.to change { commit_count.call }.by(1)
end
it 'only does 5 gitaly calls', :request_store do
it 'only does 5 gitaly calls', :request_store, :sidekiq_might_not_need_inline do
service = described_class.new(project, user, issue: issue, files: files)
# Some unrelated calls that are usually cached or happen only once
service.__send__(:repository).create_if_not_exists
......
......@@ -32,7 +32,7 @@ describe DraftNotes::PublishService do
expect(DraftNote.count).to eq(1)
end
it 'does not skip notification' do
it 'does not skip notification', :sidekiq_might_not_need_inline do
expect(Notes::CreateService).to receive(:new).with(project, user, drafts.first.publish_params).and_call_original
expect_next_instance_of(NotificationService) do |notification_service|
expect(notification_service).to receive(:new_note)
......
......@@ -60,7 +60,7 @@ describe Git::BranchPushService do
subject.execute
end
it "triggers indexer when push to default branch" do
it "triggers indexer when push to default branch", :sidekiq_might_not_need_inline do
expect_any_instance_of(Gitlab::Elastic::Indexer).to receive(:run)
subject.execute
......
......@@ -44,18 +44,8 @@ describe MergeRequests::CreatePipelineService, :clean_gitlab_redis_shared_state
stub_ci_pipeline_yaml_file(YAML.dump(ci_yaml))
end
shared_examples_for 'creates a merge request pipeline' do
it do
subject
expect(merge_request.all_pipelines.count).to eq(1)
expect(merge_request.all_pipelines.last).to be_merge_request_pipeline
expect(merge_request.all_pipelines.last).not_to be_detached_merge_request_pipeline
end
end
shared_examples_for 'creates a detached merge request pipeline' do
it do
shared_examples_for 'detached merge request pipeline' do
it 'creates a detached merge request pipeline', :sidekiq_might_not_need_inline do
subject
expect(merge_request.all_pipelines.count).to eq(1)
......@@ -64,20 +54,26 @@ describe MergeRequests::CreatePipelineService, :clean_gitlab_redis_shared_state
end
end
it_behaves_like 'creates a merge request pipeline'
it 'creates a merge request pipeline', :sidekiq_might_not_need_inline do
subject
expect(merge_request.all_pipelines.count).to eq(1)
expect(merge_request.all_pipelines.last).to be_merge_request_pipeline
expect(merge_request.all_pipelines.last).not_to be_detached_merge_request_pipeline
end
context 'when merge request is WIP' do
before do
merge_request.update!(title: merge_request.wip_title)
end
it_behaves_like 'creates a detached merge request pipeline'
it_behaves_like 'detached merge request pipeline'
end
context 'when project setting for merge request pipelines is disabled' do
let(:merge_pipelines_enabled) { false }
it_behaves_like 'creates a detached merge request pipeline'
it_behaves_like 'detached merge request pipeline'
end
context 'when ci_use_merge_request_ref feature flag is disabled' do
......@@ -85,13 +81,13 @@ describe MergeRequests::CreatePipelineService, :clean_gitlab_redis_shared_state
stub_feature_flags(ci_use_merge_request_ref: false)
end
it_behaves_like 'creates a detached merge request pipeline'
it_behaves_like 'detached merge request pipeline'
end
context 'when merge request is submitted from fork' do
let(:source_project) { fork_project(project, nil, repository: true) }
it_behaves_like 'creates a detached merge request pipeline'
it_behaves_like 'detached merge request pipeline'
end
context 'when the CreateService is retried' do
......@@ -105,14 +101,14 @@ describe MergeRequests::CreatePipelineService, :clean_gitlab_redis_shared_state
context 'when merge request has no commit' do
let(:source_branch) { 'empty-branch' }
it_behaves_like 'creates a detached merge request pipeline'
it_behaves_like 'detached merge request pipeline'
end
context 'when merge request has a conflict' do
let(:source_branch) { 'feature' }
let(:target_branch) { 'feature_conflict' }
it_behaves_like 'creates a detached merge request pipeline'
it_behaves_like 'detached merge request pipeline'
end
end
end
......@@ -39,7 +39,7 @@ describe Notes::CreateService do
expect(note.noteable).to eq(design)
end
it 'sends a notification about this note' do
it 'sends a notification about this note', :sidekiq_might_not_need_inline do
notifier = double
allow(::NotificationService).to receive(:new).and_return(notifier)
......
......@@ -81,7 +81,7 @@ describe MergeRequests::RefreshService do
end
context 'open fork merge request' do
it 'resets approvals' do
it 'resets approvals', :sidekiq_might_not_need_inline do
refresh
expect(@merge_request.approvals).not_to be_empty
......@@ -94,7 +94,7 @@ describe MergeRequests::RefreshService do
@fork_merge_request.close!
end
it 'resets approvals' do
it 'resets approvals', :sidekiq_might_not_need_inline do
refresh
expect(@merge_request.approvals).not_to be_empty
......@@ -110,7 +110,7 @@ describe MergeRequests::RefreshService do
reload_mrs
end
it 'does not reset approvals' do
it 'does not reset approvals', :sidekiq_might_not_need_inline do
expect(@merge_request.approvals).not_to be_empty
expect(@fork_merge_request.approvals).not_to be_empty
end
......
......@@ -109,7 +109,9 @@ describe MergeRequests::UpdateService, :mailer do
end
it { expect(@merge_request).to be_valid }
it { expect(@merge_request.state).to eq('merged') }
it 'is in the "merge" state', :sidekiq_might_not_need_inline do
expect(@merge_request.state).to eq('merged')
end
end
end
......
......@@ -53,7 +53,7 @@ describe MergeTrains::RefreshMergeRequestService do
shared_examples_for 'cancels and recreates a pipeline for the merge train' do
let(:previous_ref) { 'refs/heads/master' }
it do
it 'cancels and recreates a pipeline for the merge train', :sidekiq_might_not_need_inline do
expect_next_instance_of(MergeTrains::CreatePipelineService, project, maintainer) do |pipeline_service|
allow(pipeline_service).to receive(:execute) { { status: :success, pipeline: create(:ci_pipeline) } }
expect(pipeline_service).to receive(:execute).with(merge_request, previous_ref)
......
......@@ -232,7 +232,7 @@ describe Projects::Prometheus::Alerts::NotifyService do
context 'when incident_management_setting does not exist' do
it_behaves_like 'persists events'
it 'does not send notification email' do
it 'does not send notification email', :sidekiq_might_not_need_inline do
expect(project.feature_available?(:incident_management)).to eq(true)
expect_next_instance_of(NotificationService) do |service|
......
......@@ -252,7 +252,7 @@ describe Projects::UpdateService, '#execute' do
end
context 'when merge pipelines option is disabled' do
it 'drops all merge request in the train' do
it 'drops all merge request in the train', :sidekiq_might_not_need_inline do
expect do
update_project(project, user, merge_pipelines_enabled: false)
end.to change { MergeTrain.count }.from(2).to(0)
......
......@@ -50,7 +50,7 @@ describe Search::GroupService, :elastic do
Gitlab::Elastic::Helper.refresh_index
end
context 'finding projects by name' do
context 'finding projects by name', :sidekiq_might_not_need_inline do
subject { results.objects('projects') }
context 'in parent group' do
......
......@@ -13,7 +13,7 @@ shared_examples 'no results when the user cannot read cross project' do
Gitlab::Elastic::Helper.refresh_index
end
it 'returns the record if a single project was passed' do
it 'returns the record if a single project was passed', :sidekiq_might_not_need_inline do
result = described_class.elastic_search(
'test',
options: {
......@@ -25,7 +25,7 @@ shared_examples 'no results when the user cannot read cross project' do
expect(result.records).to match_array [record1]
end
it 'does not return anything when trying to search cross project' do
it 'does not return anything when trying to search cross project', :sidekiq_might_not_need_inline do
result = described_class.elastic_search(
'test',
options: {
......
......@@ -60,7 +60,7 @@ describe ElasticBatchProjectIndexerWorker do
worker.perform(projects.first.id, projects.last.id)
end
it 'indexes all projects it receives even if already indexed' do
it 'indexes all projects it receives even if already indexed', :sidekiq_might_not_need_inline do
projects.first.index_status.update!(last_commit: 'foo')
expect_index(projects.first).and_call_original
......
......@@ -101,7 +101,7 @@ describe Geo::RepositoryShardSyncWorker, :geo, :geo_fdw, :clean_gitlab_redis_cac
end
context 'multiple shards' do
it 'uses two loops to schedule jobs' do
it 'uses two loops to schedule jobs', :sidekiq_might_not_need_inline do
expect(subject).to receive(:schedule_jobs).twice.and_call_original
Gitlab::ShardHealthCache.update([shard_name, 'shard2', 'shard3', 'shard4', 'shard5'])
......
......@@ -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)
......
......@@ -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'
......
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.
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