diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-12 09:07:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-12 09:07:42 +0300 |
commit | 8e22ef10e4f9c6d1ef2411aa26ddd0658e2f1461 (patch) | |
tree | 1ffd5ffed59b0f752fc358524f4d2170f6694cb9 /spec/factories/ci | |
parent | 2ccde70b80730fd52f75797e7d711748fb5b769b (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/factories/ci')
-rw-r--r-- | spec/factories/ci/builds.rb | 8 | ||||
-rw-r--r-- | spec/factories/ci/resource.rb | 11 | ||||
-rw-r--r-- | spec/factories/ci/resource_group.rb | 8 |
3 files changed, 27 insertions, 0 deletions
diff --git a/spec/factories/ci/builds.rb b/spec/factories/ci/builds.rb index ecb1f1996d9..a38935c89ba 100644 --- a/spec/factories/ci/builds.rb +++ b/spec/factories/ci/builds.rb @@ -207,6 +207,14 @@ FactoryBot.define do trigger_request factory: :ci_trigger_request end + trait :resource_group do + waiting_for_resource_at { 5.minutes.ago } + + after(:build) do |build, evaluator| + build.resource_group = create(:ci_resource_group, project: build.project) + end + end + after(:build) do |build, evaluator| build.project ||= build.pipeline.project end diff --git a/spec/factories/ci/resource.rb b/spec/factories/ci/resource.rb new file mode 100644 index 00000000000..d47b3ba4635 --- /dev/null +++ b/spec/factories/ci/resource.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +FactoryBot.define do + factory :ci_resource, class: Ci::Resource do + resource_group factory: :ci_resource_group + + trait(:retained) do + build factory: :ci_build + end + end +end diff --git a/spec/factories/ci/resource_group.rb b/spec/factories/ci/resource_group.rb new file mode 100644 index 00000000000..bdfc0740a45 --- /dev/null +++ b/spec/factories/ci/resource_group.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +FactoryBot.define do + factory :ci_resource_group, class: Ci::ResourceGroup do + project + sequence(:key) { |n| "IOS_#{n}" } + end +end |