summaryrefslogtreecommitdiff
path: root/spec/factories/ci/builds.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-04-20 10:00:54 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-04-20 10:00:54 +0000
commit3cccd102ba543e02725d247893729e5c73b38295 (patch)
treef36a04ec38517f5deaaacb5acc7d949688d1e187 /spec/factories/ci/builds.rb
parent205943281328046ef7b4528031b90fbda70c75ac (diff)
downloadgitlab-ce-3cccd102ba543e02725d247893729e5c73b38295.tar.gz
Add latest changes from gitlab-org/gitlab@14-10-stable-eev14.10.0-rc42
Diffstat (limited to 'spec/factories/ci/builds.rb')
-rw-r--r--spec/factories/ci/builds.rb72
1 files changed, 70 insertions, 2 deletions
diff --git a/spec/factories/ci/builds.rb b/spec/factories/ci/builds.rb
index 011021f6320..56c12d73a3b 100644
--- a/spec/factories/ci/builds.rb
+++ b/spec/factories/ci/builds.rb
@@ -10,7 +10,7 @@ FactoryBot.define do
options do
{
- image: 'ruby:2.7',
+ image: 'image:1.0',
services: ['postgres'],
script: ['ls -a']
}
@@ -175,6 +175,58 @@ 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 :start_staging do
+ name { 'start staging' }
+ environment { 'staging' }
+
+ options do
+ {
+ script: %w(ls),
+ environment: { name: 'staging', action: 'start' }
+ }
+ 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
@@ -455,7 +507,7 @@ FactoryBot.define do
trait :extended_options do
options do
{
- image: { name: 'ruby:2.7', entrypoint: '/bin/sh' },
+ image: { name: 'image:1.0', entrypoint: '/bin/sh' },
services: ['postgres', { name: 'docker:stable-dind', entrypoint: '/bin/sh', command: 'sleep 30', alias: 'docker' }, { name: 'mysql:latest', variables: { MYSQL_ROOT_PASSWORD: 'root123.' } }],
script: %w(echo),
after_script: %w(ls date),
@@ -497,6 +549,22 @@ FactoryBot.define do
options { {} }
end
+ trait :coverage_report_cobertura do
+ options do
+ {
+ artifacts: {
+ expire_in: '7d',
+ reports: {
+ coverage_report: {
+ coverage_format: 'cobertura',
+ path: 'cobertura.xml'
+ }
+ }
+ }
+ }
+ end
+ end
+
# TODO: move Security traits to ee_ci_build
# https://gitlab.com/gitlab-org/gitlab/-/issues/210486
trait :dast do