blob: a71aac4225e9e7b148d05574f42bb6e5cfd2b573 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
|
.qa-job-base:
image: ${REGISTRY_HOST}/${REGISTRY_GROUP}/gitlab-build-images/debian-bullseye-ruby-2.7:bundler-2.3-chrome-103-docker-20.10.14
extends:
- .default-retry
- .qa-cache
stage: test
needs: []
variables:
USE_BUNDLE_INSTALL: "false"
SETUP_DB: "false"
QA_EXPORT_TEST_METRICS: "false"
before_script:
- !reference [.default-before_script, before_script]
- cd qa && bundle install
qa:internal:
extends:
- .qa-job-base
- .qa:rules:internal
script:
- bundle exec rspec -O .rspec_internal
qa:internal-as-if-foss:
extends:
- qa:internal
- .qa:rules:internal-as-if-foss
- .as-if-foss
qa:selectors:
extends:
- .qa-job-base
- .qa:rules:ee-and-foss
script:
- bundle exec bin/qa Test::Sanity::Selectors
qa:master-auto-quarantine-dequarantine:
extends:
- .qa-job-base
rules:
- if: '$QA_TRIGGER_AUTO_QUARANTINE =~ /true|yes|1/i'
script:
- bundle exec confiner -r .confiner/master.yml
allow_failure: true
qa:nightly-auto-quarantine-dequarantine:
extends:
- .qa-job-base
rules:
- if: '$QA_TRIGGER_AUTO_QUARANTINE =~ /true|yes|1/i'
script:
- bundle exec confiner -r .confiner/nightly.yml
allow_failure: true
qa:selectors-as-if-foss:
extends:
- qa:selectors
- .qa:rules:as-if-foss
- .as-if-foss
update-qa-cache:
extends:
- .qa-job-base
- .qa-cache-push
- .shared:rules:update-cache
stage: prepare
script:
- echo "Cache has been updated and ready to be uploaded."
populate-qa-tests-var:
extends:
- .qa:rules:determine-qa-tests
image: ${GITLAB_DEPENDENCY_PROXY}ruby:2.7-alpine
stage: prepare
script:
- export QA_TESTS=$(scripts/determine-qa-tests --files $CHANGES_FILE --labels "$CI_MERGE_REQUEST_LABELS")
- 'echo "QA_TESTS=$QA_TESTS" >> qa_tests_var.env'
- 'echo "QA_TESTS: $QA_TESTS"'
artifacts:
expire_in: 2d
reports:
dotenv: qa_tests_var.env
paths:
- ${CHANGES_FILE}
- qa_tests_var.env
variables:
CHANGES_FILE: tmp/changed_files.txt
needs:
- detect-tests
.package-and-qa-base:
image: ${GITLAB_DEPENDENCY_PROXY}ruby:${RUBY_VERSION}-alpine
stage: qa
retry: 0
before_script:
- source scripts/utils.sh
- install_gitlab_gem
- tooling/bin/find_change_diffs ${CHANGES_DIFFS_DIR}
script:
- 'echo "QA_TESTS: $QA_TESTS"'
- exit_code=0 && tooling/bin/qa/run_qa_check ${CHANGES_DIFFS_DIR} || exit_code=$?
- echo $exit_code
- |
if [ $exit_code -eq 0 ]; then
./scripts/trigger-build.rb omnibus
elif [ $exit_code -eq 1 ]; then
exit 1
else
echo "Downstream jobs will not be triggered because run_qa_check exited with code: $exit_code"
fi
# These jobs often time out, so temporarily use private runners and a long timeout: https://gitlab.com/gitlab-org/gitlab/-/issues/238563
tags:
- prm
timeout: 4h
needs:
- job: build-qa-image
artifacts: false
- job: build-assets-image
artifacts: false
- job: populate-qa-tests-var
- detect-tests
artifacts:
expire_in: 7d
paths:
- ${CHANGES_DIFFS_DIR}/*
variables:
CHANGES_DIFFS_DIR: tmp/diffs
ALLURE_JOB_NAME: $CI_JOB_NAME
.package-and-qa-ff-base:
script:
- |
feature_flags=$(scripts/changed-feature-flags --files $CHANGES_DIFFS_DIR --state $QA_FF_STATE)
if [[ $feature_flags ]]; then
export GITLAB_QA_OPTIONS="--set-feature-flags $feature_flags"
echo $GITLAB_QA_OPTIONS
./scripts/trigger-build.rb omnibus
else
echo "No changed feature flag found to test as $QA_FF_STATE."
fi
package-and-qa:
extends:
- .package-and-qa-base
- .qa:rules:package-and-qa
package-and-qa-ff-enabled:
extends:
- .package-and-qa-base
- .package-and-qa-ff-base
- .qa:rules:package-and-qa:feature-flags
variables:
QA_FF_STATE: "enabled"
package-and-qa-ff-disabled:
extends:
- .package-and-qa-base
- .package-and-qa-ff-base
- .qa:rules:package-and-qa:feature-flags
variables:
QA_FF_STATE: "disabled"
package-and-qa-ff-deleted:
extends:
- .package-and-qa-base
- .package-and-qa-ff-base
- .qa:rules:package-and-qa:feature-flags
variables:
QA_FF_STATE: "deleted"
|