summaryrefslogtreecommitdiff
path: root/qa/qa/tools/reliable_report.rb
diff options
context:
space:
mode:
Diffstat (limited to 'qa/qa/tools/reliable_report.rb')
-rw-r--r--qa/qa/tools/reliable_report.rb30
1 files changed, 4 insertions, 26 deletions
diff --git a/qa/qa/tools/reliable_report.rb b/qa/qa/tools/reliable_report.rb
index 27e54c2d8bf..96e5690ce30 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
@@ -58,7 +56,7 @@ module QA
{
title: "Reliable e2e test report",
description: report_issue_body,
- labels: "Quality,test,type::maintenance,reliable test report,automation:devops-mapping-disable"
+ labels: "Quality,test,type::maintenance,reliable test report,automation:ml"
},
headers: { "PRIVATE-TOKEN" => gitlab_access_token }
)
@@ -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]