diff options
Diffstat (limited to 'spec/lib/gitlab/import_export')
5 files changed, 38 insertions, 6 deletions
diff --git a/spec/lib/gitlab/import_export/all_models.yml b/spec/lib/gitlab/import_export/all_models.yml index 981802ad09d..5bbb95b3ea5 100644 --- a/spec/lib/gitlab/import_export/all_models.yml +++ b/spec/lib/gitlab/import_export/all_models.yml @@ -162,6 +162,7 @@ releases: - milestone_releases - milestones - evidences +- catalog_resource_version links: - release project_members: @@ -325,7 +326,7 @@ ci_pipelines: - security_findings - daily_build_group_report_results - latest_builds -- latest_successful_builds +- latest_successful_jobs - daily_report_results - latest_builds_report_results - messages @@ -432,6 +433,7 @@ builds: - dast_scanner_profiles_build - dast_scanner_profile - job_annotations +- job_artifacts_annotations bridges: - user - pipeline @@ -440,6 +442,7 @@ bridges: - needs - resource - sourced_pipeline +- deployment - resource_group - metadata - trigger_request @@ -516,6 +519,8 @@ container_repositories: - name project: - catalog_resource +- catalog_resource_versions +- ci_components - external_status_checks - base_tags - project_topics @@ -817,6 +822,7 @@ project: - scan_result_policy_reads - project_state - security_policy_bots +- target_branch_rules award_emoji: - awardable - user @@ -1039,6 +1045,13 @@ iterations_cadence: - iterations catalog_resource: - project + - catalog_resource_components + - catalog_resource_versions +catalog_resource_versions: + - project + - release + - catalog_resource + - catalog_resource_components approval_rules: - users - groups diff --git a/spec/lib/gitlab/import_export/command_line_util_spec.rb b/spec/lib/gitlab/import_export/command_line_util_spec.rb index b2e047f5621..8ed3a60d7fc 100644 --- a/spec/lib/gitlab/import_export/command_line_util_spec.rb +++ b/spec/lib/gitlab/import_export/command_line_util_spec.rb @@ -103,7 +103,7 @@ RSpec.describe Gitlab::ImportExport::CommandLineUtil, feature_category: :importe let(:local) { false } it 'downloads the file' do - expect(subject).to receive(:download).with(:url, upload_path, size_limit: nil) + expect(subject).to receive(:download).with(:url, upload_path, size_limit: 0) subject.download_or_copy_upload(uploader, upload_path) end diff --git a/spec/lib/gitlab/import_export/decompressed_archive_size_validator_spec.rb b/spec/lib/gitlab/import_export/decompressed_archive_size_validator_spec.rb index 8c5823edc51..aceea70be92 100644 --- a/spec/lib/gitlab/import_export/decompressed_archive_size_validator_spec.rb +++ b/spec/lib/gitlab/import_export/decompressed_archive_size_validator_spec.rb @@ -5,7 +5,7 @@ require 'spec_helper' RSpec.describe Gitlab::ImportExport::DecompressedArchiveSizeValidator, feature_category: :importers do let_it_be(:filepath) { File.join(Dir.tmpdir, 'decompressed_archive_size_validator_spec.gz') } - before(:all) do + before_all do create_compressed_file end @@ -47,6 +47,25 @@ RSpec.describe Gitlab::ImportExport::DecompressedArchiveSizeValidator, feature_c end end + context 'when max_decompressed_archive_size is set to 0' do + subject { described_class.new(archive_path: filepath) } + + before do + stub_application_setting(max_decompressed_archive_size: 0) + end + + it 'is valid and does not log error message' do + expect(Gitlab::Import::Logger) + .not_to receive(:info) + .with( + import_upload_archive_path: filepath, + import_upload_archive_size: File.size(filepath), + message: 'Decompressed archive size limit reached' + ) + expect(subject.valid?).to eq(true) + end + end + context 'when exception occurs during decompression' do shared_examples 'logs raised exception and terminates validator process group' do let(:std) { double(:std, close: nil, value: nil) } diff --git a/spec/lib/gitlab/import_export/file_importer_spec.rb b/spec/lib/gitlab/import_export/file_importer_spec.rb index aff11f7ac30..d449446d7be 100644 --- a/spec/lib/gitlab/import_export/file_importer_spec.rb +++ b/spec/lib/gitlab/import_export/file_importer_spec.rb @@ -84,7 +84,7 @@ RSpec.describe Gitlab::ImportExport::FileImporter, feature_category: :importers .with( import_export_upload.import_file, kind_of(String), - size_limit: ::Import::GitlabProjects::RemoteFileValidator::FILE_SIZE_LIMIT + size_limit: Gitlab::CurrentSettings.current_application_settings.max_import_remote_file_size.megabytes ) described_class.import(importable: project, archive_file: nil, shared: shared) @@ -104,7 +104,7 @@ RSpec.describe Gitlab::ImportExport::FileImporter, feature_category: :importers .with( file_url, kind_of(String), - size_limit: ::Import::GitlabProjects::RemoteFileValidator::FILE_SIZE_LIMIT + size_limit: Gitlab::CurrentSettings.current_application_settings.max_import_remote_file_size.megabytes ) described_class.import(importable: project, archive_file: nil, shared: shared) diff --git a/spec/lib/gitlab/import_export/project/relation_tree_restorer_spec.rb b/spec/lib/gitlab/import_export/project/relation_tree_restorer_spec.rb index 180a6b6ff0a..0f4f2eb573c 100644 --- a/spec/lib/gitlab/import_export/project/relation_tree_restorer_spec.rb +++ b/spec/lib/gitlab/import_export/project/relation_tree_restorer_spec.rb @@ -60,7 +60,7 @@ RSpec.describe Gitlab::ImportExport::Project::RelationTreeRestorer, feature_cate let(:relation_reader) { Gitlab::ImportExport::Json::NdjsonReader.new(path) } let_it_be(:group) do - create(:group, :disabled_and_unoverridable).tap { |g| g.add_maintainer(user) } + create(:group, :shared_runners_disabled_and_unoverridable).tap { |g| g.add_maintainer(user) } end before do |