Skip to content
Snippets Groups Projects
Commit e5f51ff6 authored by Andrejs Cunskis's avatar Andrejs Cunskis
Browse files

Merge branch 'fix-pipeline-name' into 'master'

Fix pipeline name detection

See merge request gitlab-org/gitlab-qa!1032
parents 53654254 b4560f9a
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -159,14 +159,14 @@ module Gitlab
# Gets the name of the pipeline the test was run in, to be used as the key of a scoped label
#
# Tests can be run in several pipelines:
# gitlab-qa, nightly, staging, canary, production, preprod, MRs, and the default branch (master/main)
# gitlab, nightly, staging, canary, production, preprod, MRs, and the default branch (master/main)
#
# Some of those run in their own project, so CI_PROJECT_NAME is the name we need. Those are:
# nightly, staging, canary, production, and preprod
#
# MR, master/main, and gitlab-qa tests run in gitlab-qa, but we only want to report tests run on
# MR, master/main, and gitlab tests run in gitlab-qa, but we only want to report tests run on
# master/main because the other pipelines will be monitored by the author of the MR that triggered them.
# So we assume that we're reporting a master/main pipeline if the project name is 'gitlab-qa'.
# So we assume that we're reporting a master/main pipeline if the project name is 'gitlab'.
 
@pipeline ||= Runtime::Env.pipeline_from_project_name
end
Loading
Loading
Loading
Loading
@@ -199,7 +199,7 @@ module Gitlab
end
 
def pipeline_from_project_name
ci_project_name.to_s.start_with?('gitlab-qa') ? QA::Runtime::Env.default_branch : ci_project_name
ci_project_name.to_s.start_with?('gitlab') ? QA::Runtime::Env.default_branch : ci_project_name
end
 
def run_id
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment