diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-07 21:10:23 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-07 21:10:23 +0300 |
commit | 21e144f387bc4d77f6128ee87549daf174467518 (patch) | |
tree | a1f7ca7673e157e9175b527fc435b480c974645a /qa | |
parent | 79f98200f84590af39cf1af7f57f6e8ba89d2bb6 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'qa')
-rw-r--r-- | qa/qa/runtime/allure_report.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/qa/qa/runtime/allure_report.rb b/qa/qa/runtime/allure_report.rb index cf8d33e0a6d..5e9ae3e7bbe 100644 --- a/qa/qa/runtime/allure_report.rb +++ b/qa/qa/runtime/allure_report.rb @@ -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 |