lazylead 0.11.4 → 0.13.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.0pdd.yml +3 -0
- data/.circleci/config.yml +0 -12
- data/.docs/accuracy.sql +35 -0
- data/.github/workflows/build.yml +39 -0
- data/.github/workflows/release.yml +15 -0
- data/.rubocop.yml +11 -2
- data/.rultor.yml +2 -2
- data/Gemfile +1 -1
- data/Rakefile +17 -9
- data/bin/lazylead +5 -5
- data/lazylead.gemspec +22 -25
- data/lib/lazylead/allocated.rb +1 -1
- data/lib/lazylead/cc.rb +1 -1
- data/lib/lazylead/cli/app.rb +3 -3
- data/lib/lazylead/confluence.rb +4 -3
- data/lib/lazylead/email.rb +1 -1
- data/lib/lazylead/exchange.rb +3 -3
- data/lib/lazylead/home.rb +2 -2
- data/lib/lazylead/log.rb +1 -1
- data/lib/lazylead/model.rb +4 -3
- data/lib/lazylead/opts.rb +1 -1
- data/lib/lazylead/os.rb +2 -1
- data/lib/lazylead/postman.rb +8 -7
- data/lib/lazylead/requires.rb +1 -1
- data/lib/lazylead/salt.rb +1 -1
- data/lib/lazylead/schedule.rb +5 -9
- data/lib/lazylead/smtp.rb +1 -1
- data/lib/lazylead/system/empty.rb +1 -1
- data/lib/lazylead/system/fake.rb +1 -1
- data/lib/lazylead/system/jira.rb +5 -3
- data/lib/lazylead/system/synced.rb +1 -1
- data/lib/lazylead/task/accuracy/accuracy.rb +3 -3
- data/lib/lazylead/task/accuracy/affected_build.rb +1 -1
- data/lib/lazylead/task/accuracy/attachment.rb +1 -1
- data/lib/lazylead/task/accuracy/environment.rb +1 -1
- data/lib/lazylead/task/accuracy/has_label.rb +1 -1
- data/lib/lazylead/task/accuracy/logs.rb +1 -1
- data/lib/lazylead/task/accuracy/logs_link.rb +1 -1
- data/lib/lazylead/task/accuracy/memes.rb +1 -1
- data/lib/lazylead/task/accuracy/onlyll.rb +1 -1
- data/lib/lazylead/task/accuracy/records.rb +9 -2
- data/lib/lazylead/task/accuracy/records_link.rb +1 -1
- data/lib/lazylead/task/accuracy/required.rb +1 -1
- data/lib/lazylead/task/accuracy/requirement.rb +1 -1
- data/lib/lazylead/task/accuracy/screenshots.rb +1 -1
- data/lib/lazylead/task/accuracy/servers.rb +1 -1
- data/lib/lazylead/task/accuracy/stacktrace.rb +2 -2
- data/lib/lazylead/task/accuracy/testcase.rb +1 -1
- data/lib/lazylead/task/accuracy/wiki.rb +1 -1
- data/lib/lazylead/task/accuracy/wiki_url.rb +1 -1
- data/lib/lazylead/task/alert/alert.rb +1 -1
- data/lib/lazylead/task/alert/alertif.rb +1 -1
- data/lib/lazylead/task/alert/changed_to.rb +1 -1
- data/lib/lazylead/task/assignment.rb +1 -1
- data/lib/lazylead/task/confluence_ref.rb +1 -1
- data/lib/lazylead/task/echo.rb +2 -2
- data/lib/lazylead/task/fix_version.rb +1 -1
- data/lib/lazylead/task/git/git.rb +82 -0
- data/lib/lazylead/task/loading.rb +2 -3
- data/lib/lazylead/task/micromanager.rb +1 -1
- data/lib/lazylead/task/missing_comment.rb +1 -1
- data/lib/lazylead/task/propagate_down.rb +3 -3
- data/lib/lazylead/task/savepoint.rb +1 -1
- data/lib/lazylead/task/svn/diff.rb +1 -1
- data/lib/lazylead/task/svn/grep.rb +1 -1
- data/lib/lazylead/task/svn/svn.rb +1 -1
- data/lib/lazylead/task/svn/touch.rb +42 -14
- data/lib/lazylead/version.rb +2 -2
- data/lib/lazylead.rb +1 -1
- data/license.txt +1 -1
- data/readme.md +20 -15
- data/test/lazylead/allocated_test.rb +1 -1
- data/test/lazylead/cc_test.rb +7 -7
- data/test/lazylead/cli/app_test.rb +1 -1
- data/test/lazylead/confluence_test.rb +1 -1
- data/test/lazylead/exchange_test.rb +10 -10
- data/test/lazylead/file_postman_test.rb +47 -0
- data/test/lazylead/model_test.rb +2 -2
- data/test/lazylead/opts_test.rb +1 -1
- data/test/lazylead/postman_test.rb +7 -39
- data/test/lazylead/retry_test.rb +12 -1
- data/test/lazylead/salt_test.rb +1 -1
- data/test/lazylead/smoke_test.rb +2 -2
- data/test/lazylead/smtp_test.rb +7 -7
- data/test/lazylead/stdout_postman_test.rb +48 -0
- data/test/lazylead/system/jira_test.rb +53 -54
- data/test/lazylead/task/accuracy/accuracy_test.rb +11 -11
- data/test/lazylead/task/accuracy/affected_build_test.rb +1 -1
- data/test/lazylead/task/accuracy/attachment_test.rb +4 -4
- data/test/lazylead/task/accuracy/environment_test.rb +1 -1
- data/test/lazylead/task/accuracy/has_label_test.rb +1 -1
- data/test/lazylead/task/accuracy/logs_link_test.rb +1 -1
- data/test/lazylead/task/accuracy/logs_test.rb +1 -1
- data/test/lazylead/task/accuracy/memes_test.rb +1 -1
- data/test/lazylead/task/accuracy/onlyll_test.rb +21 -21
- data/test/lazylead/task/accuracy/records_llink_test.rb +1 -1
- data/test/lazylead/task/accuracy/records_test.rb +35 -12
- data/test/lazylead/task/accuracy/score_test.rb +4 -4
- data/test/lazylead/task/accuracy/screenshots_test.rb +3 -3
- data/test/lazylead/task/accuracy/servers_test.rb +1 -1
- data/test/lazylead/task/accuracy/stacktrace_test.rb +1 -1
- data/test/lazylead/task/accuracy/testcase_test.rb +1 -1
- data/test/lazylead/task/accuracy/wiki_test.rb +1 -1
- data/test/lazylead/task/accuracy/wiki_url_test.rb +1 -1
- data/test/lazylead/task/alert/alertif_test.rb +5 -5
- data/test/lazylead/task/alert/assignee_alert_test.rb +1 -1
- data/test/lazylead/task/alert/changed_to_test.rb +5 -5
- data/test/lazylead/task/assignment_test.rb +5 -5
- data/test/lazylead/task/confluence_ref_test.rb +8 -8
- data/test/lazylead/task/created_recently_test.rb +4 -4
- data/test/lazylead/task/duedate_test.rb +14 -14
- data/test/lazylead/task/echo_test.rb +1 -1
- data/test/lazylead/task/fix_version_test.rb +6 -5
- data/test/lazylead/task/loading_test.rb +7 -7
- data/test/lazylead/task/micromanager_test.rb +5 -5
- data/test/lazylead/task/missing_comment_test.rb +4 -4
- data/test/lazylead/task/propagate_down_test.rb +1 -1
- data/test/lazylead/task/savepoint_test.rb +1 -1
- data/test/lazylead/task/svn/diff_test.rb +14 -15
- data/test/lazylead/task/svn/grep_test.rb +4 -3
- data/test/lazylead/task/svn/touch_test.rb +74 -6
- data/test/lazylead/version_test.rb +1 -1
- data/test/sqlite_test.rb +1 -1
- data/test/test.rb +10 -3
- metadata +49 -107
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# The MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2019-
|
5
|
+
# Copyright (c) 2019-2022 Yurii Dubinka
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"),
|
@@ -31,9 +31,9 @@ require_relative "../../../lib/lazylead/system/jira"
|
|
31
31
|
module Lazylead
|
32
32
|
class JiraTest < Lazylead::Test
|
33
33
|
test "found issue by id" do
|
34
|
-
assert_equal "
|
35
|
-
NoAuthJira.new("https://jira.
|
36
|
-
.issues("key in ('
|
34
|
+
assert_equal "JAVA-150",
|
35
|
+
NoAuthJira.new("https://jira.mongodb.org")
|
36
|
+
.issues("key in ('JAVA-150')")
|
37
37
|
.first
|
38
38
|
.key
|
39
39
|
end
|
@@ -46,20 +46,20 @@ module Lazylead
|
|
46
46
|
vcs4sql: "upgrades/sqlite",
|
47
47
|
testdata: true
|
48
48
|
)
|
49
|
-
assert_equal "
|
49
|
+
assert_equal "JAVA-150",
|
50
50
|
ORM::Task.find(4)
|
51
51
|
.system
|
52
52
|
.connect
|
53
|
-
.issues("key in ('
|
53
|
+
.issues("key in ('JAVA-150')")
|
54
54
|
.first
|
55
55
|
.key,
|
56
|
-
"Id mismatch for https://jira.
|
56
|
+
"Id mismatch for https://jira.mongodb.org/browse/JAVA-150"
|
57
57
|
end
|
58
58
|
|
59
59
|
test "group by assignee" do
|
60
60
|
assert_equal 2,
|
61
|
-
NoAuthJira.new("https://jira.
|
62
|
-
.issues("filter=
|
61
|
+
NoAuthJira.new("https://jira.mongodb.org")
|
62
|
+
.issues("filter=46202")
|
63
63
|
.group_by(&:assignee)
|
64
64
|
.min_by { |a| a.first.id }
|
65
65
|
.length,
|
@@ -67,58 +67,58 @@ module Lazylead
|
|
67
67
|
end
|
68
68
|
|
69
69
|
test "issue reporter fetched successfully" do
|
70
|
-
assert_equal "
|
71
|
-
NoAuthJira.new("https://jira.
|
72
|
-
.issues("key in ('
|
70
|
+
assert_equal "Joseph Wang",
|
71
|
+
NoAuthJira.new("https://jira.mongodb.org")
|
72
|
+
.issues("key in ('JAVA-150')")
|
73
73
|
.first
|
74
74
|
.reporter
|
75
75
|
.name
|
76
76
|
end
|
77
77
|
|
78
78
|
test "issue url fetched successfully" do
|
79
|
-
assert_equal "https://jira.
|
80
|
-
NoAuthJira.new("https://jira.
|
81
|
-
.issues("key in ('
|
79
|
+
assert_equal "https://jira.mongodb.org/browse/JAVA-150",
|
80
|
+
NoAuthJira.new("https://jira.mongodb.org")
|
81
|
+
.issues("key in ('JAVA-150')")
|
82
82
|
.first
|
83
83
|
.url
|
84
84
|
end
|
85
85
|
|
86
86
|
test "issue history found" do
|
87
|
-
greater_or_eq
|
88
|
-
NoAuthJira.new("https://jira.
|
89
|
-
.issues("key='
|
87
|
+
greater_or_eq 10,
|
88
|
+
NoAuthJira.new("https://jira.mongodb.org")
|
89
|
+
.issues("key='JAVA-150'", expand: "changelog")
|
90
90
|
.first
|
91
91
|
.history
|
92
92
|
.size
|
93
93
|
end
|
94
94
|
|
95
95
|
test "issue history not found" do
|
96
|
-
assert_empty NoAuthJira.new("https://jira.
|
97
|
-
.issues("key='
|
96
|
+
assert_empty NoAuthJira.new("https://jira.mongodb.org")
|
97
|
+
.issues("key='JAVA-150'")
|
98
98
|
.first
|
99
99
|
.history
|
100
100
|
end
|
101
101
|
|
102
102
|
test "2nd issue history item is correct" do
|
103
|
-
assert_equal "
|
104
|
-
NoAuthJira.new("https://jira.
|
105
|
-
.issues("key='
|
103
|
+
assert_equal "24893",
|
104
|
+
NoAuthJira.new("https://jira.mongodb.org")
|
105
|
+
.issues("key='JAVA-150'", expand: "changelog")
|
106
106
|
.first
|
107
107
|
.history[2]["id"]
|
108
108
|
end
|
109
109
|
|
110
110
|
test "issue has expected status" do
|
111
111
|
assert_equal "Closed",
|
112
|
-
NoAuthJira.new("https://jira.
|
113
|
-
.issues("key='
|
112
|
+
NoAuthJira.new("https://jira.mongodb.org")
|
113
|
+
.issues("key='JAVA-150'")
|
114
114
|
.first
|
115
115
|
.status
|
116
116
|
end
|
117
117
|
|
118
118
|
test "issue has 1 field" do
|
119
119
|
assert_equal 1,
|
120
|
-
NoAuthJira.new("https://jira.
|
121
|
-
.issues("key='
|
120
|
+
NoAuthJira.new("https://jira.mongodb.org")
|
121
|
+
.issues("key='JAVA-150'", fields: ["summary"])
|
122
122
|
.first
|
123
123
|
.fields
|
124
124
|
.size
|
@@ -143,47 +143,46 @@ module Lazylead
|
|
143
143
|
end
|
144
144
|
|
145
145
|
test "description is correct" do
|
146
|
-
assert_words ["
|
147
|
-
NoAuthJira.new("https://jira.
|
148
|
-
.issues("key=
|
146
|
+
assert_words ["We've multiple colos"],
|
147
|
+
NoAuthJira.new("https://jira.mongodb.org")
|
148
|
+
.issues("key=JAVA-150")
|
149
149
|
.first
|
150
150
|
.description
|
151
151
|
end
|
152
152
|
|
153
153
|
test "component is correct" do
|
154
|
-
assert_equal ["
|
155
|
-
NoAuthJira.new("https://jira.
|
156
|
-
.issues("key=
|
154
|
+
assert_equal ["GridFS"],
|
155
|
+
NoAuthJira.new("https://jira.mongodb.org")
|
156
|
+
.issues("key=JAVA-192")
|
157
157
|
.first
|
158
158
|
.components
|
159
159
|
end
|
160
160
|
|
161
|
-
test "field
|
162
|
-
assert_includes NoAuthJira.new("https://jira.
|
163
|
-
.issues("key=
|
161
|
+
test "description available as field" do
|
162
|
+
assert_includes NoAuthJira.new("https://jira.mongodb.org")
|
163
|
+
.issues("key=JAVA-192")
|
164
164
|
.first["description"],
|
165
|
-
"
|
165
|
+
".files.drop() + .chunks.drop()"
|
166
166
|
end
|
167
167
|
|
168
168
|
test "field not found" do
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
.blank?
|
169
|
+
assert_predicate NoAuthJira.new("https://jira.mongodb.org")
|
170
|
+
.issues("key=JAVA-150")
|
171
|
+
.first["absent field"], :blank?
|
173
172
|
end
|
174
173
|
|
175
174
|
test "labels found" do
|
176
|
-
assert_includes NoAuthJira.new("https://jira.
|
177
|
-
.issues("key=
|
175
|
+
assert_includes NoAuthJira.new("https://jira.mongodb.org")
|
176
|
+
.issues("key=JAVA-295")
|
178
177
|
.first
|
179
178
|
.labels,
|
180
|
-
"
|
179
|
+
"android"
|
181
180
|
end
|
182
181
|
|
183
182
|
test "bulk search in few iterations" do
|
184
183
|
assert_equal 3,
|
185
|
-
NoAuthJira.new("https://jira.
|
186
|
-
.issues("key>
|
184
|
+
NoAuthJira.new("https://jira.mongodb.org")
|
185
|
+
.issues("key>JAVA-150 and key < JAVA-154", max_results: 1)
|
187
186
|
.size
|
188
187
|
end
|
189
188
|
|
@@ -191,23 +190,23 @@ module Lazylead
|
|
191
190
|
refute_empty Jira.new(
|
192
191
|
"username" => nil,
|
193
192
|
"password" => nil,
|
194
|
-
"site" => "https://jira.
|
193
|
+
"site" => "https://jira.mongodb.org",
|
195
194
|
"context_path" => ""
|
196
|
-
).issues("key=
|
195
|
+
).issues("key=JAVA-150")
|
197
196
|
end
|
198
197
|
|
199
198
|
test "sprint is found" do
|
200
|
-
assert_equal "Sprint
|
201
|
-
NoAuthJira.new("https://jira.
|
202
|
-
.issues("key=
|
199
|
+
assert_equal "Java Sprint 25",
|
200
|
+
NoAuthJira.new("https://jira.mongodb.org")
|
201
|
+
.issues("key=JAVA-192", fields: ["customfield_10557"])
|
203
202
|
.first
|
204
|
-
.sprint("
|
203
|
+
.sprint("customfield_10557")
|
205
204
|
end
|
206
205
|
|
207
206
|
test "bulk search in few iterations with limit" do
|
208
207
|
assert_equal 3,
|
209
|
-
NoAuthJira.new("https://jira.
|
210
|
-
.issues("key >
|
208
|
+
NoAuthJira.new("https://jira.mongodb.org")
|
209
|
+
.issues("key > JAVA-150", max_results: 1, "limit" => 3)
|
211
210
|
.size
|
212
211
|
end
|
213
212
|
end
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# The MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2019-
|
5
|
+
# Copyright (c) 2019-2022 Yurii Dubinka
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"),
|
@@ -35,7 +35,7 @@ module Lazylead
|
|
35
35
|
test "detect affected build" do
|
36
36
|
Lazylead::Smtp.new.enable
|
37
37
|
Task::Accuracy.new.run(
|
38
|
-
NoAuthJira.new("https://jira.
|
38
|
+
NoAuthJira.new("https://jira.mongodb.org"),
|
39
39
|
Postman.new,
|
40
40
|
Opts.new(
|
41
41
|
"from" => "ll@fake.com",
|
@@ -54,14 +54,14 @@ module Lazylead
|
|
54
54
|
"90-100" => "https://meme.com?id=wow.gif"
|
55
55
|
}.to_json.to_s,
|
56
56
|
"docs" => "https://github.com/dgroup/lazylead/blob/master/.github/ISSUE_TEMPLATE/bug_report.md",
|
57
|
-
"jql" => "key
|
57
|
+
"jql" => "key=JAVA-151",
|
58
58
|
"max_results" => 200,
|
59
59
|
"subject" => "[LL] Raised tickets",
|
60
60
|
"template" => "lib/messages/accuracy.erb"
|
61
61
|
)
|
62
62
|
)
|
63
63
|
assert_email "[LL] Raised tickets",
|
64
|
-
"
|
64
|
+
"JAVA-151", "0.5", "100%", "Tsz Ming Wong", "Dot allowed in key names"
|
65
65
|
end
|
66
66
|
|
67
67
|
test "construct accuracy from orm" do
|
@@ -79,7 +79,7 @@ module Lazylead
|
|
79
79
|
Lazylead::Smtp.new.enable
|
80
80
|
assert_equal 1,
|
81
81
|
Task::Accuracy.new.run(
|
82
|
-
NoAuthJira.new("https://jira.
|
82
|
+
NoAuthJira.new("https://jira.mongodb.org"),
|
83
83
|
Postman.new,
|
84
84
|
Opts.new(
|
85
85
|
"from" => "ll@fake.com",
|
@@ -90,7 +90,7 @@ module Lazylead
|
|
90
90
|
"0" => "#FF4F33",
|
91
91
|
"57" => "#19DD1E"
|
92
92
|
}.to_json.to_s,
|
93
|
-
"jql" => "key >
|
93
|
+
"jql" => "key > JAVA-500",
|
94
94
|
"limit" => "1",
|
95
95
|
"subject" => "[LL] Raised tickets",
|
96
96
|
"template" => "lib/messages/accuracy.erb"
|
@@ -101,7 +101,7 @@ module Lazylead
|
|
101
101
|
test "score is correct" do
|
102
102
|
Lazylead::Smtp.new.enable
|
103
103
|
Task::Accuracy.new.run(
|
104
|
-
NoAuthJira.new("https://jira.
|
104
|
+
NoAuthJira.new("https://jira.mongodb.org"),
|
105
105
|
Postman.new,
|
106
106
|
Opts.new(
|
107
107
|
"from" => "ll@fake.com",
|
@@ -113,14 +113,14 @@ module Lazylead
|
|
113
113
|
"30" => "#FEC15E",
|
114
114
|
"50" => "#19DD1E"
|
115
115
|
}.to_json.to_s,
|
116
|
-
"jql" => "key=
|
116
|
+
"jql" => "key=JAVA-4344",
|
117
117
|
"silent" => "true",
|
118
|
-
"subject" => "[LL] Check
|
118
|
+
"subject" => "[LL] Check JAVA-4344",
|
119
119
|
"template" => "lib/messages/accuracy.erb"
|
120
120
|
)
|
121
121
|
)
|
122
|
-
assert_email "[LL] Check
|
123
|
-
"
|
122
|
+
assert_email "[LL] Check JAVA-4344",
|
123
|
+
"JAVA-4344", "3", "42.86%"
|
124
124
|
end
|
125
125
|
end
|
126
126
|
end
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# The MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2019-
|
5
|
+
# Copyright (c) 2019-2022 Yurii Dubinka
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"),
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# The MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2019-
|
5
|
+
# Copyright (c) 2019-2022 Yurii Dubinka
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"),
|
@@ -35,14 +35,14 @@ module Lazylead
|
|
35
35
|
end
|
36
36
|
|
37
37
|
def matches?(attach)
|
38
|
-
"
|
38
|
+
"Main.java".eql? attach.attrs["filename"]
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
42
42
|
test "attachment is present" do
|
43
43
|
assert Txt.new.passed(
|
44
|
-
NoAuthJira.new("https://jira.
|
45
|
-
.issues("key=
|
44
|
+
NoAuthJira.new("https://jira.mongodb.org")
|
45
|
+
.issues("key=JAVA-8", fields: ["attachment"])
|
46
46
|
.first
|
47
47
|
)
|
48
48
|
end
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# The MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2019-
|
5
|
+
# Copyright (c) 2019-2022 Yurii Dubinka
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"),
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# The MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2019-
|
5
|
+
# Copyright (c) 2019-2022 Yurii Dubinka
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"),
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# The MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2019-
|
5
|
+
# Copyright (c) 2019-2022 Yurii Dubinka
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"),
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# The MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2019-
|
5
|
+
# Copyright (c) 2019-2022 Yurii Dubinka
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"),
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# The MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2019-
|
5
|
+
# Copyright (c) 2019-2022 Yurii Dubinka
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"),
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# The MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2019-
|
5
|
+
# Copyright (c) 2019-2022 Yurii Dubinka
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"),
|
@@ -34,34 +34,34 @@ module Lazylead
|
|
34
34
|
# In current tests the grid label is 'PullRequest'.
|
35
35
|
# The default grid labels are 0%, 10%, 20%, etc., the reason why
|
36
36
|
# 'PullRequest' label is used here as we don't have 0%, 10%, etc.
|
37
|
-
# on https://jira.
|
37
|
+
# on https://jira.mongodb.org.
|
38
38
|
test "grid label found" do
|
39
|
-
|
40
|
-
NoAuthJira.new("https://jira.
|
41
|
-
Opts.new("grid" => "
|
42
|
-
)
|
39
|
+
assert_predicate Labels.new(
|
40
|
+
NoAuthJira.new("https://jira.mongodb.org").issues("key=JAVA-295").first,
|
41
|
+
Opts.new("grid" => "android, ,")
|
42
|
+
), :exists?
|
43
43
|
end
|
44
44
|
|
45
45
|
test "grid label set by ll" do
|
46
|
-
|
47
|
-
NoAuthJira.new("https://jira.
|
48
|
-
.issues("key=
|
46
|
+
assert_predicate Labels.new(
|
47
|
+
NoAuthJira.new("https://jira.mongodb.org")
|
48
|
+
.issues("key=JAVA-4190", expand: "changelog")
|
49
49
|
.first,
|
50
|
-
Opts.new("grid" => "
|
51
|
-
)
|
50
|
+
Opts.new("grid" => "QP-priority", "author" => "JIRAUSER1263031")
|
51
|
+
), :valid?
|
52
52
|
end
|
53
53
|
|
54
54
|
test "email notification" do
|
55
55
|
Lazylead::Smtp.new.enable
|
56
56
|
Lazylead::Task::OnlyLL.new.run(
|
57
|
-
NoAuthJira.new("https://jira.
|
57
|
+
NoAuthJira.new("https://jira.mongodb.org"),
|
58
58
|
Postman.new,
|
59
59
|
Opts.new(
|
60
60
|
"from" => "ll@fake.com",
|
61
61
|
"to" => "lead@fake.com",
|
62
|
-
"grid" => "
|
62
|
+
"grid" => "android",
|
63
63
|
"author" => "LL",
|
64
|
-
"jql" => "key=
|
64
|
+
"jql" => "key=JAVA-295",
|
65
65
|
"max_results" => 200,
|
66
66
|
"subject" => "[LL] Only",
|
67
67
|
"fields" => "priority,summary,reporter,labels",
|
@@ -69,18 +69,18 @@ module Lazylead
|
|
69
69
|
)
|
70
70
|
)
|
71
71
|
assert_email "[LL] Only",
|
72
|
-
"
|
72
|
+
"JAVA-295", "Major - P3", "Support Android platform"
|
73
73
|
end
|
74
74
|
|
75
|
-
test "detect score" do
|
76
|
-
assert_equal "
|
75
|
+
test "detect score label" do
|
76
|
+
assert_equal "QP-priority",
|
77
77
|
Labels.new(
|
78
|
-
NoAuthJira.new("https://jira.
|
79
|
-
.issues("key=
|
78
|
+
NoAuthJira.new("https://jira.mongodb.org")
|
79
|
+
.issues("key=JAVA-4190", expand: "changelog")
|
80
80
|
.first,
|
81
81
|
Opts.new(
|
82
|
-
"grid" => "
|
83
|
-
"author" => "
|
82
|
+
"grid" => "QP-priority",
|
83
|
+
"author" => "JIRAUSER1263031"
|
84
84
|
)
|
85
85
|
).score
|
86
86
|
end
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# The MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2019-
|
5
|
+
# Copyright (c) 2019-2022 Yurii Dubinka
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"),
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# The MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2019-
|
5
|
+
# Copyright (c) 2019-2022 Yurii Dubinka
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"),
|
@@ -32,7 +32,10 @@ module Lazylead
|
|
32
32
|
assert Records.new.passed(
|
33
33
|
OpenStruct.new(
|
34
34
|
attachments: [
|
35
|
-
OpenStruct.new(attrs: {
|
35
|
+
OpenStruct.new(attrs: {
|
36
|
+
"filename" => "failed case 1.mp4",
|
37
|
+
"size" => 6 * 1024
|
38
|
+
})
|
36
39
|
]
|
37
40
|
)
|
38
41
|
)
|
@@ -42,7 +45,10 @@ module Lazylead
|
|
42
45
|
assert Records.new.passed(
|
43
46
|
OpenStruct.new(
|
44
47
|
attachments: [
|
45
|
-
OpenStruct.new(attrs: {
|
48
|
+
OpenStruct.new(attrs: {
|
49
|
+
"filename" => "failed case 2.avi",
|
50
|
+
"size" => 6 * 1024
|
51
|
+
})
|
46
52
|
]
|
47
53
|
)
|
48
54
|
)
|
@@ -52,7 +58,10 @@ module Lazylead
|
|
52
58
|
refute Records.new.passed(
|
53
59
|
OpenStruct.new(
|
54
60
|
attachments: [
|
55
|
-
OpenStruct.new(attrs: {
|
61
|
+
OpenStruct.new(attrs: {
|
62
|
+
"filename" => "failed case 2.txt",
|
63
|
+
"size" => 6 * 1024
|
64
|
+
})
|
56
65
|
]
|
57
66
|
)
|
58
67
|
)
|
@@ -62,25 +71,39 @@ module Lazylead
|
|
62
71
|
assert Records.new.passed(
|
63
72
|
OpenStruct.new(
|
64
73
|
attachments: [
|
65
|
-
OpenStruct.new(
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
)
|
74
|
+
OpenStruct.new(attrs: {
|
75
|
+
"filename" => "snapshot.png",
|
76
|
+
"mimeType" => "image/gif",
|
77
|
+
"size" => 6 * 1024
|
78
|
+
})
|
71
79
|
]
|
72
80
|
)
|
73
81
|
)
|
74
82
|
end
|
75
83
|
|
76
84
|
test "mime type is xlsx" do
|
85
|
+
refute Records.new.passed(
|
86
|
+
OpenStruct.new(
|
87
|
+
attachments: [
|
88
|
+
OpenStruct.new(attrs: {
|
89
|
+
"filename" => "snapshot.xlsx",
|
90
|
+
"mimeType" => "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
91
|
+
"size" => 6 * 1024
|
92
|
+
})
|
93
|
+
]
|
94
|
+
)
|
95
|
+
)
|
96
|
+
end
|
97
|
+
|
98
|
+
test "empty gif" do
|
77
99
|
refute Records.new.passed(
|
78
100
|
OpenStruct.new(
|
79
101
|
attachments: [
|
80
102
|
OpenStruct.new(
|
81
103
|
attrs: {
|
82
|
-
"filename" => "
|
83
|
-
"mimeType" => "
|
104
|
+
"filename" => "steps.gif",
|
105
|
+
"mimeType" => "image/gif",
|
106
|
+
"size" => "0"
|
84
107
|
}
|
85
108
|
)
|
86
109
|
]
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# The MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2019-
|
5
|
+
# Copyright (c) 2019-2022 Yurii Dubinka
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"),
|
@@ -79,10 +79,10 @@ module Lazylead
|
|
79
79
|
end
|
80
80
|
|
81
81
|
test "detect non-system reporter" do
|
82
|
-
assert_equal "
|
82
|
+
assert_equal "tszming",
|
83
83
|
Score.new(
|
84
|
-
NoAuthJira.new("https://jira.
|
85
|
-
.issues("key=
|
84
|
+
NoAuthJira.new("https://jira.mongodb.org")
|
85
|
+
.issues("key=JAVA-151", expand: "changelog")
|
86
86
|
.first,
|
87
87
|
Opts.new("system-users" => "abilan")
|
88
88
|
).reporter
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# The MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2019-
|
5
|
+
# Copyright (c) 2019-2022 Yurii Dubinka
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"),
|
@@ -47,8 +47,8 @@ module Lazylead
|
|
47
47
|
|
48
48
|
test "issue has several .png attachments mentioned using !xxx|thumbnail! option" do
|
49
49
|
assert Screenshots.new.passed(
|
50
|
-
NoAuthJira.new("https://jira.
|
51
|
-
.issues("key=
|
50
|
+
NoAuthJira.new("https://jira.mongodb.org")
|
51
|
+
.issues("key=JAVA-4903", fields: %w[attachment description])
|
52
52
|
.first
|
53
53
|
)
|
54
54
|
end
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# The MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2019-
|
5
|
+
# Copyright (c) 2019-2022 Yurii Dubinka
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"),
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# The MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2019-
|
5
|
+
# Copyright (c) 2019-2022 Yurii Dubinka
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"),
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# The MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2019-
|
5
|
+
# Copyright (c) 2019-2022 Yurii Dubinka
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"),
|