diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-12-01 09:51:31 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-12-01 09:51:31 +0000 |
commit | 37d5cece3603d8df9f75c507594e70dade80c99f (patch) | |
tree | 84e6d51a3329b4f9bd13bf92e61fe401446e2d2a /spec | |
parent | f8796c0836e943a27e26250c7cd4a5766e567f61 (diff) | |
download | gitlab-ce-37d5cece3603d8df9f75c507594e70dade80c99f.tar.gz |
Add latest changes from gitlab-org/gitlab@14-5-stable-ee
Diffstat (limited to 'spec')
-rw-r--r-- | spec/controllers/projects/raw_controller_spec.rb | 2 | ||||
-rw-r--r-- | spec/features/groups/import_export/import_file_spec.rb | 2 | ||||
-rw-r--r-- | spec/initializers/action_cable_subscription_adapter_identifier_spec.rb | 24 | ||||
-rw-r--r-- | spec/lib/gitlab/checks/branch_check_spec.rb | 9 | ||||
-rw-r--r-- | spec/requests/api/graphql/ci/jobs_spec.rb | 4 | ||||
-rw-r--r-- | spec/services/ci/job_artifacts/create_service_spec.rb | 2 | ||||
-rw-r--r-- | spec/spec_helper.rb | 11 |
7 files changed, 50 insertions, 4 deletions
diff --git a/spec/controllers/projects/raw_controller_spec.rb b/spec/controllers/projects/raw_controller_spec.rb index a81173ccaac..79da18f2d6d 100644 --- a/spec/controllers/projects/raw_controller_spec.rb +++ b/spec/controllers/projects/raw_controller_spec.rb @@ -101,7 +101,7 @@ RSpec.describe Projects::RawController do expect(response).to have_gitlab_http_status(:too_many_requests) end - it 'logs the event on auth.log' do + it 'logs the event on auth.log', quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/345889' do attributes = { message: 'Application_Rate_Limiter_Request', env: :raw_blob_request_limit, diff --git a/spec/features/groups/import_export/import_file_spec.rb b/spec/features/groups/import_export/import_file_spec.rb index 76d17c4409d..3d23451feef 100644 --- a/spec/features/groups/import_export/import_file_spec.rb +++ b/spec/features/groups/import_export/import_file_spec.rb @@ -85,7 +85,7 @@ RSpec.describe 'Import/Export - Group Import', :js do context 'when the user uploads an invalid export file' do let(:file) { File.join(Rails.root, 'spec', %w[fixtures big-image.png]) } - it 'displays an error' do + it 'displays an error', quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/343995' do visit new_group_path click_link 'Import group' diff --git a/spec/initializers/action_cable_subscription_adapter_identifier_spec.rb b/spec/initializers/action_cable_subscription_adapter_identifier_spec.rb new file mode 100644 index 00000000000..12988b851ef --- /dev/null +++ b/spec/initializers/action_cable_subscription_adapter_identifier_spec.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe 'ActionCableSubscriptionAdapterIdentifier override' do + describe '#identifier' do + context 'when id key is nil on cable.yml' do + it 'does not override server config id with action cable pid' do + config = { + adapter: 'redis', + url: 'unix:/home/localuser/redis/redis.socket', + channel_prefix: 'test_', + id: nil + } + ::ActionCable::Server::Base.config.cable = config + + sub = ActionCable.server.pubsub.send(:redis_connection) + + expect(sub.connection[:id]).to eq('redis:///home/localuser/redis/redis.socket/0') + expect(ActionCable.server.config.cable[:id]).to be_nil + end + end + end +end diff --git a/spec/lib/gitlab/checks/branch_check_spec.rb b/spec/lib/gitlab/checks/branch_check_spec.rb index 3086cb1bd33..f503759f3f8 100644 --- a/spec/lib/gitlab/checks/branch_check_spec.rb +++ b/spec/lib/gitlab/checks/branch_check_spec.rb @@ -32,6 +32,15 @@ RSpec.describe Gitlab::Checks::BranchCheck do expect { subject.validate! }.not_to raise_error end + context "deleting a hexadecimal branch" do + let(:newrev) { "0000000000000000000000000000000000000000" } + let(:ref) { "refs/heads/267208abfe40e546f5e847444276f7d43a39503e" } + + it "doesn't prohibit the deletion of a hexadecimal branch name" do + expect { subject.validate! }.not_to raise_error + end + end + context "the feature flag is disabled" do it "doesn't prohibit a 40-character hexadecimal branch name" do stub_feature_flags(prohibit_hexadecimal_branch_names: false) diff --git a/spec/requests/api/graphql/ci/jobs_spec.rb b/spec/requests/api/graphql/ci/jobs_spec.rb index e6362fdde88..b2f4801a083 100644 --- a/spec/requests/api/graphql/ci/jobs_spec.rb +++ b/spec/requests/api/graphql/ci/jobs_spec.rb @@ -105,8 +105,8 @@ RSpec.describe 'Query.project.pipeline' do expect(jobs_graphql_data).to contain_exactly(a_hash_including('name' => 'my test job')) end - it 'can find all stages' do - post_graphql(query, current_user: user, variables: first_n.with(3)) + it 'reports the build needs and previous stages with no duplicates', quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/346433' do + post_graphql(query, current_user: user) expect(jobs_graphql_data).to contain_exactly( a_hash_including('name' => 'my test job'), diff --git a/spec/services/ci/job_artifacts/create_service_spec.rb b/spec/services/ci/job_artifacts/create_service_spec.rb index 6ad3e9ceb54..2d309bfe425 100644 --- a/spec/services/ci/job_artifacts/create_service_spec.rb +++ b/spec/services/ci/job_artifacts/create_service_spec.rb @@ -24,6 +24,8 @@ RSpec.describe Ci::JobArtifacts::CreateService do def file_to_upload(path, params = {}) upload = Tempfile.new('upload') FileUtils.copy(path, upload.path) + # This is a workaround for https://github.com/docker/for-linux/issues/1015 + FileUtils.touch(upload.path) UploadedFile.new(upload.path, **params) end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 25759ca50b8..52560f1f1c3 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -475,3 +475,14 @@ Rugged::Settings['search_path_global'] = Rails.root.join('tmp/tests').to_s # Initialize FactoryDefault to use create_default helper TestProf::FactoryDefault.init + +module TouchRackUploadedFile + def initialize_from_file_path(path) + super + + # This is a no-op workaround for https://github.com/docker/for-linux/issues/1015 + File.utime @tempfile.atime, @tempfile.mtime, @tempfile.path # rubocop:disable Gitlab/ModuleWithInstanceVariables + end +end + +Rack::Test::UploadedFile.prepend(TouchRackUploadedFile) |