Commit 0599a0c1 authored by Mark Lapierre's avatar Mark Lapierre

Merge branch 'allure-environment-metadata' into 'master'

E2E: Add environment info to allure report

See merge request gitlab-org/gitlab!66139
parents 652bcf26 4c683021
......@@ -19,10 +19,10 @@ GEM
rack-test (>= 1.1.0, < 2.0)
rest-client (>= 2.0.2, < 3.0)
rspec (~> 3.8)
allure-rspec (2.14.1)
allure-ruby-commons (= 2.14.1)
allure-rspec (2.14.2)
allure-ruby-commons (= 2.14.2)
rspec-core (>= 3.8, < 4)
allure-ruby-commons (2.14.1)
allure-ruby-commons (2.14.2)
mime-types (>= 3.3, < 4)
oj (>= 3.10, < 4)
require_all (>= 2, < 4)
......@@ -97,7 +97,7 @@ GEM
method_source (0.9.0)
mime-types (3.3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2020.0425)
mime-types-data (3.2021.0704)
mini_mime (1.0.2)
mini_portile2 (2.5.0)
minitest (5.14.4)
......@@ -109,7 +109,7 @@ GEM
octokit (4.21.0)
faraday (>= 0.9)
sawyer (~> 0.8.0, >= 0.5.3)
oj (3.11.5)
oj (3.12.1)
parallel (1.19.2)
parallel_tests (2.29.0)
parallel
......@@ -145,7 +145,7 @@ GEM
rspec-core (~> 3.9.0)
rspec-expectations (~> 3.9.0)
rspec-mocks (~> 3.9.0)
rspec-core (3.9.2)
rspec-core (3.9.3)
rspec-support (~> 3.9.3)
rspec-expectations (3.9.1)
diff-lcs (>= 1.2.0, < 2.0)
......@@ -161,7 +161,7 @@ GEM
unparser
rspec-retry (0.6.1)
rspec-core (> 3.3)
rspec-support (3.9.3)
rspec-support (3.9.4)
rspec_junit_formatter (0.4.1)
rspec-core (>= 2, < 4, != 2.12.0)
ruby-debug-ide (0.7.2)
......
# frozen_string_literal: true
require 'active_support/core_ext/enumerable'
module QA
module Runtime
class AllureReport
......@@ -29,6 +31,7 @@ module QA
AllureRspec.configure do |config|
config.results_directory = 'tmp/allure-results'
config.clean_results_directory = true
config.environment_properties = environment_info if Env.running_in_ci?
# Set custom environment name to separate same specs executed on different environments
if Env.running_in_ci? && Env.ci_job_name.match?(env_matcher)
......@@ -85,6 +88,29 @@ module QA
end
end
end
# Custom environment info hash
#
# @return [Hash]
def environment_info
%w[
CI_COMMIT_SHA
CI_MERGE_REQUEST_SOURCE_BRANCH_SHA
CI_MERGE_REQUEST_IID
TOP_UPSTREAM_SOURCE_SHA
TOP_UPSTREAM_MERGE_REQUEST_IID
DEPLOY_VERSION
GITLAB_VERSION
GITLAB_SHELL_VERSION
GITLAB_ELASTICSEARCH_INDEXER_VERSION
GITLAB_KAS_VERSION
GITLAB_WORKHORSE_VERSION
GITLAB_PAGES_VERSION
GITALY_SERVER_VERSION
QA_IMAGE
QA_BROWSER
].index_with { |val| ENV[val] }.compact_blank
end
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