Commit 860767f6 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch...

Merge branch '191266-remove-the-branch-pipeline-with-build-qa-image-for-merge-requests' into 'master'

Resolve "Remove the branch pipeline with `build-qa-image` for merge requests"

Closes #191266

See merge request gitlab-org/gitlab!22357
parents 346f59c6 2ddc0820
# Make sure to update all the similar conditions in other CI config files if you modify these conditions
.if-canonical-gitlab-schedule: &if-canonical-gitlab-schedule
if: '$CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE =~ /^gitlab-org($|\/)/ && $CI_PIPELINE_SOURCE == "schedule"'
.notify: .notify:
image: ruby:2.6-alpine image: ruby:2.6-alpine
stage: notification stage: notification
...@@ -11,13 +15,13 @@ ...@@ -11,13 +15,13 @@
variables: variables:
COMMIT_NOTES_URL: "https://${CI_SERVER_HOST}/${CI_PROJECT_PATH}/commit/${CI_COMMIT_SHA}#notes-list" COMMIT_NOTES_URL: "https://${CI_SERVER_HOST}/${CI_PROJECT_PATH}/commit/${CI_COMMIT_SHA}#notes-list"
schedule:package-and-qa:notify-failure: package-and-qa:notify-failure:
extends: extends: .notify
- .only:variables_refs-canonical-dot-com-schedules rules:
- .notify - <<: *if-canonical-gitlab-schedule
when: manual # TODO: remove notify job if not necessary
script: script:
- 'export NOTIFICATION_MESSAGE=":skull_and_crossbones: Scheduled QA against master failed! :skull_and_crossbones: See ${CI_PIPELINE_URL}. For downstream pipelines, see ${COMMIT_NOTES_URL}"' - 'export NOTIFICATION_MESSAGE=":skull_and_crossbones: Scheduled QA against master failed! :skull_and_crossbones: See ${CI_PIPELINE_URL}. For downstream pipelines, see ${COMMIT_NOTES_URL}"'
- 'notify_on_job_failure schedule:package-and-qa qa-master "${NOTIFICATION_MESSAGE}" ci_failing' - 'notify_on_job_failure package-and-qa qa-master "${NOTIFICATION_MESSAGE}" ci_failing'
needs: ["schedule:package-and-qa"] needs: ["package-and-qa"]
allow_failure: true allow_failure: true
when: manual # TODO: remove notify job if not necessary
# Make sure to update all the similar conditions in other CI config files if you modify these conditions # Make sure to update all the similar conditions in other CI config files if you modify these conditions
.if-canonical-gitlab-and-merge-request: &if-canonical-gitlab-and-merge-request .if-canonical-gitlab-schedule: &if-canonical-gitlab-schedule
if: '$CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE =~ /^gitlab-org($|\/)/ && $CI_PIPELINE_SOURCE == "schedule"'
# Make sure to update all the similar conditions in other CI config files if you modify these conditions
.if-canonical-gitlab-merge-request: &if-canonical-gitlab-merge-request
if: '$CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE =~ /^gitlab-org($|\/)/ && $CI_MERGE_REQUEST_IID' if: '$CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE =~ /^gitlab-org($|\/)/ && $CI_MERGE_REQUEST_IID'
# Make sure to update all the similar patterns in other CI config files if you modify these patterns # Make sure to update all the similar patterns in other CI config files if you modify these patterns
...@@ -68,19 +72,13 @@ qa:selectors-foss: ...@@ -68,19 +72,13 @@ qa:selectors-foss:
package-and-qa: package-and-qa:
extends: .package-and-qa-base extends: .package-and-qa-base
rules: rules:
- <<: *if-canonical-gitlab-and-merge-request - <<: *if-canonical-gitlab-merge-request
changes: *qa-patterns changes: *qa-patterns
when: on_success when: on_success
- <<: *if-canonical-gitlab-and-merge-request - <<: *if-canonical-gitlab-merge-request
changes: *code-patterns changes: *code-patterns
when: manual when: manual
needs: ["build-qa-image", "gitlab:assets:compile pull-cache"] - <<: *if-canonical-gitlab-schedule
allow_failure: true when: on_success
schedule:package-and-qa:
extends:
- .package-and-qa-base
- .default-only
- .only:variables_refs-canonical-dot-com-schedules
needs: ["build-qa-image", "gitlab:assets:compile pull-cache"] needs: ["build-qa-image", "gitlab:assets:compile pull-cache"]
allow_failure: true allow_failure: true
# Make sure to update all the similar conditions in other CI config files if you modify these conditions # Make sure to update all the similar conditions in other CI config files if you modify these conditions
.if-canonical-gitlab: &if-canonical-gitlab .if-canonical-gitlab-schedule: &if-canonical-gitlab-schedule
if: '$CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE =~ /^gitlab-org($|\/)/' if: '$CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE =~ /^gitlab-org($|\/)/ && $CI_PIPELINE_SOURCE == "schedule"'
# Make sure to update all the similar conditions in other CI config files if you modify these conditions # Make sure to update all the similar conditions in other CI config files if you modify these conditions
.if-canonical-gitlab-and-merge-request: &if-canonical-gitlab-and-merge-request .if-canonical-gitlab-merge-request: &if-canonical-gitlab-merge-request
if: '$CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE =~ /^gitlab-org($|\/)/ && $CI_MERGE_REQUEST_IID' if: '$CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE =~ /^gitlab-org($|\/)/ && $CI_MERGE_REQUEST_IID'
# Make sure to update all the similar patterns in other CI config files if you modify these patterns # Make sure to update all the similar patterns in other CI config files if you modify these patterns
...@@ -44,9 +44,11 @@ build-qa-image: ...@@ -44,9 +44,11 @@ build-qa-image:
extends: .review-docker extends: .review-docker
stage: prepare stage: prepare
rules: rules:
- <<: *if-canonical-gitlab - <<: *if-canonical-gitlab-merge-request
changes: *code-qa-patterns changes: *code-qa-patterns
when: on_success when: on_success
- <<: *if-canonical-gitlab-schedule
when: on_success
script: script:
- '[[ ! -d "ee/" ]] || export GITLAB_EDITION="ee"' - '[[ ! -d "ee/" ]] || export GITLAB_EDITION="ee"'
- export QA_MASTER_IMAGE="${CI_REGISTRY}/${CI_PROJECT_PATH}/gitlab/gitlab-${GITLAB_EDITION}-qa:master" - export QA_MASTER_IMAGE="${CI_REGISTRY}/${CI_PROJECT_PATH}/gitlab/gitlab-${GITLAB_EDITION}-qa:master"
...@@ -157,7 +159,7 @@ schedule:review-build-cng: ...@@ -157,7 +159,7 @@ schedule:review-build-cng:
review-deploy: review-deploy:
extends: .review-deploy-base extends: .review-deploy-base
rules: rules:
- <<: *if-canonical-gitlab-and-merge-request - <<: *if-canonical-gitlab-merge-request
changes: *code-qa-patterns changes: *code-qa-patterns
when: on_success when: on_success
...@@ -184,7 +186,7 @@ review-stop-failed-deployment: ...@@ -184,7 +186,7 @@ review-stop-failed-deployment:
extends: .base-review-stop extends: .base-review-stop
stage: prepare stage: prepare
rules: rules:
- <<: *if-canonical-gitlab-and-merge-request - <<: *if-canonical-gitlab-merge-request
changes: *code-qa-patterns changes: *code-qa-patterns
when: on_success when: on_success
script: script:
...@@ -194,7 +196,7 @@ review-stop: ...@@ -194,7 +196,7 @@ review-stop:
extends: .base-review-stop extends: .base-review-stop
stage: review stage: review
rules: rules:
- <<: *if-canonical-gitlab-and-merge-request - <<: *if-canonical-gitlab-merge-request
changes: *code-qa-patterns changes: *code-qa-patterns
when: manual when: manual
allow_failure: true allow_failure: true
...@@ -235,7 +237,7 @@ review-stop: ...@@ -235,7 +237,7 @@ review-stop:
review-qa-smoke: review-qa-smoke:
extends: .review-qa-base extends: .review-qa-base
rules: rules:
- <<: *if-canonical-gitlab-and-merge-request - <<: *if-canonical-gitlab-merge-request
changes: *code-qa-patterns changes: *code-qa-patterns
when: on_success when: on_success
script: script:
...@@ -244,7 +246,7 @@ review-qa-smoke: ...@@ -244,7 +246,7 @@ review-qa-smoke:
review-qa-all: review-qa-all:
extends: .review-qa-base extends: .review-qa-base
rules: rules:
- <<: *if-canonical-gitlab-and-merge-request - <<: *if-canonical-gitlab-merge-request
changes: *code-qa-patterns changes: *code-qa-patterns
when: manual when: manual
parallel: 5 parallel: 5
...@@ -276,7 +278,7 @@ review-qa-all: ...@@ -276,7 +278,7 @@ review-qa-all:
review-performance: review-performance:
extends: .review-performance-base extends: .review-performance-base
rules: rules:
- <<: *if-canonical-gitlab-and-merge-request - <<: *if-canonical-gitlab-merge-request
changes: *code-qa-patterns changes: *code-qa-patterns
when: on_success when: on_success
needs: ["review-deploy"] needs: ["review-deploy"]
......
...@@ -156,7 +156,7 @@ This is similar to the `.only:variables-canonical-dot-com` + `.except:refs-maste ...@@ -156,7 +156,7 @@ This is similar to the `.only:variables-canonical-dot-com` + `.except:refs-maste
CI definitions: CI definitions:
```yaml ```yaml
.if-canonical-gitlab-and-merge-request: &if-canonical-gitlab-and-merge-request .if-canonical-gitlab-merge-request: &if-canonical-gitlab-merge-request
if: '$CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE =~ /^gitlab-org($|\/)/ && $CI_MERGE_REQUEST_IID' if: '$CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE =~ /^gitlab-org($|\/)/ && $CI_MERGE_REQUEST_IID'
``` ```
...@@ -210,9 +210,7 @@ graph RL; ...@@ -210,9 +210,7 @@ graph RL;
M[coverage]; M[coverage];
N[pages]; N[pages];
O[static-analysis]; O[static-analysis];
P["schedule:package-and-qa<br/>(master schedule only)"];
Q[package-and-qa]; Q[package-and-qa];
R[package-and-qa-manual];
S["RSpec<br/>(e.g. rspec unit pg9)"] S["RSpec<br/>(e.g. rspec unit pg9)"]
T[retrieve-tests-metadata]; T[retrieve-tests-metadata];
...@@ -259,10 +257,6 @@ subgraph "`review` stage" ...@@ -259,10 +257,6 @@ subgraph "`review` stage"
subgraph "`qa` stage" subgraph "`qa` stage"
Q --> |needs| C; Q --> |needs| C;
Q --> |needs| F; Q --> |needs| F;
R --> |needs| C;
R --> |needs| F;
P --> |needs| C;
P --> |needs| F;
review-qa-smoke -.-> |needs and depends on| G; review-qa-smoke -.-> |needs and depends on| G;
review-qa-all -.-> |needs and depends on| G; review-qa-all -.-> |needs and depends on| G;
review-performance -.-> |needs and depends on| G; review-performance -.-> |needs and depends on| G;
...@@ -271,8 +265,7 @@ subgraph "`qa` stage" ...@@ -271,8 +265,7 @@ subgraph "`qa` stage"
end end
subgraph "`notification` stage" subgraph "`notification` stage"
NOTIFICATION1["schedule:package-and-qa:notify-success<br>(on_success)"] -.-> |needs| P; NOTIFICATION2["package-and-qa:notify-failure<br>(manual)"] -.-> |needs| Q;
NOTIFICATION2["schedule:package-and-qa:notify-failure<br>(on_failure)"] -.-> |needs| P;
end end
subgraph "`post-test` stage" subgraph "`post-test` stage"
......
...@@ -27,11 +27,11 @@ You can find these nightly pipelines at `https://gitlab.com/gitlab-org/quality/s ...@@ -27,11 +27,11 @@ You can find these nightly pipelines at `https://gitlab.com/gitlab-org/quality/s
### Testing code in merge requests ### Testing code in merge requests
#### Using the `package-and-qa-manual` job #### Using the `package-and-qa` job
It is possible to run end-to-end tests for a merge request, eventually being run in It is possible to run end-to-end tests for a merge request, eventually being run in
a pipeline in the [`gitlab-qa`](https://gitlab.com/gitlab-org/gitlab-qa/) project, a pipeline in the [`gitlab-qa`](https://gitlab.com/gitlab-org/gitlab-qa/) project,
by triggering the `package-and-qa-manual` manual action in the `test` stage (not by triggering the `package-and-qa` manual action in the `test` stage (not
available for forks). available for forks).
**This runs end-to-end tests against a custom Omnibus package built from your **This runs end-to-end tests against a custom Omnibus package built from your
...@@ -53,7 +53,7 @@ graph LR ...@@ -53,7 +53,7 @@ graph LR
B2[`Trigger-qa` stage<br>`Trigger:qa-test` job] -.->|2. Triggers a gitlab-qa pipeline and wait for it to be done| A3 B2[`Trigger-qa` stage<br>`Trigger:qa-test` job] -.->|2. Triggers a gitlab-qa pipeline and wait for it to be done| A3
subgraph "gitlab-foss/gitlab pipeline" subgraph "gitlab-foss/gitlab pipeline"
A1[`test` stage<br>`package-and-qa-manual` job] A1[`test` stage<br>`package-and-qa` job]
end end
subgraph "omnibus-gitlab pipeline" subgraph "omnibus-gitlab pipeline"
...@@ -61,7 +61,7 @@ subgraph "omnibus-gitlab pipeline" ...@@ -61,7 +61,7 @@ subgraph "omnibus-gitlab pipeline"
end end
subgraph "gitlab-qa pipeline" subgraph "gitlab-qa pipeline"
A3>QA jobs run] -.->|3. Reports back the pipeline result to the `package-and-qa-manual` job<br>and post the result on the original commit tested| A1 A3>QA jobs run] -.->|3. Reports back the pipeline result to the `package-and-qa` job<br>and post the result on the original commit tested| A1
end end
``` ```
......
...@@ -40,7 +40,7 @@ the time it would take to build packages and test everything. ...@@ -40,7 +40,7 @@ the time it would take to build packages and test everything.
That is why when someone changes `t.text_field :login` to That is why when someone changes `t.text_field :login` to
`t.text_field :username` in the _new session_ view we won't know about this `t.text_field :username` in the _new session_ view we won't know about this
change until our GitLab QA nightly pipeline fails, or until someone triggers change until our GitLab QA nightly pipeline fails, or until someone triggers
`package-and-qa-manual` action in their merge request. `package-and-qa` action in their merge request.
Obviously such a change would break all tests. We call this problem a _fragile Obviously such a change would break all tests. We call this problem a _fragile
tests problem_. tests problem_.
...@@ -171,8 +171,8 @@ and we should prefer the `data-qa-selector` method of definition. ...@@ -171,8 +171,8 @@ and we should prefer the `data-qa-selector` method of definition.
> Introduced in GitLab 12.5 > Introduced in GitLab 12.5
A common occurrence in automated testing is selecting a single "one-of-many" element. A common occurrence in automated testing is selecting a single "one-of-many" element.
In a list of several items, how do you differentiate what you are selecting on? In a list of several items, how do you differentiate what you are selecting on?
The most common workaround for this is via text matching. Instead, a better practice is The most common workaround for this is via text matching. Instead, a better practice is
by matching on that specific element by a unique identifier, rather than by text. by matching on that specific element by a unique identifier, rather than by text.
......
...@@ -30,7 +30,7 @@ and corresponding views / partials / selectors in CE / EE. ...@@ -30,7 +30,7 @@ and corresponding views / partials / selectors in CE / EE.
Whenever `qa:selectors` job fails in your merge request, you are supposed to Whenever `qa:selectors` job fails in your merge request, you are supposed to
fix [page objects](../doc/development/testing_guide/end_to_end/page_objects.md). You should also trigger end-to-end tests fix [page objects](../doc/development/testing_guide/end_to_end/page_objects.md). You should also trigger end-to-end tests
using `package-and-qa-manual` manual action, to test if everything works fine. using `package-and-qa` manual action, to test if everything works fine.
## How can I use it? ## How can I use it?
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment