gitlab_quality-test_tooling 1.18.0 → 1.19.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/exe/generate-test-session +1 -1
- data/lefthook.yml +2 -1
- data/lib/gitlab_quality/test_tooling/concerns/find_set_dri.rb +22 -9
- data/lib/gitlab_quality/test_tooling/report/relate_failure_issue.rb +1 -1
- data/lib/gitlab_quality/test_tooling/test_meta/processor/add_to_blocking_processor.rb +2 -1
- data/lib/gitlab_quality/test_tooling/test_meta/test_meta_updater.rb +2 -2
- data/lib/gitlab_quality/test_tooling/test_result/base_test_result.rb +4 -0
- data/lib/gitlab_quality/test_tooling/test_result/json_test_result.rb +4 -0
- data/lib/gitlab_quality/test_tooling/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: beeb1678e873990d65b474eeda84dd957becfa69e7868d83d9db5394aa9e71be
|
4
|
+
data.tar.gz: 8a932d572750522124c0fa24950db55a1d9e5de66e476cde0f1c17a7fb16f9d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a5bf865481746bcf4e54d10e2b19b5b8ac63aefb151eb285b47566aae82e3fcf7d30ccd90603bc8a44c3fa06996f4a6bc3486575fe6aa002cf596f4e5bd0e366
|
7
|
+
data.tar.gz: bc1857f7fbf20040a2c4c0e4c696b3d31410b07b664f5aedcc2a5535d8c5e1ec1e5e52b8dda6fe906b1253ba218615cfbe9cb2234c130de27f3d605e8979fcff
|
data/Gemfile.lock
CHANGED
data/exe/generate-test-session
CHANGED
@@ -31,7 +31,7 @@ options = OptionParser.new do |opts|
|
|
31
31
|
params[:issue_url_file] = issue_url_file
|
32
32
|
end
|
33
33
|
|
34
|
-
opts.on('--pipeline-stages STAGES',
|
34
|
+
opts.on('--pipeline-stages STAGES', String, 'Comma-separated list of pipeline stages to include in test session issue') do |pipeline_stages|
|
35
35
|
params[:pipeline_stages] = pipeline_stages.split(',')
|
36
36
|
end
|
37
37
|
|
data/lefthook.yml
CHANGED
@@ -17,7 +17,8 @@ pre-push:
|
|
17
17
|
# Changelog git trailer for the first commit of the branch
|
18
18
|
changelog-on-first-commit:
|
19
19
|
run: |
|
20
|
-
|
20
|
+
git fetch origin main
|
21
|
+
first_commit_message=$(git log --format=%B -n 1 $(git log origin/main..HEAD --pretty=format:"%h" | tail -1))
|
21
22
|
if ! echo ${first_commit_message} | grep "Changelog:"; then
|
22
23
|
echo Could not find a Changelog: git trailer on the first commit for this branch.
|
23
24
|
echo
|
@@ -6,19 +6,23 @@ module GitlabQuality
|
|
6
6
|
module TestTooling
|
7
7
|
module Concerns
|
8
8
|
module FindSetDri
|
9
|
-
def
|
9
|
+
def test_dri(product_group, stage, section)
|
10
10
|
parse_json_with_sets
|
11
|
+
fetch_section_sets(section)
|
11
12
|
fetch_stage_sets(stage)
|
12
|
-
|
13
|
-
return @sets.sample['username'] if @stage_sets.empty?
|
14
|
-
|
15
13
|
fetch_group_sets(product_group)
|
16
14
|
|
17
|
-
if @group_sets.
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
15
|
+
set_dris = if @group_sets.any?
|
16
|
+
@group_sets
|
17
|
+
elsif @stage_sets.any?
|
18
|
+
@stage_sets
|
19
|
+
elsif @section_sets.any?
|
20
|
+
@section_sets
|
21
|
+
else
|
22
|
+
@sets
|
23
|
+
end
|
24
|
+
|
25
|
+
set_dris.sample['username']
|
22
26
|
end
|
23
27
|
|
24
28
|
private
|
@@ -30,6 +34,15 @@ module GitlabQuality
|
|
30
34
|
@sets = JSON.parse(response.body).select { |user| user['role'].include?('software-engineer-in-test') }
|
31
35
|
end
|
32
36
|
|
37
|
+
def fetch_section_sets(section)
|
38
|
+
@section_sets = []
|
39
|
+
return if section.nil?
|
40
|
+
|
41
|
+
@section_sets = @sets.select do |user|
|
42
|
+
user['role'].include?(section.split("_").map(&:capitalize).join(" "))
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
33
46
|
def fetch_stage_sets(stage)
|
34
47
|
@stage_sets = @sets.select do |user|
|
35
48
|
user['role'].include?(stage.split("_").map(&:capitalize).join(" "))
|
@@ -328,7 +328,7 @@ module GitlabQuality
|
|
328
328
|
def new_issue_assignee_id(test)
|
329
329
|
return unless test.product_group?
|
330
330
|
|
331
|
-
dri =
|
331
|
+
dri = test_dri(test.product_group, test.stage, test.section)
|
332
332
|
puts " => Assigning #{dri} as DRI for the issue."
|
333
333
|
|
334
334
|
gitlab.find_user_id(username: dri)
|
@@ -17,6 +17,7 @@ module GitlabQuality
|
|
17
17
|
@existing_mrs = nil
|
18
18
|
@file_path = spec["file_path"]
|
19
19
|
testcase = spec["testcase"]
|
20
|
+
product_section = spec["section"]
|
20
21
|
devops_stage = spec["stage"]
|
21
22
|
product_group = spec["product_group"]
|
22
23
|
@example_name = spec["name"]
|
@@ -36,7 +37,7 @@ module GitlabQuality
|
|
36
37
|
#{"Promote to blocking: #{example_name}".truncate(72)}
|
37
38
|
COMMIT_MESSAGE
|
38
39
|
|
39
|
-
reviewer_id, assignee_handle = context.fetch_dri_id(product_group, devops_stage)
|
40
|
+
reviewer_id, assignee_handle = context.fetch_dri_id(product_group, devops_stage, product_section)
|
40
41
|
|
41
42
|
gitlab_bot_user_id = context.user_id_for_username(Runtime::Env.gitlab_bot_username)
|
42
43
|
|
@@ -190,8 +190,8 @@ module GitlabQuality
|
|
190
190
|
# @param [String] product_group
|
191
191
|
# @param [String] devops_stage
|
192
192
|
# @return [Array<Integer, String>]
|
193
|
-
def fetch_dri_id(product_group, devops_stage)
|
194
|
-
assignee_handle = ENV.fetch('QA_TEST_DRI_HANDLE', nil) ||
|
193
|
+
def fetch_dri_id(product_group, devops_stage, section)
|
194
|
+
assignee_handle = ENV.fetch('QA_TEST_DRI_HANDLE', nil) || test_dri(product_group, devops_stage, section)
|
195
195
|
|
196
196
|
[user_id_for_username(assignee_handle), assignee_handle]
|
197
197
|
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.
|
4
|
+
version: 1.19.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-03-
|
11
|
+
date: 2024-03-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: climate_control
|