From ee664acb356f8123f4f6b00b73c1e1cf0866c7fb Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Thu, 20 Oct 2022 09:40:42 +0000 Subject: Add latest changes from gitlab-org/gitlab@15-5-stable-ee --- spec/factories/packages/packages.rb | 2 +- .../factories/packages/rpm/rpm_repository_files.rb | 33 ++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 spec/factories/packages/rpm/rpm_repository_files.rb (limited to 'spec/factories/packages') diff --git a/spec/factories/packages/packages.rb b/spec/factories/packages/packages.rb index 8074e505243..1da4f0cedbc 100644 --- a/spec/factories/packages/packages.rb +++ b/spec/factories/packages/packages.rb @@ -253,7 +253,7 @@ FactoryBot.define do end trait(:without_loaded_metadatum) do - conan_metadatum { build(:conan_metadatum, package: nil) } # rubocop:disable FactoryBot/InlineAssociation + conan_metadatum { build(:conan_metadatum, package: nil) } # rubocop:disable RSpec/FactoryBot/InlineAssociation end end diff --git a/spec/factories/packages/rpm/rpm_repository_files.rb b/spec/factories/packages/rpm/rpm_repository_files.rb new file mode 100644 index 00000000000..079d32b3995 --- /dev/null +++ b/spec/factories/packages/rpm/rpm_repository_files.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +FactoryBot.define do + factory :rpm_repository_file, class: 'Packages::Rpm::RepositoryFile' do + project + + file_name { 'repomd.xml' } + file_sha1 { 'efae869b4e95d54796a46481f3a211d6a88d0323' } + file_md5 { 'ddf8a75330c896a8d7709e75f8b5982a' } + size { 3127.kilobytes } + status { :default } + + transient do + file_metadatum_trait { :xml } + end + + transient do + file_fixture { 'spec/fixtures/packages/rpm/repodata/repomd.xml' } + end + + after(:build) do |package_file, evaluator| + package_file.file = fixture_file_upload(evaluator.file_fixture) + end + + trait(:object_storage) do + file_store { Packages::Rpm::RepositoryFileUploader::Store::REMOTE } + end + + trait :pending_destruction do + status { :pending_destruction } + end + end +end -- cgit v1.2.1