lazylead 0.7.0 → 0.8.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +7 -2
- data/.docker/Dockerfile +17 -6
- data/.docs/duedate_expired.md +1 -1
- data/.rubocop.yml +71 -2
- data/Gemfile +1 -1
- data/Rakefile +7 -4
- data/bin/lazylead +1 -1
- data/lazylead.gemspec +26 -25
- data/lib/lazylead.rb +2 -2
- data/lib/lazylead/allocated.rb +1 -1
- data/lib/lazylead/cc.rb +17 -23
- data/lib/lazylead/cli/app.rb +1 -1
- data/lib/lazylead/confluence.rb +2 -2
- data/lib/lazylead/email.rb +1 -1
- data/lib/lazylead/exchange.rb +1 -1
- data/lib/lazylead/home.rb +1 -1
- data/lib/lazylead/log.rb +1 -1
- data/lib/lazylead/model.rb +6 -8
- data/lib/lazylead/opts.rb +6 -3
- data/lib/lazylead/postman.rb +1 -1
- data/{Guardfile → lib/lazylead/requires.rb} +13 -8
- data/lib/lazylead/salt.rb +1 -1
- data/lib/lazylead/schedule.rb +1 -1
- 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 +20 -18
- data/lib/lazylead/system/synced.rb +1 -1
- data/lib/lazylead/task/accuracy/accuracy.rb +24 -30
- data/lib/lazylead/task/accuracy/affected_build.rb +1 -1
- data/lib/lazylead/task/accuracy/attachment.rb +3 -3
- data/lib/lazylead/task/accuracy/environment.rb +1 -1
- data/lib/lazylead/task/accuracy/logs.rb +6 -3
- data/lib/lazylead/task/accuracy/onlyll.rb +7 -10
- data/lib/lazylead/task/accuracy/records.rb +2 -2
- data/lib/lazylead/task/accuracy/requirement.rb +1 -1
- data/lib/lazylead/task/accuracy/screenshots.rb +51 -0
- data/lib/lazylead/task/accuracy/servers.rb +3 -3
- data/lib/lazylead/task/accuracy/stacktrace.rb +1 -1
- data/lib/lazylead/task/accuracy/testcase.rb +3 -3
- data/lib/lazylead/task/accuracy/wiki.rb +1 -1
- data/lib/lazylead/task/{alert.rb → alert/alert.rb} +6 -6
- data/lib/lazylead/task/alert/alertif.rb +75 -0
- data/lib/lazylead/task/alert/changed_to.rb +58 -0
- data/lib/lazylead/task/assignment.rb +1 -1
- data/lib/lazylead/task/confluence_ref.rb +1 -1
- data/lib/lazylead/task/echo.rb +1 -1
- data/lib/lazylead/task/fix_version.rb +1 -1
- data/lib/lazylead/task/loading.rb +94 -0
- 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 +29 -7
- data/lib/lazylead/task/svn/grep.rb +2 -2
- data/lib/lazylead/task/svn/touch.rb +2 -2
- data/lib/lazylead/version.rb +2 -2
- data/lib/messages/accuracy.erb +1 -1
- data/lib/messages/alertif.erb +134 -0
- data/lib/messages/created_recently.erb +110 -0
- data/lib/messages/loading.erb +117 -0
- data/readme.md +26 -18
- data/test/lazylead/allocated_test.rb +1 -1
- data/test/lazylead/cc_test.rb +1 -1
- data/test/lazylead/cli/app_test.rb +2 -2
- data/test/lazylead/confluence_test.rb +1 -1
- data/test/lazylead/exchange_test.rb +1 -1
- data/test/lazylead/model_test.rb +1 -1
- data/test/lazylead/opts_test.rb +1 -1
- data/test/lazylead/postman_test.rb +1 -1
- data/test/lazylead/salt_test.rb +1 -1
- data/test/lazylead/smoke_test.rb +1 -1
- data/test/lazylead/smtp_test.rb +2 -5
- data/test/lazylead/system/jira_test.rb +10 -1
- data/test/lazylead/task/accuracy/accuracy_test.rb +1 -1
- data/test/lazylead/task/accuracy/affected_build_test.rb +1 -1
- data/test/lazylead/task/accuracy/attachment_test.rb +2 -2
- data/test/lazylead/task/accuracy/environment_test.rb +1 -1
- data/test/lazylead/task/accuracy/logs_test.rb +13 -1
- data/test/lazylead/task/accuracy/onlyll_test.rb +1 -1
- data/test/lazylead/task/accuracy/records_test.rb +1 -1
- data/test/lazylead/task/accuracy/score_test.rb +29 -2
- data/test/lazylead/task/accuracy/screenshots_test.rb +84 -0
- 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 +28 -1
- data/test/lazylead/task/accuracy/wiki_test.rb +1 -1
- data/test/lazylead/task/alert/alertif_test.rb +54 -0
- data/test/lazylead/task/{assignee_alert_test.rb → alert/assignee_alert_test.rb} +10 -10
- data/test/lazylead/task/alert/changed_to_test.rb +42 -0
- data/test/lazylead/task/assignment_test.rb +1 -1
- data/test/lazylead/task/confluence_ref_test.rb +1 -1
- data/test/lazylead/task/created_recently_test.rb +53 -0
- data/test/lazylead/task/duedate_test.rb +5 -12
- data/test/lazylead/task/echo_test.rb +1 -1
- data/test/lazylead/task/fix_version_test.rb +1 -1
- data/test/lazylead/task/loading_test.rb +54 -0
- data/test/lazylead/task/missing_comment_test.rb +1 -1
- data/test/lazylead/task/propagate_down_test.rb +1 -1
- data/test/lazylead/task/savepoint_test.rb +3 -3
- data/test/lazylead/task/svn/diff_test.rb +8 -4
- data/test/lazylead/task/svn/grep_test.rb +1 -1
- data/test/lazylead/task/svn/touch_test.rb +1 -1
- data/test/lazylead/version_test.rb +1 -1
- data/test/sqlite_test.rb +1 -1
- data/test/test.rb +15 -5
- data/upgrades/sqlite/001-install-main-lazylead-tables.sql +1 -1
- data/upgrades/sqlite/999.testdata.sql +1 -1
- metadata +82 -51
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# The MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2019-
|
5
|
+
# Copyright (c) 2019-2021 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-2021 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"),
|
@@ -246,6 +246,33 @@ module Lazylead
|
|
246
246
|
*{color:#DE10AA}[AR]{color}* = YYYY"
|
247
247
|
end
|
248
248
|
|
249
|
+
test "tc" do
|
250
|
+
assert testcase? "*TC*
|
251
|
+
# Step 1
|
252
|
+
# Step ..
|
253
|
+
# Step N
|
254
|
+
*{color:#00673A}[ER]{color}* = XXXX
|
255
|
+
*{color:#DE10AA}[AR]{color}* = YYYY"
|
256
|
+
end
|
257
|
+
|
258
|
+
test "testcases" do
|
259
|
+
assert testcase? "*Test cases*
|
260
|
+
# Step 1
|
261
|
+
# Step ..
|
262
|
+
# Step N
|
263
|
+
*{color:#00673A}[ER]{color}* = XXXX
|
264
|
+
*{color:#DE10AA}[AR]{color}* = YYYY"
|
265
|
+
end
|
266
|
+
|
267
|
+
test "TC with underline" do
|
268
|
+
assert testcase? "{color:#0747a6}+*Test Steps:*+{color}
|
269
|
+
# Step 1
|
270
|
+
# Step ..
|
271
|
+
# Step N
|
272
|
+
*{color:#00673A}[ER]{color}* = XXXX
|
273
|
+
*{color:#DE10AA}[AR]{color}* = YYYY"
|
274
|
+
end
|
275
|
+
|
249
276
|
# ensure that issue description has a test case, AR and ER
|
250
277
|
def testcase?(desc)
|
251
278
|
Testcase.new.passed(OpenStruct.new(description: desc))
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# The MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2019-
|
5
|
+
# Copyright (c) 2019-2021 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"),
|
@@ -0,0 +1,54 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# The MIT License
|
4
|
+
#
|
5
|
+
# Copyright (c) 2019-2021 Yurii Dubinka
|
6
|
+
#
|
7
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
|
+
# of this software and associated documentation files (the "Software"),
|
9
|
+
# to deal in the Software without restriction, including without limitation
|
10
|
+
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
11
|
+
# and/or sell copies of the Software, and to permit persons to whom
|
12
|
+
# the Software is furnished to do so, subject to the following conditions:
|
13
|
+
#
|
14
|
+
# The above copyright notice and this permission notice shall be included
|
15
|
+
# in all copies or substantial portions of the Software.
|
16
|
+
#
|
17
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
18
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
19
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
|
20
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
21
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
22
|
+
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
|
23
|
+
# OR OTHER DEALINGS IN THE SOFTWARE.
|
24
|
+
|
25
|
+
require_relative "../../../test"
|
26
|
+
require_relative "../../../../lib/lazylead/log"
|
27
|
+
require_relative "../../../../lib/lazylead/opts"
|
28
|
+
require_relative "../../../../lib/lazylead/smtp"
|
29
|
+
require_relative "../../../../lib/lazylead/postman"
|
30
|
+
require_relative "../../../../lib/lazylead/system/jira"
|
31
|
+
require_relative "../../../../lib/lazylead/task/alert/alertif"
|
32
|
+
require_relative "../../../../lib/lazylead/task/alert/changed_to"
|
33
|
+
|
34
|
+
module Lazylead
|
35
|
+
class AlertIfTest < Lazylead::Test
|
36
|
+
test "last change to Done" do
|
37
|
+
Smtp.new.enable
|
38
|
+
Lazylead::Task::AlertIf.new.run(
|
39
|
+
NoAuthJira.new("https://jira.spring.io"),
|
40
|
+
Postman.new,
|
41
|
+
Opts.new(
|
42
|
+
"to_status" => "Done",
|
43
|
+
"to" => "lead@company.com",
|
44
|
+
"from" => "ll@company.com",
|
45
|
+
"rules" => "Lazylead::ToStatus",
|
46
|
+
"jql" => "key=XD-3064",
|
47
|
+
"subject" => "[LL] alert if",
|
48
|
+
"template" => "lib/messages/alertif.erb"
|
49
|
+
)
|
50
|
+
)
|
51
|
+
assert_email "[LL] alert if", %w[XD-3064 Critical Done Glenn Risberg HdfsMongoDB]
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# The MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2019-
|
5
|
+
# Copyright (c) 2019-2021 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"),
|
@@ -22,15 +22,15 @@
|
|
22
22
|
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
|
23
23
|
# OR OTHER DEALINGS IN THE SOFTWARE.
|
24
24
|
|
25
|
-
require_relative "
|
26
|
-
require_relative "
|
27
|
-
require_relative "
|
28
|
-
require_relative "
|
29
|
-
require_relative "
|
30
|
-
require_relative "
|
31
|
-
require_relative "
|
32
|
-
require_relative "
|
33
|
-
require_relative "
|
25
|
+
require_relative "../../../test"
|
26
|
+
require_relative "../../../../lib/lazylead/log"
|
27
|
+
require_relative "../../../../lib/lazylead/smtp"
|
28
|
+
require_relative "../../../../lib/lazylead/postman"
|
29
|
+
require_relative "../../../../lib/lazylead/schedule"
|
30
|
+
require_relative "../../../../lib/lazylead/model"
|
31
|
+
require_relative "../../../../lib/lazylead/cli/app"
|
32
|
+
require_relative "../../../../lib/lazylead/system/jira"
|
33
|
+
require_relative "../../../../lib/lazylead/task/alert/alert"
|
34
34
|
|
35
35
|
module Lazylead
|
36
36
|
class AssigneeAlertTest < Lazylead::Test
|
@@ -0,0 +1,42 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# The MIT License
|
4
|
+
#
|
5
|
+
# Copyright (c) 2019-2021 Yurii Dubinka
|
6
|
+
#
|
7
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
|
+
# of this software and associated documentation files (the "Software"),
|
9
|
+
# to deal in the Software without restriction, including without limitation
|
10
|
+
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
11
|
+
# and/or sell copies of the Software, and to permit persons to whom
|
12
|
+
# the Software is furnished to do so, subject to the following conditions:
|
13
|
+
#
|
14
|
+
# The above copyright notice and this permission notice shall be included
|
15
|
+
# in all copies or substantial portions of the Software.
|
16
|
+
#
|
17
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
18
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
19
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
|
20
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
21
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
22
|
+
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
|
23
|
+
# OR OTHER DEALINGS IN THE SOFTWARE.
|
24
|
+
|
25
|
+
require_relative "../../../test"
|
26
|
+
require_relative "../../../../lib/lazylead/log"
|
27
|
+
require_relative "../../../../lib/lazylead/opts"
|
28
|
+
require_relative "../../../../lib/lazylead/system/jira"
|
29
|
+
require_relative "../../../../lib/lazylead/task/alert/changed_to"
|
30
|
+
|
31
|
+
module Lazylead
|
32
|
+
class ToStatusTest < Lazylead::Test
|
33
|
+
test "last change to Done" do
|
34
|
+
assert Lazylead::ToStatus.new.passed(
|
35
|
+
NoAuthJira.new("https://jira.spring.io")
|
36
|
+
.issues("key=XD-3064", Opts.new.jira_defaults.merge(expand: "changelog"))
|
37
|
+
.first,
|
38
|
+
Opts.new("to_status" => "Done")
|
39
|
+
)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# The MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2019-
|
5
|
+
# Copyright (c) 2019-2021 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-2021 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"),
|
@@ -0,0 +1,53 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# The MIT License
|
4
|
+
#
|
5
|
+
# Copyright (c) 2019-2021 Yurii Dubinka
|
6
|
+
#
|
7
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
|
+
# of this software and associated documentation files (the "Software"),
|
9
|
+
# to deal in the Software without restriction, including without limitation
|
10
|
+
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
11
|
+
# and/or sell copies of the Software, and to permit persons to whom
|
12
|
+
# the Software is furnished to do so, subject to the following conditions:
|
13
|
+
#
|
14
|
+
# The above copyright notice and this permission notice shall be included
|
15
|
+
# in all copies or substantial portions of the Software.
|
16
|
+
#
|
17
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
18
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
19
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
|
20
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
21
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
22
|
+
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
|
23
|
+
# OR OTHER DEALINGS IN THE SOFTWARE.
|
24
|
+
|
25
|
+
require_relative "../../test"
|
26
|
+
require_relative "../../../lib/lazylead/log"
|
27
|
+
require_relative "../../../lib/lazylead/smtp"
|
28
|
+
require_relative "../../../lib/lazylead/postman"
|
29
|
+
require_relative "../../../lib/lazylead/schedule"
|
30
|
+
require_relative "../../../lib/lazylead/model"
|
31
|
+
require_relative "../../../lib/lazylead/cli/app"
|
32
|
+
require_relative "../../../lib/lazylead/system/jira"
|
33
|
+
require_relative "../../../lib/lazylead/task/alert/alert"
|
34
|
+
|
35
|
+
module Lazylead
|
36
|
+
class CreatedRecentlyTest < Lazylead::Test
|
37
|
+
test "issues were fetched" do
|
38
|
+
Smtp.new.enable
|
39
|
+
Task::Alert.new.run(
|
40
|
+
NoAuthJira.new("https://jira.spring.io"),
|
41
|
+
Postman.new,
|
42
|
+
Opts.new(
|
43
|
+
"from" => "fake@email.com",
|
44
|
+
"to" => "my@team.com",
|
45
|
+
"sql" => "labels=xd and key in (XD-3766, SGF-726)",
|
46
|
+
"subject" => "[CR] 20min ago!",
|
47
|
+
"template" => "lib/messages/created_recently.erb"
|
48
|
+
)
|
49
|
+
)
|
50
|
+
assert_email "[CR] 20min ago!", %w[XD-3766 SGF-726]
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# The MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2019-
|
5
|
+
# Copyright (c) 2019-2021 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"),
|
@@ -30,7 +30,7 @@ require_relative "../../../lib/lazylead/schedule"
|
|
30
30
|
require_relative "../../../lib/lazylead/model"
|
31
31
|
require_relative "../../../lib/lazylead/cli/app"
|
32
32
|
require_relative "../../../lib/lazylead/system/jira"
|
33
|
-
require_relative "../../../lib/lazylead/task/alert"
|
33
|
+
require_relative "../../../lib/lazylead/task/alert/alert"
|
34
34
|
|
35
35
|
module Lazylead
|
36
36
|
class DuedateTest < Lazylead::Test
|
@@ -48,10 +48,7 @@ module Lazylead
|
|
48
48
|
"template" => "lib/messages/due_date_expired.erb"
|
49
49
|
)
|
50
50
|
)
|
51
|
-
assert_equal
|
52
|
-
Mail::TestMailer.deliveries
|
53
|
-
.filter { |m| m.subject.eql? "[DD] PDTN!" }
|
54
|
-
.length
|
51
|
+
assert_equal(2, Mail::TestMailer.deliveries.count { |m| m.subject.eql? "[DD] PDTN!" })
|
55
52
|
end
|
56
53
|
|
57
54
|
test "configuration properties merged successfully" do
|
@@ -123,8 +120,7 @@ module Lazylead
|
|
123
120
|
)
|
124
121
|
assert_equal %w[another.boss@example.com mom@home.com],
|
125
122
|
Mail::TestMailer.deliveries
|
126
|
-
.
|
127
|
-
.first.cc
|
123
|
+
.find { |m| m.subject.eql? "CC: Watching" }.cc
|
128
124
|
end
|
129
125
|
|
130
126
|
test "reporter got alert about his/her tickets with expired DD" do
|
@@ -139,10 +135,7 @@ module Lazylead
|
|
139
135
|
"template" => "lib/messages/due_date_expired.erb"
|
140
136
|
)
|
141
137
|
)
|
142
|
-
assert_equal
|
143
|
-
Mail::TestMailer.deliveries
|
144
|
-
.filter { |m| m.subject.eql? "DD Expired!" }
|
145
|
-
.length
|
138
|
+
assert_equal(2, Mail::TestMailer.deliveries.count { |m| m.subject.eql? "DD Expired!" })
|
146
139
|
end
|
147
140
|
end
|
148
141
|
end
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# The MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2019-
|
5
|
+
# Copyright (c) 2019-2021 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-2021 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"),
|
@@ -0,0 +1,54 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# The MIT License
|
4
|
+
#
|
5
|
+
# Copyright (c) 2019-2021 Yurii Dubinka
|
6
|
+
#
|
7
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
|
+
# of this software and associated documentation files (the "Software"),
|
9
|
+
# to deal in the Software without restriction, including without limitation
|
10
|
+
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
11
|
+
# and/or sell copies of the Software, and to permit persons to whom
|
12
|
+
# the Software is furnished to do so, subject to the following conditions:
|
13
|
+
#
|
14
|
+
# The above copyright notice and this permission notice shall be included
|
15
|
+
# in all copies or substantial portions of the Software.
|
16
|
+
#
|
17
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
18
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
19
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
|
20
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
21
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
22
|
+
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
|
23
|
+
# OR OTHER DEALINGS IN THE SOFTWARE.
|
24
|
+
|
25
|
+
require "mail"
|
26
|
+
|
27
|
+
require_relative "../../test"
|
28
|
+
require_relative "../../../lib/lazylead/smtp"
|
29
|
+
require_relative "../../../lib/lazylead/opts"
|
30
|
+
require_relative "../../../lib/lazylead/postman"
|
31
|
+
require_relative "../../../lib/lazylead/task/loading"
|
32
|
+
|
33
|
+
module Lazylead
|
34
|
+
class LoadingTest < Lazylead::Test
|
35
|
+
test "notify about team loading" do
|
36
|
+
Lazylead::Smtp.new.enable
|
37
|
+
Task::Loading.new.run(
|
38
|
+
NoAuthJira.new("https://jira.spring.io"),
|
39
|
+
Postman.new,
|
40
|
+
Opts.new(
|
41
|
+
"to" => "lead@company.com",
|
42
|
+
"from" => "ll@company.com",
|
43
|
+
"jql" => "key=STS-3599",
|
44
|
+
"team" => "mclaren:Tom McLaren,milesparker:Mi Pa",
|
45
|
+
"user_link" => "https://user.com?id=",
|
46
|
+
"fields" => "description,assignee,component,priority,summary,duedate",
|
47
|
+
"subject" => "[LL] Team loading",
|
48
|
+
"template" => "lib/messages/loading.erb"
|
49
|
+
)
|
50
|
+
)
|
51
|
+
assert_email "[LL] Team loading", %w[mclaren Tom McLaren 0]
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# The MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2019-
|
5
|
+
# Copyright (c) 2019-2021 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-2021 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-2021 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"),
|
@@ -46,8 +46,8 @@ module Lazylead
|
|
46
46
|
)
|
47
47
|
assert_equal 'text/markdown; filename="readme.md"',
|
48
48
|
Mail::TestMailer.deliveries
|
49
|
-
.
|
50
|
-
.
|
49
|
+
.find { |m| m.subject.eql? "[LL] Configuration backup" }
|
50
|
+
.attachments.first.header.fields[0]
|
51
51
|
.unparsed_value
|
52
52
|
end
|
53
53
|
end
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# The MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2019-
|
5
|
+
# Copyright (c) 2019-2021 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,6 +31,10 @@ require_relative "../../../../lib/lazylead/task/svn/diff"
|
|
31
31
|
|
32
32
|
module Lazylead
|
33
33
|
class DiffTest < Lazylead::Test
|
34
|
+
# @todo #/DEV Right now its impossible to check that attachment is present in email as we
|
35
|
+
# removing the directory with attachments once SVN::Diff is sent the email through the postman.
|
36
|
+
# Think about how to test this case in automatically, because for now we are doing it manually
|
37
|
+
# during the development.
|
34
38
|
test "changes since revision" do
|
35
39
|
skip "No svn credentials provided" unless env? "svn_log_user",
|
36
40
|
"svn_log_password"
|
@@ -53,8 +57,8 @@ module Lazylead
|
|
53
57
|
"template-attachment" => "lib/messages/svn_diff_attachment.erb"
|
54
58
|
)
|
55
59
|
)
|
56
|
-
assert_email_line "[SVN] Changed since rev1",
|
57
|
-
|
60
|
+
assert_email_line "[SVN] Changed since rev1", %w[r2 by dgroup at 2020-08-16]
|
61
|
+
# assert_attachment "[SVN] Changed since rev1", /^.*svn-log-.*.html.zip$/
|
58
62
|
end
|
59
63
|
|
60
64
|
test "changes since revision with attachment" do
|
@@ -68,7 +72,7 @@ module Lazylead
|
|
68
72
|
"LL_SMTP_TO",
|
69
73
|
"LL_SMTP_FROM"
|
70
74
|
Lazylead::Smtp.new(
|
71
|
-
Log.new,
|
75
|
+
Log.new.verbose,
|
72
76
|
NoSalt.new,
|
73
77
|
smtp_host: ENV["LL_SMTP_HOST"],
|
74
78
|
smtp_port: ENV["LL_SMTP_PORT"],
|