Class: GitlabQuality::TestTooling::TestMeta::Processor::AddToQuarantineProcessor
- Inherits:
-
MetaProcessor
- Object
- MetaProcessor
- GitlabQuality::TestTooling::TestMeta::Processor::AddToQuarantineProcessor
- Defined in:
- lib/gitlab_quality/test_tooling/test_meta/processor/add_to_quarantine_processor.rb
Constant Summary collapse
- QUARANTINE_METADATA =
<<~META , %{indentation}quarantine: { %{indentation} issue: '%{issue_url}', %{indentation} type: %{quarantine_type} %{indentation}}%{suffix} META
- BRANCH_PREFIX =
'quarantine'
Constants inherited from MetaProcessor
MetaProcessor::DESCRIPTION_REGEX
Class Method Summary collapse
-
.create_merge_requests(context) ⇒ Object
Creates the merge requests to quarantine E2E tests.
-
.post_process(context) ⇒ Object
Performs post processing.
Methods inherited from MetaProcessor
create_commit, end_of_description_index, existing_mrs, failure_issue_text, spec_details_from_commits
Class Method Details
.create_merge_requests(context) ⇒ Object
Creates the merge requests to quarantine E2E tests
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/gitlab_quality/test_tooling/test_meta/processor/add_to_quarantine_processor.rb', line 21 def create_merge_requests(context) @context = context context.processed_commits.each_value do |record| branch, devops_stage, product_group, file = extract_data_from_record(record) mr_title = format("%{prefix} %{file}", prefix: '[E2E] QUARANTINE:', file: file).truncate(72, omission: '') gitlab_bot_user_id = context.user_id_for_username(Runtime::Env.gitlab_bot_username) merge_request = context.create_merge_request(mr_title, branch, gitlab_bot_user_id) do merge_request_description(record, devops_stage, product_group) end if merge_request Runtime::Logger.info(" Created MR for quarantine: #{merge_request.web_url}") record[:merge_request] = merge_request end end end |
.post_process(context) ⇒ Object
Performs post processing. Posts a list of MRs in a note on report_issue and Slack. Also posts note on failure issues for un-quarantining of the quarantined
46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/gitlab_quality/test_tooling/test_meta/processor/add_to_quarantine_processor.rb', line 46 def post_process(context) @context = context web_urls = context.processed_commits.values.map { |value| "- #{value[:merge_request].web_url}\n" }.join return if web_urls.empty? context.post_note_on_issue(mrs_created_note_for_report_issue(web_urls), context.report_issue) context.((web_urls)) post_unquarantine_note_on_failure_issue end |