diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-04-04 15:15:02 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-04-04 15:15:02 +0300 |
commit | f00510286b6ccda154c4926503397590a8851939 (patch) | |
tree | c4cd69ef2d0d6dd5abf30e3963ac00ead7421a19 /spec/uploaders | |
parent | 9e5c2e7342d1393f90e74a2ae4b3f27492c22e1f (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/uploaders')
16 files changed, 75 insertions, 76 deletions
diff --git a/spec/uploaders/attachment_uploader_spec.rb b/spec/uploaders/attachment_uploader_spec.rb index 05cffff1f1a..a035402e207 100644 --- a/spec/uploaders/attachment_uploader_spec.rb +++ b/spec/uploaders/attachment_uploader_spec.rb @@ -10,9 +10,9 @@ RSpec.describe AttachmentUploader do subject { uploader } it_behaves_like 'builds correct paths', - store_dir: %r[uploads/-/system/note/attachment/], - upload_path: %r[uploads/-/system/note/attachment/], - absolute_path: %r[#{CarrierWave.root}/uploads/-/system/note/attachment/] + store_dir: %r[uploads/-/system/note/attachment/], + upload_path: %r[uploads/-/system/note/attachment/], + absolute_path: %r[#{CarrierWave.root}/uploads/-/system/note/attachment/] context "object_store is REMOTE" do before do @@ -22,8 +22,8 @@ RSpec.describe AttachmentUploader do include_context 'with storage', described_class::Store::REMOTE it_behaves_like 'builds correct paths', - store_dir: %r[note/attachment/], - upload_path: %r[note/attachment/] + store_dir: %r[note/attachment/], + upload_path: %r[note/attachment/] end describe "#migrate!" do diff --git a/spec/uploaders/avatar_uploader_spec.rb b/spec/uploaders/avatar_uploader_spec.rb index a55e5c23fe8..e472ac46e66 100644 --- a/spec/uploaders/avatar_uploader_spec.rb +++ b/spec/uploaders/avatar_uploader_spec.rb @@ -10,9 +10,9 @@ RSpec.describe AvatarUploader do subject { uploader } it_behaves_like 'builds correct paths', - store_dir: %r[uploads/-/system/user/avatar/], - upload_path: %r[uploads/-/system/user/avatar/], - absolute_path: %r[#{CarrierWave.root}/uploads/-/system/user/avatar/] + store_dir: %r[uploads/-/system/user/avatar/], + upload_path: %r[uploads/-/system/user/avatar/], + absolute_path: %r[#{CarrierWave.root}/uploads/-/system/user/avatar/] context "object_store is REMOTE" do before do @@ -22,8 +22,8 @@ RSpec.describe AvatarUploader do include_context 'with storage', described_class::Store::REMOTE it_behaves_like 'builds correct paths', - store_dir: %r[user/avatar/], - upload_path: %r[user/avatar/] + store_dir: %r[user/avatar/], + upload_path: %r[user/avatar/] end context "with a file" do diff --git a/spec/uploaders/ci/pipeline_artifact_uploader_spec.rb b/spec/uploaders/ci/pipeline_artifact_uploader_spec.rb index 0630e9f6546..3935f081372 100644 --- a/spec/uploaders/ci/pipeline_artifact_uploader_spec.rb +++ b/spec/uploaders/ci/pipeline_artifact_uploader_spec.rb @@ -9,9 +9,9 @@ RSpec.describe Ci::PipelineArtifactUploader do subject { uploader } it_behaves_like "builds correct paths", - store_dir: %r[\h{2}/\h{2}/\h{64}/pipelines/\d+/artifacts/\d+], - cache_dir: %r[artifacts/tmp/cache], - work_dir: %r[artifacts/tmp/work] + store_dir: %r[\h{2}/\h{2}/\h{64}/pipelines/\d+/artifacts/\d+], + cache_dir: %r[artifacts/tmp/cache], + work_dir: %r[artifacts/tmp/work] context 'when object store is REMOTE' do before do diff --git a/spec/uploaders/dependency_proxy/file_uploader_spec.rb b/spec/uploaders/dependency_proxy/file_uploader_spec.rb index eb12e7dffa5..3cb2d1ea0f0 100644 --- a/spec/uploaders/dependency_proxy/file_uploader_spec.rb +++ b/spec/uploaders/dependency_proxy/file_uploader_spec.rb @@ -11,9 +11,9 @@ RSpec.describe DependencyProxy::FileUploader do subject { uploader } it_behaves_like "builds correct paths", - store_dir: %r[\h{2}/\h{2}], - cache_dir: %r[/dependency_proxy/tmp/cache], - work_dir: %r[/dependency_proxy/tmp/work] + store_dir: %r[\h{2}/\h{2}], + cache_dir: %r[/dependency_proxy/tmp/cache], + work_dir: %r[/dependency_proxy/tmp/work] context 'object store is remote' do before do @@ -22,8 +22,7 @@ RSpec.describe DependencyProxy::FileUploader do include_context 'with storage', described_class::Store::REMOTE - it_behaves_like "builds correct paths", - store_dir: %r[\h{2}/\h{2}] + it_behaves_like "builds correct paths", store_dir: %r[\h{2}/\h{2}] end end diff --git a/spec/uploaders/design_management/design_v432x230_uploader_spec.rb b/spec/uploaders/design_management/design_v432x230_uploader_spec.rb index a18a37e73da..f3dd77d67a0 100644 --- a/spec/uploaders/design_management/design_v432x230_uploader_spec.rb +++ b/spec/uploaders/design_management/design_v432x230_uploader_spec.rb @@ -11,10 +11,10 @@ RSpec.describe DesignManagement::DesignV432x230Uploader do subject(:uploader) { described_class.new(model, :image_v432x230) } it_behaves_like 'builds correct paths', - store_dir: %r[uploads/-/system/design_management/action/image_v432x230/], - upload_path: %r[uploads/-/system/design_management/action/image_v432x230/], - relative_path: %r[uploads/-/system/design_management/action/image_v432x230/], - absolute_path: %r[#{CarrierWave.root}/uploads/-/system/design_management/action/image_v432x230/] + store_dir: %r[uploads/-/system/design_management/action/image_v432x230/], + upload_path: %r[uploads/-/system/design_management/action/image_v432x230/], + relative_path: %r[uploads/-/system/design_management/action/image_v432x230/], + absolute_path: %r[#{CarrierWave.root}/uploads/-/system/design_management/action/image_v432x230/] context 'object_store is REMOTE' do before do @@ -24,9 +24,9 @@ RSpec.describe DesignManagement::DesignV432x230Uploader do include_context 'with storage', described_class::Store::REMOTE it_behaves_like 'builds correct paths', - store_dir: %r[design_management/action/image_v432x230/], - upload_path: %r[design_management/action/image_v432x230/], - relative_path: %r[design_management/action/image_v432x230/] + store_dir: %r[design_management/action/image_v432x230/], + upload_path: %r[design_management/action/image_v432x230/], + relative_path: %r[design_management/action/image_v432x230/] end describe "#migrate!" do diff --git a/spec/uploaders/external_diff_uploader_spec.rb b/spec/uploaders/external_diff_uploader_spec.rb index a889181b72c..2121e9cbc29 100644 --- a/spec/uploaders/external_diff_uploader_spec.rb +++ b/spec/uploaders/external_diff_uploader_spec.rb @@ -9,9 +9,9 @@ RSpec.describe ExternalDiffUploader do subject(:uploader) { described_class.new(diff, :external_diff) } it_behaves_like "builds correct paths", - store_dir: %r[merge_request_diffs/mr-\d+], - cache_dir: %r[/external-diffs/tmp/cache], - work_dir: %r[/external-diffs/tmp/work] + store_dir: %r[merge_request_diffs/mr-\d+], + cache_dir: %r[/external-diffs/tmp/cache], + work_dir: %r[/external-diffs/tmp/work] context "object store is REMOTE" do before do @@ -21,7 +21,7 @@ RSpec.describe ExternalDiffUploader do include_context 'with storage', described_class::Store::REMOTE it_behaves_like "builds correct paths", - store_dir: %r[merge_request_diffs/mr-\d+] + store_dir: %r[merge_request_diffs/mr-\d+] end describe 'remote file' do diff --git a/spec/uploaders/file_uploader_spec.rb b/spec/uploaders/file_uploader_spec.rb index 1287b809223..76519545e24 100644 --- a/spec/uploaders/file_uploader_spec.rb +++ b/spec/uploaders/file_uploader_spec.rb @@ -13,9 +13,9 @@ RSpec.describe FileUploader do shared_examples 'builds correct legacy storage paths' do include_examples 'builds correct paths', - store_dir: %r{awesome/project/\h+}, - upload_path: %r{\h+/<filename>}, - absolute_path: %r{#{described_class.root}/awesome/project/55dc16aa0edd05693fd98b5051e83321/foo.jpg} + store_dir: %r{awesome/project/\h+}, + upload_path: %r{\h+/<filename>}, + absolute_path: %r{#{described_class.root}/awesome/project/55dc16aa0edd05693fd98b5051e83321/foo.jpg} end context 'legacy storage' do @@ -26,8 +26,8 @@ RSpec.describe FileUploader do let(:project) { build_stubbed(:project, namespace: group, name: 'project') } include_examples 'builds correct paths', - store_dir: %r{@hashed/\h{2}/\h{2}/\h+}, - upload_path: %r{\h+/<filename>} + store_dir: %r{@hashed/\h{2}/\h{2}/\h+}, + upload_path: %r{\h+/<filename>} end context 'when only repositories are rolled out' do @@ -47,8 +47,8 @@ RSpec.describe FileUploader do # always use hashed storage path for remote uploads it_behaves_like 'builds correct paths', - store_dir: %r{@hashed/\h{2}/\h{2}/\h+}, - upload_path: %r{@hashed/\h{2}/\h{2}/\h+/\h+/<filename>} + store_dir: %r{@hashed/\h{2}/\h{2}/\h+}, + upload_path: %r{@hashed/\h{2}/\h{2}/\h+/\h+/<filename>} end describe 'initialize' do diff --git a/spec/uploaders/job_artifact_uploader_spec.rb b/spec/uploaders/job_artifact_uploader_spec.rb index d7c9ef7e0d5..dac9e97641d 100644 --- a/spec/uploaders/job_artifact_uploader_spec.rb +++ b/spec/uploaders/job_artifact_uploader_spec.rb @@ -10,9 +10,9 @@ RSpec.describe JobArtifactUploader do subject { uploader } it_behaves_like "builds correct paths", - store_dir: %r[\h{2}/\h{2}/\h{64}/\d{4}_\d{1,2}_\d{1,2}/\d+/\d+\z], - cache_dir: %r[artifacts/tmp/cache], - work_dir: %r[artifacts/tmp/work] + store_dir: %r[\h{2}/\h{2}/\h{64}/\d{4}_\d{1,2}_\d{1,2}/\d+/\d+\z], + cache_dir: %r[artifacts/tmp/cache], + work_dir: %r[artifacts/tmp/work] context "object store is REMOTE" do before do @@ -22,7 +22,7 @@ RSpec.describe JobArtifactUploader do include_context 'with storage', described_class::Store::REMOTE it_behaves_like "builds correct paths", - store_dir: %r[\h{2}/\h{2}/\h{64}/\d{4}_\d{1,2}_\d{1,2}/\d+/\d+\z] + store_dir: %r[\h{2}/\h{2}/\h{64}/\d{4}_\d{1,2}_\d{1,2}/\d+/\d+\z] describe '#cdn_enabled_url' do it 'returns URL and false' do diff --git a/spec/uploaders/lfs_object_uploader_spec.rb b/spec/uploaders/lfs_object_uploader_spec.rb index b85892a42b5..9bbfd910ada 100644 --- a/spec/uploaders/lfs_object_uploader_spec.rb +++ b/spec/uploaders/lfs_object_uploader_spec.rb @@ -10,9 +10,9 @@ RSpec.describe LfsObjectUploader do subject { uploader } it_behaves_like "builds correct paths", - store_dir: %r[\h{2}/\h{2}], - cache_dir: %r[/lfs-objects/tmp/cache], - work_dir: %r[/lfs-objects/tmp/work] + store_dir: %r[\h{2}/\h{2}], + cache_dir: %r[/lfs-objects/tmp/cache], + work_dir: %r[/lfs-objects/tmp/work] context "object store is REMOTE" do before do @@ -22,7 +22,7 @@ RSpec.describe LfsObjectUploader do include_context 'with storage', described_class::Store::REMOTE it_behaves_like "builds correct paths", - store_dir: %r[\h{2}/\h{2}] + store_dir: %r[\h{2}/\h{2}] end describe 'remote file' do diff --git a/spec/uploaders/packages/composer/cache_uploader_spec.rb b/spec/uploaders/packages/composer/cache_uploader_spec.rb index 7ceaa24f463..7eea4a839ab 100644 --- a/spec/uploaders/packages/composer/cache_uploader_spec.rb +++ b/spec/uploaders/packages/composer/cache_uploader_spec.rb @@ -9,9 +9,9 @@ RSpec.describe Packages::Composer::CacheUploader do subject { uploader } it_behaves_like "builds correct paths", - store_dir: %r[^\h{2}/\h{2}/\h{64}/packages/composer_cache/\d+$], - cache_dir: %r[/packages/tmp/cache], - work_dir: %r[/packages/tmp/work] + store_dir: %r[^\h{2}/\h{2}/\h{64}/packages/composer_cache/\d+$], + cache_dir: %r[/packages/tmp/cache], + work_dir: %r[/packages/tmp/work] context 'object store is remote' do before do @@ -21,7 +21,7 @@ RSpec.describe Packages::Composer::CacheUploader do include_context 'with storage', described_class::Store::REMOTE it_behaves_like "builds correct paths", - store_dir: %r[^\h{2}/\h{2}/\h{64}/packages/composer_cache/\d+$] + store_dir: %r[^\h{2}/\h{2}/\h{64}/packages/composer_cache/\d+$] end describe 'remote file' do diff --git a/spec/uploaders/packages/debian/component_file_uploader_spec.rb b/spec/uploaders/packages/debian/component_file_uploader_spec.rb index bee82fb2715..84ba751c737 100644 --- a/spec/uploaders/packages/debian/component_file_uploader_spec.rb +++ b/spec/uploaders/packages/debian/component_file_uploader_spec.rb @@ -12,9 +12,9 @@ RSpec.describe Packages::Debian::ComponentFileUploader do subject { uploader } it_behaves_like "builds correct paths", - store_dir: %r[^\h{2}/\h{2}/\h{64}/debian_#{container_type}_component_file/\d+$], - cache_dir: %r[/packages/tmp/cache$], - work_dir: %r[/packages/tmp/work$] + store_dir: %r[^\h{2}/\h{2}/\h{64}/debian_#{container_type}_component_file/\d+$], + cache_dir: %r[/packages/tmp/cache$], + work_dir: %r[/packages/tmp/work$] context 'object store is remote' do before do @@ -24,9 +24,9 @@ RSpec.describe Packages::Debian::ComponentFileUploader do include_context 'with storage', described_class::Store::REMOTE it_behaves_like "builds correct paths", - store_dir: %r[^\h{2}/\h{2}/\h{64}/debian_#{container_type}_component_file/\d+$], - cache_dir: %r[/packages/tmp/cache$], - work_dir: %r[/packages/tmp/work$] + store_dir: %r[^\h{2}/\h{2}/\h{64}/debian_#{container_type}_component_file/\d+$], + cache_dir: %r[/packages/tmp/cache$], + work_dir: %r[/packages/tmp/work$] end describe 'remote file' do diff --git a/spec/uploaders/packages/debian/distribution_release_file_uploader_spec.rb b/spec/uploaders/packages/debian/distribution_release_file_uploader_spec.rb index 96655edb186..df630569856 100644 --- a/spec/uploaders/packages/debian/distribution_release_file_uploader_spec.rb +++ b/spec/uploaders/packages/debian/distribution_release_file_uploader_spec.rb @@ -12,9 +12,9 @@ RSpec.describe Packages::Debian::DistributionReleaseFileUploader do subject { uploader } it_behaves_like "builds correct paths", - store_dir: %r[^\h{2}/\h{2}/\h{64}/debian_#{container_type}_distribution/\d+$], - cache_dir: %r[/packages/tmp/cache$], - work_dir: %r[/packages/tmp/work$] + store_dir: %r[^\h{2}/\h{2}/\h{64}/debian_#{container_type}_distribution/\d+$], + cache_dir: %r[/packages/tmp/cache$], + work_dir: %r[/packages/tmp/work$] context 'object store is remote' do before do @@ -24,9 +24,9 @@ RSpec.describe Packages::Debian::DistributionReleaseFileUploader do include_context 'with storage', described_class::Store::REMOTE it_behaves_like "builds correct paths", - store_dir: %r[^\h{2}/\h{2}/\h{64}/debian_#{container_type}_distribution/\d+$], - cache_dir: %r[/packages/tmp/cache$], - work_dir: %r[/packages/tmp/work$] + store_dir: %r[^\h{2}/\h{2}/\h{64}/debian_#{container_type}_distribution/\d+$], + cache_dir: %r[/packages/tmp/cache$], + work_dir: %r[/packages/tmp/work$] end describe 'remote file' do diff --git a/spec/uploaders/packages/package_file_uploader_spec.rb b/spec/uploaders/packages/package_file_uploader_spec.rb index 7d270ad03c9..ddd9823d55c 100644 --- a/spec/uploaders/packages/package_file_uploader_spec.rb +++ b/spec/uploaders/packages/package_file_uploader_spec.rb @@ -9,9 +9,9 @@ RSpec.describe Packages::PackageFileUploader do subject { uploader } it_behaves_like "builds correct paths", - store_dir: %r[^\h{2}/\h{2}/\h{64}/packages/\d+/files/\d+$], - cache_dir: %r[/packages/tmp/cache], - work_dir: %r[/packages/tmp/work] + store_dir: %r[^\h{2}/\h{2}/\h{64}/packages/\d+/files/\d+$], + cache_dir: %r[/packages/tmp/cache], + work_dir: %r[/packages/tmp/work] context 'object store is remote' do before do @@ -21,7 +21,7 @@ RSpec.describe Packages::PackageFileUploader do include_context 'with storage', described_class::Store::REMOTE it_behaves_like "builds correct paths", - store_dir: %r[^\h{2}/\h{2}/\h{64}/packages/\d+/files/\d+$] + store_dir: %r[^\h{2}/\h{2}/\h{64}/packages/\d+/files/\d+$] end describe 'remote file' do diff --git a/spec/uploaders/packages/rpm/repository_file_uploader_spec.rb b/spec/uploaders/packages/rpm/repository_file_uploader_spec.rb index b3767ae179a..a36a035fde3 100644 --- a/spec/uploaders/packages/rpm/repository_file_uploader_spec.rb +++ b/spec/uploaders/packages/rpm/repository_file_uploader_spec.rb @@ -9,9 +9,9 @@ RSpec.describe Packages::Rpm::RepositoryFileUploader do subject { uploader } it_behaves_like 'builds correct paths', - store_dir: %r[^\h{2}/\h{2}/\h{64}/projects/\d+/rpm/repository_files/\d+$], - cache_dir: %r{/packages/tmp/cache}, - work_dir: %r{/packages/tmp/work} + store_dir: %r[^\h{2}/\h{2}/\h{64}/projects/\d+/rpm/repository_files/\d+$], + cache_dir: %r{/packages/tmp/cache}, + work_dir: %r{/packages/tmp/work} context 'when object store is remote' do before do @@ -21,7 +21,7 @@ RSpec.describe Packages::Rpm::RepositoryFileUploader do include_context 'with storage', described_class::Store::REMOTE it_behaves_like 'builds correct paths', - store_dir: %r[^\h{2}/\h{2}/\h{64}/projects/\d+/rpm/repository_files/\d+$] + store_dir: %r[^\h{2}/\h{2}/\h{64}/projects/\d+/rpm/repository_files/\d+$] end describe 'remote file' do diff --git a/spec/uploaders/pages/deployment_uploader_spec.rb b/spec/uploaders/pages/deployment_uploader_spec.rb index 1832f73bd67..7686efd4fe4 100644 --- a/spec/uploaders/pages/deployment_uploader_spec.rb +++ b/spec/uploaders/pages/deployment_uploader_spec.rb @@ -13,9 +13,9 @@ RSpec.describe Pages::DeploymentUploader do subject { uploader } it_behaves_like "builds correct paths", - store_dir: %r[/\h{2}/\h{2}/\h{64}/pages_deployments/\d+], - cache_dir: %r[pages/@hashed/tmp/cache], - work_dir: %r[pages/@hashed/tmp/work] + store_dir: %r[/\h{2}/\h{2}/\h{64}/pages_deployments/\d+], + cache_dir: %r[pages/@hashed/tmp/cache], + work_dir: %r[pages/@hashed/tmp/work] context 'when object store is REMOTE' do before do diff --git a/spec/uploaders/personal_file_uploader_spec.rb b/spec/uploaders/personal_file_uploader_spec.rb index 1373ccac23d..58edf3f093d 100644 --- a/spec/uploaders/personal_file_uploader_spec.rb +++ b/spec/uploaders/personal_file_uploader_spec.rb @@ -50,9 +50,9 @@ RSpec.describe PersonalFileUploader do context 'object_store is LOCAL' do it_behaves_like 'builds correct paths', - store_dir: %r[uploads/-/system/personal_snippet/\d+/\h+], - upload_path: %r[\h+/\S+], - absolute_path: %r[#{CarrierWave.root}/uploads/-/system/personal_snippet/\d+/\h+/\S+$] + store_dir: %r[uploads/-/system/personal_snippet/\d+/\h+], + upload_path: %r[\h+/\S+], + absolute_path: %r[#{CarrierWave.root}/uploads/-/system/personal_snippet/\d+/\h+/\S+$] it_behaves_like '#base_dir' it_behaves_like '#to_h' @@ -66,8 +66,8 @@ RSpec.describe PersonalFileUploader do include_context 'with storage', described_class::Store::REMOTE it_behaves_like 'builds correct paths', - store_dir: %r[\d+/\h+], - upload_path: %r[^personal_snippet/\d+/\h+/<filename>] + store_dir: %r[\d+/\h+], + upload_path: %r[^personal_snippet/\d+/\h+/<filename>] it_behaves_like '#base_dir' it_behaves_like '#to_h' |