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:
Diffstat (limited to 'spec/factories/ci/builds.rb')
-rw-r--r--spec/factories/ci/builds.rb38
1 files changed, 38 insertions, 0 deletions
diff --git a/spec/factories/ci/builds.rb b/spec/factories/ci/builds.rb
index 9545378780a..76f43a05186 100644
--- a/spec/factories/ci/builds.rb
+++ b/spec/factories/ci/builds.rb
@@ -175,6 +175,44 @@ FactoryBot.define do
end
end
+ trait :prepare_staging do
+ name { 'prepare staging' }
+ environment { 'staging' }
+
+ options do
+ {
+ script: %w(ls),
+ environment: { name: 'staging', action: 'prepare' }
+ }
+ end
+
+ set_expanded_environment_name
+ end
+
+ trait :stop_staging do
+ name { 'stop staging' }
+ environment { 'staging' }
+
+ options do
+ {
+ script: %w(ls),
+ environment: { name: 'staging', action: 'stop' }
+ }
+ end
+
+ set_expanded_environment_name
+ end
+
+ trait :set_expanded_environment_name do
+ after(:build) do |build, evaluator|
+ build.assign_attributes(
+ metadata_attributes: {
+ expanded_environment_name: build.expanded_environment_name
+ }
+ )
+ end
+ end
+
trait :allowed_to_fail do
allow_failure { true }
end