diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-02-21 00:18:15 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-02-21 00:18:15 +0000 |
commit | eb8607408da45fd1174e9f42579f433e61bdd260 (patch) | |
tree | 29bdc06a8b5132ce19b5bb00503d064ce162b8cd /qa/qa/tools | |
parent | f29c140c1cb7fc8590199ee1f4ab62707e036244 (diff) | |
download | gitlab-ce-eb8607408da45fd1174e9f42579f433e61bdd260.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'qa/qa/tools')
-rw-r--r-- | qa/qa/tools/reliable_report.rb | 28 |
1 files changed, 3 insertions, 25 deletions
diff --git a/qa/qa/tools/reliable_report.rb b/qa/qa/tools/reliable_report.rb index 27e54c2d8bf..2735881c5d6 100644 --- a/qa/qa/tools/reliable_report.rb +++ b/qa/qa/tools/reliable_report.rb @@ -8,6 +8,7 @@ require "colorize" module QA module Tools class ReliableReport + include Support::InfluxdbTools include Support::API # Project for report creation: https://gitlab.com/gitlab-org/gitlab @@ -15,10 +16,7 @@ module QA def initialize(range) @range = range.to_i - @influxdb_bucket = "e2e-test-stats" @slack_channel = "#quality-reports" - @influxdb_url = ENV["QA_INFLUXDB_URL"] || raise("Missing QA_INFLUXDB_URL env variable") - @influxdb_token = ENV["QA_INFLUXDB_TOKEN"] || raise("Missing QA_INFLUXDB_TOKEN env variable") end # Run reliable reporter @@ -91,7 +89,7 @@ module QA private - attr_reader :range, :influxdb_bucket, :slack_channel, :influxdb_url, :influxdb_token + attr_reader :range, :slack_channel # Markdown formatted report issue body # @@ -304,7 +302,7 @@ module QA # @return [String] def query(reliable) <<~QUERY - from(bucket: "#{influxdb_bucket}") + from(bucket: "#{Support::InfluxdbTools::INFLUX_TEST_METRICS_BUCKET}") |> range(start: -#{range}d) |> filter(fn: (r) => r._measurement == "test-stats") |> filter(fn: (r) => r.run_type == "staging-full" or @@ -325,26 +323,6 @@ module QA QUERY end - # Query client - # - # @return [QueryApi] - def query_api - @query_api ||= influx_client.create_query_api - end - - # InfluxDb client - # - # @return [InfluxDB2::Client] - def influx_client - @influx_client ||= InfluxDB2::Client.new( - influxdb_url, - influxdb_token, - bucket: influxdb_bucket, - org: "gitlab-qa", - precision: InfluxDB2::WritePrecision::NANOSECOND - ) - end - # Slack notifier # # @return [Slack::Notifier] |