Post message for action on MR when selective e2e tests are detected
What does this MR do and why?
Post message on MR when selective e2e tests are detected.
- When QA_TESTS have folders, post the message
- When QA_TESTS is empty or has specific e2e test files, don't post the message. (When there are specific e2e test files, the pipeline is run automatically)
- When the message has already been posted, do not post again.
Related to: gitlab-org/quality/quality-engineering/team-tasks#1472 (comment 1421748026)
Work Item: https://gitlab.com/gitlab-com/gitlab-OKRs/-/work_items/2295
Testing:
- Post message on MR with BE changes and stage label on MR
- Don't post message on MR when e2e test files are changed only
- Don't post message on MR with QA Framework only changes
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
The CI_PROJECT_ID
, CI_PIPELINE_ID
and CI_MERGE_REQUEST_SOURCE_BRANCH_SHA
in the below example are from this temporary MR: !121986 (closed). Feel free to use it or any other MR. Also, an example ENV_FILE is attached below.
Example ENV_FILE: qa_tests_vars.env
From your GitLab checkout directory, run:
CI_PROJECT_ID=278964 CI_PIPELINE_ID=883519399 CI_MERGE_REQUEST_SOURCE_BRANCH_SHA=9e963781aa12f156bbe8fe38c9a9dbaa08049640 PROJECT_TOKEN_FOR_CI_SCRIPTS_API_USAGE=<your_personal_access_token> ENV_FILE=</path/to/qa_tests_vars.env> scripts/generate-message-to-run-e2e-pipeline.rb
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.