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

qa.gitlab-ci.yml « ci « .gitlab - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 7d0910f7ba596e19e4e93c446986abd91d775b58 (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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
.qa-job-base:
  image: ${REGISTRY_HOST}/${REGISTRY_GROUP}/gitlab-build-images/debian-${DEBIAN_VERSION}-ruby-${RUBY_VERSION}:bundler-${BUNDLER_VERSION}-chrome-${CHROME_VERSION}-docker-${DOCKER_VERSION}
  extends:
    - .default-retry
    - .qa-cache
  stage: test
  needs: []
  variables:
    USE_BUNDLE_INSTALL: "false"
    SETUP_DB: "false"
  before_script:
    - !reference [.default-before_script, before_script]
    - cd qa && bundle install

.e2e-trigger-base:
  extends: .production  # this makes sure GITLAB_ALLOW_SEPARATE_CI_DATABASE is passed to the child pipeline
  stage: qa
  variables:
    # This is needed by `trigger-omnibus-env` (`.gitlab/ci/package-and-test/main.gitlab-ci.yml`).
    PARENT_PIPELINE_ID: $CI_PIPELINE_ID
    SKIP_MESSAGE: Skipping package-and-test due to mr containing only quarantine changes!
    GITLAB_QA_IMAGE: "${CI_REGISTRY_IMAGE}/gitlab-ee-qa:${CI_COMMIT_SHA}"
    RUN_WITH_BUNDLE: "true"  # instructs pipeline to install and run gitlab-qa gem via bundler
    QA_PATH: qa  # sets the optional path for bundler to run from
    DYNAMIC_PIPELINE_YML: package-and-test-pipeline.yml  # yml files are generated by scripts/generate-e2e-pipeline script
  inherit:
    variables:
      - CHROME_VERSION
      - RUBY_VERSION
      - BUNDLER_VERSION
      - DOCKER_VERSION
      - DEBIAN_VERSION
      - REGISTRY_GROUP
      - REGISTRY_HOST
  trigger:
    strategy: depend
    forward:
      yaml_variables: true
      pipeline_variables: true
    include:
      - artifact: $DYNAMIC_PIPELINE_YML
        job: e2e-test-pipeline-generate

qa:internal:
  extends:
    - .qa-job-base
    - .qa:rules:internal
  script:
    - bundle exec rspec -O .rspec_internal

cache-qa-gems:
  extends:
    - .qa-job-base
    - .qa-cache-push
    - .qa:rules:update-gem-cache
  stage: prepare
  script:
    - echo "Cache has been updated and ready to be uploaded."

# E2E runners have separate infra setup and different cache bucket
cache-qa-gems-e2e-runners:
  extends: cache-qa-gems
  tags:
    - e2e

trigger-omnibus:
  stage: qa
  extends:
    - .qa:rules:trigger-omnibus
  needs:
    - trigger-omnibus-env
    - build-assets-image
  inherit:
    variables: false
  variables:
    GITALY_SERVER_VERSION: $GITALY_SERVER_VERSION
    GITLAB_ELASTICSEARCH_INDEXER_VERSION: $GITLAB_ELASTICSEARCH_INDEXER_VERSION
    GITLAB_KAS_VERSION: $GITLAB_KAS_VERSION
    GITLAB_PAGES_VERSION: $GITLAB_PAGES_VERSION
    GITLAB_SHELL_VERSION: $GITLAB_SHELL_VERSION
    GITLAB_WORKHORSE_VERSION: $GITLAB_WORKHORSE_VERSION
    GITLAB_VERSION: $CI_COMMIT_SHA
    GITLAB_ASSETS_TAG: $GITLAB_ASSETS_TAG
    IMAGE_TAG: $CI_COMMIT_SHA
    TOP_UPSTREAM_SOURCE_PROJECT: $CI_PROJECT_PATH
    SECURITY_SOURCES: $SECURITY_SOURCES
    CACHE_UPDATE: $OMNIBUS_GITLAB_CACHE_UPDATE
    CACHE_EDITION: $OMNIBUS_GITLAB_CACHE_EDITION
    USE_SPECIFIED_RUBY_VERSION: "true"
    RUBY_VERSION: $FULL_RUBY_VERSION
    BUILD_ON_ALL_OS: $OMNIBUS_GITLAB_BUILD_ON_ALL_OS
    SKIP_QA_TEST: "true"
    ee: $EE
  trigger:
    project: gitlab-org/build/omnibus-gitlab-mirror
    branch: $TRIGGER_BRANCH
    strategy: depend

# Same as trigger-omnibus but is manual and runs follow-up-e2e:package-and-test-ee automatically right after
trigger-omnibus-and-follow-up-e2e:
  extends:
    - trigger-omnibus
    - .qa:rules:manual-omnibus-and-follow-up-e2e

trigger-omnibus as-if-foss:
  extends:
    - trigger-omnibus
    - .qa:rules:trigger-omnibus-ce
  needs:
    - trigger-omnibus-env as-if-foss
    - build-assets-image as-if-foss
  variables:
    # Override gitlab repository so that omnibus doesn't use foss repository for CE build
    GITLAB_ALTERNATIVE_REPO: $CI_PROJECT_URL

# If a rename is required for this job, please notify the Delivery team (`@gitlab-org/delivery`)
e2e:package-and-test-ee:
  extends:
    - .e2e-trigger-base
    - .qa:rules:package-and-test-ee
  needs:
    - build-qa-image
    - trigger-omnibus
    - e2e-test-pipeline-generate
  variables:
    RELEASE: "${REGISTRY_HOST}/${REGISTRY_GROUP}/build/omnibus-gitlab-mirror/gitlab-ee:${CI_COMMIT_SHA}"
    QA_RUN_TYPE: e2e-package-and-test
    PIPELINE_NAME: E2E Omnibus GitLab EE

# Same as e2e:package-and-test-ee but runs automatically after trigger-omnibus-and-follow-up-e2e
follow-up-e2e:package-and-test-ee:
  extends:
    - .e2e-trigger-base
    - .qa:rules:follow-up-e2e
  needs:
    - build-qa-image
    - trigger-omnibus-and-follow-up-e2e
    - e2e-test-pipeline-generate
  variables:
    RELEASE: "${REGISTRY_HOST}/${REGISTRY_GROUP}/build/omnibus-gitlab-mirror/gitlab-ee:${CI_COMMIT_SHA}"
    QA_RUN_TYPE: e2e-package-and-test
    PIPELINE_NAME: E2E Omnibus GitLab EE

e2e:post-run-e2e-message:
  extends:
    - .predictive-job
    - .qa:rules:post-run-e2e-message
  stage: qa
  variables:
    ENV_FILE: $CI_PROJECT_DIR/qa_tests_vars.env
  image: ${GITLAB_DEPENDENCY_PROXY_ADDRESS}ruby:${RUBY_VERSION}
  before_script:
    - source scripts/utils.sh
    - install_gitlab_gem
  script:
    - scripts/generate-message-to-run-e2e-pipeline.rb
  needs:
    - e2e-test-pipeline-generate
    - trigger-omnibus-env
    - build-assets-image
  artifacts:
    expire_in: 1 day
    paths:
      - "${CI_PROJECT_DIR}/qa_tests_vars.env"

e2e:package-and-test-ce:
  extends:
    - e2e:package-and-test-ee
    - .qa:rules:package-and-test-ce
  needs:
    - build-qa-image as-if-foss
    - trigger-omnibus as-if-foss
    - e2e-test-pipeline-generate
  variables:
    FOSS_ONLY: "1"
    RELEASE: ${REGISTRY_HOST}/${REGISTRY_GROUP}/build/omnibus-gitlab-mirror/gitlab-ce:${CI_COMMIT_SHA}
    GITLAB_QA_IMAGE: ${CI_REGISTRY_IMAGE}/gitlab-ce-qa:${CI_COMMIT_SHA}
    QA_RUN_TYPE: e2e-package-and-test-ce
    PIPELINE_NAME: E2E Omnibus GitLab CE

e2e:package-and-test-nightly:
  extends:
    - .e2e-trigger-base
    - .qa:rules:package-and-test-nightly
  needs:
    - build-qa-image
    - trigger-omnibus
    - e2e-test-pipeline-generate
  variables:
    GITLAB_SEMVER_VERSION: $GITLAB_SEMVER_VERSION
    QA_RUN_TYPE: nightly
    PIPELINE_NAME: E2E Omnibus GitLab Nightly
    DYNAMIC_PIPELINE_YML: package-and-test-nightly-pipeline.yml

e2e:test-on-gdk:
  extends:
    - .e2e-trigger-base
    - .qa:rules:e2e:test-on-gdk
  stage: qa
  needs:
    - build-gdk-image
    - e2e-test-pipeline-generate
  variables:
    QA_RUN_TYPE: e2e-test-on-gdk
    PIPELINE_NAME: E2E GDK
    DYNAMIC_PIPELINE_YML: test-on-gdk-pipeline.yml
    SKIP_MESSAGE: Skipping test-on-gdk due to mr containing only quarantine changes!
    GDK_IMAGE: "${CI_REGISTRY_IMAGE}/gitlab-qa-gdk:${CI_COMMIT_SHA}"

e2e:code-suggestions-eval:
  extends:
    - .qa:rules:code-suggestions-eval
  stage: qa
  needs: ["build-gdk-image"]
  variables:
    CS_EVAL_DOWNSTREAM_BRANCH: main
    GITLAB_SHA: $CI_COMMIT_SHA
  trigger:
    strategy: depend
    forward:
      yaml_variables: true
      pipeline_variables: true
    project: gitlab-com/create-stage/code-creation/code-suggestion-scenarios
    branch: $CS_EVAL_DOWNSTREAM_BRANCH

e2e:code-suggestions-eval-results:
  extends:
    - .default-retry
    - .qa:rules:code-suggestions-eval-results
  stage: post-qa
  needs:
    - e2e:code-suggestions-eval
  variables:
    TRIGGER_JOB_NAME: "e2e:code-suggestions-eval"
    DOWNSTREAM_PROJECT: gitlab-com/create-stage/code-creation/code-suggestion-scenarios
    DOWNSTREAM_JOB_NAME: run_scenarios
    DOWNSTREAM_JOB_ARTIFACT_PATH: scores-DOWNSTREAM_JOB_ID.csv
    OUTPUT_ARTIFACT_PATH: scores.csv
  before_script:
    - source scripts/utils.sh
    - install_gitlab_gem
  script:
    - scripts/download-downstream-artifact.rb
  artifacts:
    expose_as: 'Code Suggestions evaluation results'
    paths:
      - scores.csv

e2e:fulfillment-quarantine-report:
  extends:
    - .qa:rules:fulfillment-e2e-quarantine-report
  stage: qa
  before_script:
    - cd qa && bundle install
    - apt-get update && apt-get install -y jq
  variables:
    RSPEC_JSON: "tmp/rspec-fulfillment-quarantined.json"
    NOTES_API: "https://gitlab.com/api/v4/projects/$CI_MERGE_REQUEST_PROJECT_ID/merge_requests/$CI_MERGE_REQUEST_IID/notes"
    USER_API: "https://gitlab.com/api/v4/user"
    FULFILLMENT_SPECS_PATH: "qa/specs/features/ee/browser_ui/11_fulfillment"
  script:
    - bundle exec rspec $FULFILLMENT_SPECS_PATH --tag quarantine --format json --out $RSPEC_JSON --dry-run
    - |
      if [[ -f $RSPEC_JSON && $(cat $RSPEC_JSON | jq ".examples[]") ]]
      then # quarantined tests found
        bot_user_id=$(curl $USER_API -H "PRIVATE-TOKEN: $PROJECT_TOKEN_FOR_CI_SCRIPTS_API_USAGE" | jq ".id")
        existing_comment=$(curl $NOTES_API -H "PRIVATE-TOKEN: $PROJECT_TOKEN_FOR_CI_SCRIPTS_API_USAGE" | jq ".[] | select((.author | .id | contains($bot_user_id)) and (.body | contains(\"# Quarantined Fulfillment QA E2E Tests\")))")
        if [[ ! -z $existing_comment ]]
        then
          echo 'MR comment already exists, doing nothing'
        else
          COMMENT_HEADER=$'# Quarantined Fulfillment QA E2E Tests\nThe following Fulfillment QA E2E tests are in quarantine. If your changes would be covered by these tests, please be sure to perform manual testing.\n'
          COMMENT_TABLE=$(cat $RSPEC_JSON | jq --raw-output '"|Description|Location|\n|---|---|\n" + ([.examples[] | "| \(.full_description) | \(.id) |\n"] | join(""))')
          curl --request POST $NOTES_API -H "PRIVATE-TOKEN: $PROJECT_TOKEN_FOR_CI_SCRIPTS_API_USAGE" --data-urlencode "body=$COMMENT_HEADER $COMMENT_TABLE"
        fi
      else
        echo 'No quarantined tests found'
      fi