Commit 4d888aa9 authored by Dan Davison's avatar Dan Davison

Merge branch 'acunskis-package-and-qa-allure' into 'master'

Set custom allure environment for package-and-qa runs

See merge request gitlab-org/gitlab!63191
parents 1d828594 298883a2
......@@ -23,9 +23,17 @@ module QA
#
# @return [void]
def configure_allure
# Match job names like ee:relative, ce:update etc. and set as execution environment
env_matcher = /^(?<env>\w{2}:\S+)/
AllureRspec.configure do |config|
config.results_directory = 'tmp/allure-results'
config.clean_results_directory = true
# Set custom environment name to separate same specs executed on different environments
if Env.running_in_ci? && Env.ci_job_name.match?(env_matcher)
config.environment = Env.ci_job_name.match(env_matcher).named_captures['env']
end
end
end
......@@ -67,7 +75,7 @@ module QA
issue = example.metadata.dig(:quarantine, :issue)
example.issue('Issue', issue) if issue
example.add_link(name: "Job(#{ENV['CI_JOB_NAME']})", url: ENV['CI_JOB_URL']) if ENV['CI']
example.add_link(name: "Job(#{Env.ci_job_name})", url: Env.ci_job_url) if Env.running_in_ci?
end
end
end
......
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