Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-12-19 18:07:55 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2019-12-19 18:07:55 +0300
commitf92a53a216e6e7d5037ac701efbee5628f91aa9a (patch)
tree1eb957f0277b50002258681f61db869a2b683fec /spec/factories
parente3764d340e2849fccee8c06278d1f5f686edd35b (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/factories')
-rw-r--r--spec/factories/ci/builds.rb8
-rw-r--r--spec/factories/ci/resource.rb11
-rw-r--r--spec/factories/ci/resource_group.rb8
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