diff options
Diffstat (limited to 'spec')
-rw-r--r-- | spec/lib/backup/manager_spec.rb | 36 | ||||
-rw-r--r-- | spec/lib/gitlab/import_export/all_models.yml | 1 | ||||
-rw-r--r-- | spec/lib/gitlab/import_export/safe_model_attributes.yml | 1 |
3 files changed, 36 insertions, 2 deletions
diff --git a/spec/lib/backup/manager_spec.rb b/spec/lib/backup/manager_spec.rb index 35594cd2fb8..06ad0557e37 100644 --- a/spec/lib/backup/manager_spec.rb +++ b/spec/lib/backup/manager_spec.rb @@ -326,7 +326,7 @@ describe Backup::Manager do context 'target path' do it 'uses the tar filename by default' do expect_any_instance_of(Fog::Collection).to receive(:create) - .with(hash_including(key: backup_filename)) + .with(hash_including(key: backup_filename, public: false)) .and_return(true) Dir.chdir(Gitlab.config.backup.path) do @@ -338,7 +338,39 @@ describe Backup::Manager do stub_env('DIRECTORY', 'daily') expect_any_instance_of(Fog::Collection).to receive(:create) - .with(hash_including(key: "daily/#{backup_filename}")) + .with(hash_including(key: "daily/#{backup_filename}", public: false)) + .and_return(true) + + Dir.chdir(Gitlab.config.backup.path) do + subject.upload + end + end + end + + context 'with Google provider' do + before do + stub_backup_setting( + upload: { + connection: { + provider: 'Google', + google_storage_access_key_id: 'test-access-id', + google_storage_secret_access_key: 'secret' + }, + remote_directory: 'directory', + multipart_chunk_size: Gitlab.config.backup.upload.multipart_chunk_size, + encryption: nil, + encryption_key: nil, + storage_class: nil + } + ) + + connection = ::Fog::Storage.new(Gitlab.config.backup.upload.connection.symbolize_keys) + connection.directories.create(key: Gitlab.config.backup.upload.remote_directory) + end + + it 'does not attempt to set ACL' do + expect_any_instance_of(Fog::Collection).to receive(:create) + .with(hash_excluding(public: false)) .and_return(true) Dir.chdir(Gitlab.config.backup.path) do diff --git a/spec/lib/gitlab/import_export/all_models.yml b/spec/lib/gitlab/import_export/all_models.yml index 27256ee311d..5612b0dc270 100644 --- a/spec/lib/gitlab/import_export/all_models.yml +++ b/spec/lib/gitlab/import_export/all_models.yml @@ -15,6 +15,7 @@ issues: - user_agent_detail - moved_to - duplicated_to +- promoted_to_epic - events - merge_requests_closing_issues - metrics diff --git a/spec/lib/gitlab/import_export/safe_model_attributes.yml b/spec/lib/gitlab/import_export/safe_model_attributes.yml index c3d4bd01e51..a16c23832e2 100644 --- a/spec/lib/gitlab/import_export/safe_model_attributes.yml +++ b/spec/lib/gitlab/import_export/safe_model_attributes.yml @@ -20,6 +20,7 @@ Issue: - due_date - moved_to_id - duplicated_to_id +- promoted_to_epic_id - lock_version - milestone_id - weight |