gitlab_quality-test_tooling 2.19.1 → 2.20.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. checksums.yaml +4 -4
  2. data/.ruby-version +1 -1
  3. data/.tool-versions +1 -1
  4. data/Gemfile.lock +30 -28
  5. data/exe/epic-readiness-notification +58 -0
  6. data/lib/gitlab_quality/test_tooling/click_house/client.rb +85 -0
  7. data/lib/gitlab_quality/test_tooling/feature_readiness/concerns/issue_concern.rb +1 -1
  8. data/lib/gitlab_quality/test_tooling/feature_readiness/concerns/work_item_concern.rb +11 -0
  9. data/lib/gitlab_quality/test_tooling/feature_readiness/epic_readiness_notifier.rb +308 -0
  10. data/lib/gitlab_quality/test_tooling/gcs_tools.rb +49 -0
  11. data/lib/gitlab_quality/test_tooling/gitlab_client/group_labels_client.rb +34 -0
  12. data/lib/gitlab_quality/test_tooling/report/generate_test_session.rb +1 -1
  13. data/lib/gitlab_quality/test_tooling/report/health_problem_reporter.rb +3 -3
  14. data/lib/gitlab_quality/test_tooling/report/merge_request_slow_tests_report.rb +2 -6
  15. data/lib/gitlab_quality/test_tooling/runtime/env.rb +5 -3
  16. data/lib/gitlab_quality/test_tooling/system_logs/finders/rails/api_log_finder.rb +1 -1
  17. data/lib/gitlab_quality/test_tooling/system_logs/finders/rails/application_log_finder.rb +1 -1
  18. data/lib/gitlab_quality/test_tooling/system_logs/finders/rails/exception_log_finder.rb +1 -1
  19. data/lib/gitlab_quality/test_tooling/system_logs/finders/rails/graphql_log_finder.rb +1 -1
  20. data/lib/gitlab_quality/test_tooling/test_meta/test_meta_updater.rb +2 -2
  21. data/lib/gitlab_quality/test_tooling/test_metrics_exporter/config.rb +88 -15
  22. data/lib/gitlab_quality/test_tooling/test_metrics_exporter/formatter.rb +71 -34
  23. data/lib/gitlab_quality/test_tooling/test_metrics_exporter/test_metrics.rb +105 -80
  24. data/lib/gitlab_quality/test_tooling/version.rb +1 -1
  25. metadata +58 -55
  26. data/lib/gitlab_quality/test_tooling/test_metrics_exporter/log_test_metrics.rb +0 -117
  27. data/lib/gitlab_quality/test_tooling/test_metrics_exporter/support/gcs_tools.rb +0 -49
  28. data/lib/gitlab_quality/test_tooling/test_metrics_exporter/support/influxdb_tools.rb +0 -33
@@ -1,49 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'fog/google'
4
-
5
- module GitlabQuality
6
- module TestTooling
7
- module TestMetricsExporter
8
- module Support
9
- module GcsTools
10
- # GCS Client
11
- #
12
- # @param project_id [String]
13
- # @param credentials [String]
14
- # @return [Fog::Storage::Google]
15
- def gcs_client(project_id:, credentials:, dry_run: false)
16
- if dry_run
17
- GCSMockClient.new
18
- else
19
- Fog::Storage::Google.new(
20
- google_project: project_id || raise("Missing Google project_id"),
21
- **gcs_creds(credentials)
22
- )
23
- end
24
- end
25
-
26
- # GCS Credentials
27
- #
28
- # @param credentials [String]
29
- # @return [Hash]
30
- def gcs_creds(credentials)
31
- json_key = credentials || raise('Missing Google credentials')
32
- return { google_json_key_location: json_key } if File.exist?(json_key)
33
-
34
- { google_json_key_string: json_key }
35
- end
36
-
37
- class GCSMockClient
38
- def initialize(*_args, **_kwargs); end
39
-
40
- def put_object(gcs_bucket, filename, data, **_kwargs)
41
- Runtime::Logger.info "The #{filename} file would have been pushed to the #{gcs_bucket} bucket, with this content:"
42
- Runtime::Logger.info data
43
- end
44
- end
45
- end
46
- end
47
- end
48
- end
49
- end
@@ -1,33 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'influxdb-client'
4
-
5
- module GitlabQuality
6
- module TestTooling
7
- module TestMetricsExporter
8
- module Support
9
- module InfluxdbTools
10
- # InfluxDb client
11
- #
12
- # @return [InfluxDB2::Client]
13
- def influx_client(url:, token:, bucket:)
14
- @influx_client ||= InfluxDB2::Client.new(
15
- url || raise('Missing influxdb_url'),
16
- token || raise('Missing influxdb_token'),
17
- bucket: bucket || raise('Missing influxdb_bucket'),
18
- org: "gitlab-qa",
19
- precision: InfluxDB2::WritePrecision::NANOSECOND
20
- )
21
- end
22
-
23
- # Write client
24
- #
25
- # @return [WriteApi]
26
- def write_api(url:, token:, bucket:)
27
- @write_api ||= influx_client(url: url, token: token, bucket: bucket).create_write_api
28
- end
29
- end
30
- end
31
- end
32
- end
33
- end