gitlab_quality-test_tooling 2.21.0 → 2.22.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a5d7cbba0261ebfecefff8f84b388d3d238c4126ee183897ab63349f4995888a
4
- data.tar.gz: 3210de6e92566a315e3bf1b07a7cd8c37e883c073a021f51cdcc5582f357e0d6
3
+ metadata.gz: 9bc3f79d2fd78c6d8fd1ee931c50f126e8aa2c91a0608b6e3675605fffa5dd5e
4
+ data.tar.gz: a80d4658c0781ec47d880b6dbf0166eb97f64742ce4e468ef86f9bc3e1e7615c
5
5
  SHA512:
6
- metadata.gz: f4b180f20e75823e25737977cc545fd04adb46f91dd5029723d29d663b51876ac0be5f4d867bdbef20870d020d5d6ef36e7375d6c67fbfab10807c1ded2b9f42
7
- data.tar.gz: c9f09041698d0a08032eb20b5ad26133e381d52315108f86c838b7b32bfb62d3db08a276037d7224addfb44f1779146f1ce1192fe51083075d1ca56f1104e6b5
6
+ metadata.gz: bb3d6fde7d83295c03059558525e6e4722416cd87dcf5e8a72c0b8f673dc384e08012d18aaed88877febd22cd400f039a24fb977ebbba985d0774e940b12f24e
7
+ data.tar.gz: 4cd6cee22b30f7cc1bd6c6291f55c0ba6026d4688b04c00b054cbcb3598054e8a5f696758b7e23adad1853ae9222802ebe22179baea96027be0b88a4598d5b5b
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gitlab_quality-test_tooling (2.21.0)
4
+ gitlab_quality-test_tooling (2.22.0)
5
5
  activesupport (>= 7.0, < 7.3)
6
6
  amatch (~> 0.4.1)
7
7
  fog-google (~> 1.24, >= 1.24.1)
@@ -104,7 +104,6 @@ module GitlabQuality
104
104
  description: new_issue_description(test),
105
105
  labels: new_issue_labels(test).to_a,
106
106
  issue_type: issue_type,
107
- assignee_id: new_issue_assignee_id(test),
108
107
  due_date: new_issue_due_date(test),
109
108
  confidential: confidential
110
109
  }.compact
@@ -8,15 +8,19 @@ module GitlabQuality
8
8
  class Formatter < RSpec::Core::Formatters::BaseFormatter
9
9
  include Utils
10
10
 
11
- RSpec::Core::Formatters.register(self, *[:stop, Utils.config.initial_run ? :start : nil].compact)
11
+ RSpec::Core::Formatters.register(self, :start, :stop)
12
12
 
13
13
  LOG_PREFIX = "[MetricsExporter]"
14
14
 
15
15
  def start(_notification)
16
- logger.debug("#{LOG_PREFIX} Running initial setup for metrics export")
17
- return logger.warn("#{LOG_PREFIX} Initial setup is enabled, but clickhouse configuration is missing!") unless clickhouse_config
16
+ return unless config.initial_run
17
+
18
+ logger.info("#{LOG_PREFIX} Running initial setup for metrics export")
19
+ raise "Initial setup is enabled, but clickhouse configuration is missing!" unless clickhouse_config
18
20
 
19
21
  create_clickhouse_metrics_table
22
+ rescue StandardError => e
23
+ logger.error("#{LOG_PREFIX} Error occurred during initial setup: #{e.message}")
20
24
  end
21
25
 
22
26
  def stop(notification)
@@ -38,12 +42,12 @@ module GitlabQuality
38
42
 
39
43
  # Single common timestamp for all exported example metrics to keep data points consistently grouped
40
44
  #
41
- # @return [Time]
45
+ # @return [String]
42
46
  def time
43
47
  return @time if @time
44
48
 
45
49
  ci_created_at = Runtime::Env.ci_pipeline_created_at
46
- @time = ci_created_at ? Time.strptime(ci_created_at, '%Y-%m-%dT%H:%M:%S%z') : Time.now.utc
50
+ @time = (ci_created_at ? Time.strptime(ci_created_at, '%Y-%m-%dT%H:%M:%S%z') : Time.now.utc).strftime('%Y-%m-%dT%H:%M:%S.%6N')
47
51
  end
48
52
 
49
53
  # Push data to gcs
@@ -16,7 +16,7 @@ module GitlabQuality
16
16
  # @return [Hash]
17
17
  def data
18
18
  {
19
- time: timestamp,
19
+ timestamp: timestamp,
20
20
  **rspec_metrics,
21
21
  **ci_metrics,
22
22
  **custom_metrics
@@ -50,7 +50,8 @@ module GitlabQuality
50
50
  failure_exception: failure_exception,
51
51
  quarantined: quarantined?,
52
52
  feature_category: example.metadata[:feature_category] || "",
53
- test_retried: config.test_retried_proc.call(example)
53
+ test_retried: config.test_retried_proc.call(example),
54
+ run_type: run_type
54
55
  }
55
56
  end
56
57
 
@@ -64,6 +64,7 @@ module GitlabQuality
64
64
  quarantined Bool,
65
65
  test_retried Bool,
66
66
  feature_category LowCardinality(String) DEFAULT '',
67
+ run_type LowCardinality(String) DEFAULT 'unknown',
67
68
  ci_project_id UInt32,
68
69
  ci_job_name LowCardinality(String),
69
70
  ci_job_id UInt64,
@@ -77,7 +78,7 @@ module GitlabQuality
77
78
  )
78
79
  ENGINE = MergeTree()
79
80
  PARTITION BY toYYYYMM(timestamp)
80
- ORDER BY (ci_project_path, timestamp, status, feature_category, file_path, ci_pipeline_id)
81
+ ORDER BY (ci_project_path, timestamp, run_type, status, feature_category, file_path, ci_pipeline_id)
81
82
  SETTINGS index_granularity = 8192;
82
83
  SQL
83
84
  return if config.extra_metadata_columns.empty?
@@ -2,6 +2,6 @@
2
2
 
3
3
  module GitlabQuality
4
4
  module TestTooling
5
- VERSION = "2.21.0"
5
+ VERSION = "2.22.0"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitlab_quality-test_tooling
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.21.0
4
+ version: 2.22.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GitLab Quality
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-10-10 00:00:00.000000000 Z
11
+ date: 2025-10-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: climate_control