gitlab_quality-test_tooling 1.37.0 → 1.38.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6cad17948e73dda3f8281aaedb34969d1178904f4951e54034b38438c473baa8
4
- data.tar.gz: 49d38db27d6617815fcec94ebce2610f6ac47faec14f622cf58f2baaae6add55
3
+ metadata.gz: 39af6264618a95cb389713ce1fa38e7386848626ec7491dc6f4d5f526728f6e8
4
+ data.tar.gz: a8264409db390f6a45628b82f60a25b8f4a8b6a0180724a9056f2be6c5638041
5
5
  SHA512:
6
- metadata.gz: 22e114b48a3260dc61887d5bea9efd7574e4584d0a85fa452574ff89eab73ab26b287c83303997c8696331a11748a80d58e51ade1729fd646aa8a32ff69909b3
7
- data.tar.gz: 5937ae1ed046b9cc123e5d7c2157cc809bb4edffd35189a89aec90bd95f947bc9026960c806783c9f809918f469fb27961ac938bb46a2a73e94d0341a726986a
6
+ metadata.gz: 229f678831833845a88c115a422f4a831c77ce0805b0c5d1c9f8f55575441805de51f232c29e54081f3eea80bf3846152cf7826df3d211bc38827dcbd2dbdcf8
7
+ data.tar.gz: 8ef70e8ee6dfed9c6299cf39682856c9b75ca3e03a9bbccf17c3ce4fc29059e51730ee2bbe2751d8053819efe05032f8a7855aef6c37f65ebca05dc299010b38
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gitlab_quality-test_tooling (1.37.0)
4
+ gitlab_quality-test_tooling (1.38.1)
5
5
  activesupport (>= 7.0, < 7.2)
6
6
  amatch (~> 0.4.1)
7
7
  fog-google (~> 1.24, >= 1.24.1)
@@ -58,7 +58,7 @@ module GitlabQuality
58
58
  end
59
59
 
60
60
  def health_problem_status_label_quick_action(reports_list)
61
- '/label ~"severity::1"' if reports_list.spiked_in_short_period?
61
+ '/label ~"priority::1" ~"severity::1"' if reports_list.spiked_in_short_period?
62
62
  end
63
63
 
64
64
  def up_to_date_labels(test:, issue: nil, new_labels: Set.new)
@@ -100,13 +100,15 @@ module GitlabQuality
100
100
  puts "Reporting tests in `#{files.join(',')}` as issues in project `#{project}` via the API at `#{Runtime::Env.gitlab_api_base}`."
101
101
 
102
102
  TestResults::Builder.new(file_glob: files, token: token, project: project).test_results_per_file do |test_results|
103
- puts "=> Reporting #{test_results.count} tests in #{test_results.path}"
103
+ puts "=> Processing #{test_results.count} tests in #{test_results.path}"
104
104
 
105
105
  process_test_results(test_results)
106
106
  end
107
107
  end
108
108
 
109
109
  def process_test_results(test_results)
110
+ reported_test_count = 0
111
+
110
112
  test_results.each do |test|
111
113
  next unless test_is_applicable?(test)
112
114
 
@@ -123,7 +125,10 @@ module GitlabQuality
123
125
 
124
126
  update_reports(issues, test)
125
127
  collect_issues(test, issues)
128
+ reported_test_count += 1
126
129
  end
130
+
131
+ puts " => Reported #{reported_test_count} #{problem_type} tests."
127
132
  end
128
133
 
129
134
  def update_reports(issues, test)
@@ -8,6 +8,7 @@ module GitlabQuality
8
8
  BLOCKING_METADATA = ", :blocking%{suffix}"
9
9
  BRANCH_PREFIX = 'blocking-promotion'
10
10
 
11
+ MAX_LINE_LENGTH = 120
11
12
  class << self
12
13
  # Creates the merge requests for promoting E2E tests to :blocking
13
14
  #
@@ -137,6 +138,17 @@ module GitlabQuality
137
138
  line[line.rindex(' ')] = format(BLOCKING_METADATA, suffix: ' ')
138
139
  end
139
140
 
141
+ check_line_length(line)
142
+ end
143
+ end
144
+
145
+ # Add new line character and indentation if line length is greater than MAX_LINE_LENGTH
146
+ #
147
+ # @return [String]
148
+ def check_line_length(line)
149
+ if line.length > MAX_LINE_LENGTH
150
+ line.gsub(' :blocking', "\n#{context.indentation(line)}:blocking")
151
+ else
140
152
  line
141
153
  end
142
154
  end
@@ -28,7 +28,7 @@ module GitlabQuality
28
28
 
29
29
  contents['specs'].each do |spec|
30
30
  processor.create_commit(spec, self)
31
- break if processed_commits.keys.count >= ENV.fetch('BATCH_LIMIT', 10)
31
+ break if processed_commits.keys.count >= batch_limit
32
32
  end
33
33
 
34
34
  processor.create_merge_requests(self)
@@ -37,6 +37,13 @@ module GitlabQuality
37
37
  end
38
38
  end
39
39
 
40
+ # Returns the number of records to process
41
+ #
42
+ # @return [Integer]
43
+ def batch_limit
44
+ ENV.fetch('BATCH_LIMIT', 10).to_i
45
+ end
46
+
40
47
  # Add processed commits.
41
48
  #
42
49
  # processed_commits has the following form. Note that each key in the :commits hash
@@ -297,7 +304,7 @@ module GitlabQuality
297
304
  (dry_run ? GitlabQuality::TestTooling::Slack::PostToSlackDry : GitlabQuality::TestTooling::Slack::PostToSlack).new(**slack_options).invoke!
298
305
  end
299
306
 
300
- # Provide indentaiton based on the given line
307
+ # Provide indentation based on the given line
301
308
  #
302
309
  # @param[String] line the line to use for indentation
303
310
  # @return[String] indentation
@@ -2,6 +2,6 @@
2
2
 
3
3
  module GitlabQuality
4
4
  module TestTooling
5
- VERSION = "1.37.0"
5
+ VERSION = "1.38.1"
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: 1.37.0
4
+ version: 1.38.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - GitLab Quality
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-08-30 00:00:00.000000000 Z
11
+ date: 2024-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: climate_control