diff options
Diffstat (limited to 'spec/factories/ci')
-rw-r--r-- | spec/factories/ci/builds.rb | 9 | ||||
-rw-r--r-- | spec/factories/ci/job_artifacts.rb | 4 | ||||
-rw-r--r-- | spec/factories/ci/pipeline_message.rb | 9 | ||||
-rw-r--r-- | spec/factories/ci/pipelines.rb | 4 | ||||
-rw-r--r-- | spec/factories/ci/secure_files.rb | 10 |
5 files changed, 36 insertions, 0 deletions
diff --git a/spec/factories/ci/builds.rb b/spec/factories/ci/builds.rb index e6eaebc9b6b..011021f6320 100644 --- a/spec/factories/ci/builds.rb +++ b/spec/factories/ci/builds.rb @@ -338,6 +338,10 @@ FactoryBot.define do running runner factory: :ci_runner + + after(:create) do |build| + build.create_runtime_metadata! + end end trait :artifacts do @@ -596,6 +600,11 @@ FactoryBot.define do failure_reason { 13 } end + trait :deployment_rejected do + failed + failure_reason { 22 } + end + trait :with_runner_session do after(:build) do |build| build.build_runner_session(url: 'https://localhost') diff --git a/spec/factories/ci/job_artifacts.rb b/spec/factories/ci/job_artifacts.rb index 223de873a04..e6eec280ed0 100644 --- a/spec/factories/ci/job_artifacts.rb +++ b/spec/factories/ci/job_artifacts.rb @@ -10,6 +10,10 @@ FactoryBot.define do expire_at { Date.yesterday } end + trait :locked do + locked { Ci::JobArtifact.lockeds[:artifacts_locked] } + end + trait :remote_store do file_store { JobArtifactUploader::Store::REMOTE} end diff --git a/spec/factories/ci/pipeline_message.rb b/spec/factories/ci/pipeline_message.rb new file mode 100644 index 00000000000..71fac24922d --- /dev/null +++ b/spec/factories/ci/pipeline_message.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +FactoryBot.define do + factory :ci_pipeline_message, class: 'Ci::PipelineMessage' do + pipeline factory: :ci_pipeline + content { 'warning' } + severity { 1 } + end +end diff --git a/spec/factories/ci/pipelines.rb b/spec/factories/ci/pipelines.rb index b2c1eff6fbd..122af139985 100644 --- a/spec/factories/ci/pipelines.rb +++ b/spec/factories/ci/pipelines.rb @@ -87,6 +87,10 @@ FactoryBot.define do locked { Ci::Pipeline.lockeds[:unlocked] } end + trait :artifacts_locked do + locked { Ci::Pipeline.lockeds[:artifacts_locked] } + end + trait :protected do add_attribute(:protected) { true } end diff --git a/spec/factories/ci/secure_files.rb b/spec/factories/ci/secure_files.rb new file mode 100644 index 00000000000..9198ea61d14 --- /dev/null +++ b/spec/factories/ci/secure_files.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +FactoryBot.define do + factory :ci_secure_file, class: 'Ci::SecureFile' do + name { 'filename' } + file { fixture_file_upload('spec/fixtures/ci_secure_files/upload-keystore.jks', 'application/octet-stream') } + checksum { 'foo1234' } + project + end +end |