lazylead 0.4.3 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/.docs/accuracy.md +2 -2
  3. data/.docs/duedate_expired.md +3 -3
  4. data/.docs/propagate_down.md +3 -3
  5. data/.gitattributes +1 -0
  6. data/Rakefile +6 -3
  7. data/bin/lazylead +7 -5
  8. data/lazylead.gemspec +4 -3
  9. data/lib/lazylead/cli/app.rb +11 -3
  10. data/lib/lazylead/exchange.rb +15 -9
  11. data/lib/lazylead/log.rb +2 -1
  12. data/lib/lazylead/model.rb +42 -1
  13. data/lib/lazylead/opts.rb +13 -0
  14. data/lib/lazylead/postman.rb +13 -7
  15. data/lib/lazylead/schedule.rb +16 -15
  16. data/lib/lazylead/smtp.rb +3 -1
  17. data/lib/lazylead/system/jira.rb +65 -4
  18. data/lib/lazylead/task/accuracy/accuracy.rb +13 -8
  19. data/lib/lazylead/task/accuracy/affected_build.rb +2 -6
  20. data/lib/lazylead/task/accuracy/attachment.rb +44 -0
  21. data/lib/lazylead/task/accuracy/environment.rb +39 -0
  22. data/lib/lazylead/task/accuracy/logs.rb +42 -0
  23. data/lib/lazylead/task/accuracy/records.rb +45 -0
  24. data/lib/lazylead/task/accuracy/requirement.rb +9 -0
  25. data/lib/lazylead/task/accuracy/servers.rb +50 -0
  26. data/lib/lazylead/task/accuracy/stacktrace.rb +103 -0
  27. data/lib/lazylead/task/accuracy/testcase.rb +92 -0
  28. data/lib/lazylead/task/accuracy/wiki.rb +41 -0
  29. data/lib/lazylead/task/assignment.rb +96 -0
  30. data/lib/lazylead/task/echo.rb +18 -0
  31. data/lib/lazylead/task/fix_version.rb +13 -2
  32. data/lib/lazylead/task/svn/diff.rb +85 -0
  33. data/lib/lazylead/task/svn/grep.rb +111 -0
  34. data/lib/lazylead/task/svn/touch.rb +101 -0
  35. data/lib/lazylead/version.rb +1 -1
  36. data/lib/messages/illegal_assignee_change.erb +123 -0
  37. data/lib/messages/illegal_fixversion_change.erb +2 -0
  38. data/lib/messages/svn_diff.erb +110 -0
  39. data/lib/messages/svn_diff_attachment.erb +117 -0
  40. data/lib/messages/svn_grep.erb +114 -0
  41. data/license.txt +1 -1
  42. data/readme.md +5 -5
  43. data/test/lazylead/cli/app_test.rb +11 -11
  44. data/test/lazylead/model_test.rb +10 -0
  45. data/test/lazylead/system/jira_test.rb +41 -4
  46. data/test/lazylead/task/accuracy/accuracy_test.rb +1 -1
  47. data/test/lazylead/task/accuracy/affected_build_test.rb +2 -2
  48. data/test/lazylead/task/accuracy/attachment_test.rb +50 -0
  49. data/test/lazylead/task/accuracy/environment_test.rb +42 -0
  50. data/test/lazylead/task/accuracy/logs_test.rb +138 -0
  51. data/test/lazylead/task/accuracy/records_test.rb +60 -0
  52. data/test/lazylead/task/accuracy/score_test.rb +46 -0
  53. data/test/lazylead/task/accuracy/servers_test.rb +66 -0
  54. data/test/lazylead/task/accuracy/stacktrace_test.rb +340 -0
  55. data/test/lazylead/task/accuracy/testcase_test.rb +254 -0
  56. data/test/lazylead/task/accuracy/wiki_test.rb +40 -0
  57. data/test/lazylead/task/assignment_test.rb +53 -0
  58. data/test/lazylead/task/svn/diff_test.rb +97 -0
  59. data/test/lazylead/task/svn/grep_test.rb +61 -0
  60. data/test/lazylead/task/{touch_test.rb → svn/touch_test.rb} +8 -8
  61. data/test/test.rb +16 -0
  62. data/upgrades/sqlite/001-install-main-lazylead-tables.sql +1 -5
  63. data/upgrades/sqlite/999.testdata.sql +13 -17
  64. metadata +72 -20
  65. data/.travis.yml +0 -16
  66. data/lib/lazylead/task/touch.rb +0 -104
@@ -0,0 +1,254 @@
1
+ # frozen_string_literal: true
2
+
3
+ # The MIT License
4
+ #
5
+ # Copyright (c) 2019-2020 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/task/accuracy/testcase"
27
+
28
+ module Lazylead
29
+ class TestcaseTest < Lazylead::Test
30
+ test "test case header is absent" do
31
+ refute testcase? "1. Lorem Ipsum is
32
+ 2. Text of the printing (and typesetting industry. Lorem Ipsum)
33
+ 3. has been the industry's standard dummy text ever since the 1500s
34
+ 4. When an unknown
35
+ 5. Printer took a galley of type and scrambled it to make a type specimen book
36
+ ER: It has survived not only five centuries
37
+ AR: but also the leap into electronic typesetting, remaining essentially unchanged -
38
+ {code:java}
39
+ xxx.xxxxx.xxxxxx.xxxx.xxx.XxxxXxxxXxxXX: xxxx xxx xxx XX xxxxxx xxxxx XXXxxxXXxxXxxXxx]
40
+ {code}"
41
+ end
42
+
43
+ test "er on the next line" do
44
+ assert testcase? "TC:
45
+ 1. It was popularised in the 1960s ;
46
+ 2. With the release of Letraset sheets containing 'Lorem Ipsum passages'
47
+ !xxxx-xxx.png|thumbnail!
48
+
49
+ 3. and more recently with desktop 'publishing software li'ke Aldus PageMaker including version;
50
+
51
+ ER:
52
+ Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots.
53
+
54
+ AR:
55
+
56
+ {code:java}
57
+ Xxxxxx
58
+ Xxxxx xxx xxx xxxx xxxx xx xxx.
59
+ {code}
60
+
61
+ !xxxx-x-x-x-x-x-xxx.png|thumbnail!"
62
+ end
63
+
64
+ test "tc ar er case 1" do
65
+ assert testcase? "*Preconditions:*
66
+ # XXX+ Xxxxx Xxxxxxx XX[http://xxx.xxx.xxx:0000/xx/xxx.jsp?xx=_xxx]
67
+ # Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia,
68
+
69
+ *Test steps:*
70
+ # Lorem Ipsum comes from sections 1.10.32 and 1.10.33
71
+ # This book is a treatise on the theory of ethics (very popular )
72
+ !xxx.png|width=514,height=262!
73
+ # The first line of Lorem Ipsum, 'Lorem ipsum dolor sit amet..'
74
+ *ER: The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those intereste*
75
+ *!xxx-xx-xx.png|width=535,height=61!*
76
+ # Sections 1.10.32 and 1.10.33 from 'de Finibus Bonorum et Malorum' by Cicero are also > xxxx
77
+ *ER: It is a long established fact that a reader will be distracted by the
78
+ *!xxxxxxxx-xxx-x-xx.png|width=826,height=167!*
79
+ *!xxxxxx-xxx-xx-xxx.png|width=373,height=59!*
80
+ #  The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters,
81
+
82
+ *ER: As opposed to using 'Content here, content here', making *
83
+ *AR: it look like readable English *
84
+ *!xxxxx-xx-x-x-xxx.png|width=1062,height=272!*
85
+
86
+ *[^xxx-xxxx.log]*
87
+
88
+ [^xxxxxx.LOG]"
89
+ end
90
+
91
+ test "tc ar er case 2" do
92
+ assert testcase? "*Pre-requisites:*
93
+ Many desktop publishing packages.
94
+
95
+ *TC:*
96
+ # Various versions have evolved over the years,
97
+ # sometimes by accident,
98
+ # sometimes on purpose (injected humour and the like).
99
+
100
+ *ER:*  !ER.png|thumbnail!
101
+
102
+ *AR:* There are many variations of passages of Lorem Ipsum available,
103
+
104
+ !AR.png|thumbnail!
105
+
106
+ *LOGS [^xXXxxx.zip]*
107
+
108
+ Randomised words which don't look even slightly believable: http://xxx.xxx.xxx:0000/xxx/xxx.jsp#!board;xxxxxXx=xxxxx;xxxxXxx=xxx;xxxxXx=xxxxxx
109
+ If you are going to use a passage: http://xxx.xxx.xxx:0000"
110
+ end
111
+
112
+ test "tc ar er case 3" do
113
+ assert testcase? "*Preconditions:*
114
+ # All the Lorem Ipsum generators on the Internet
115
+ # tend to repeat predefined chunks as necessary, (x xx xxxx)
116
+ # making this the first true generator on the Internet.
117
+ # It uses a dictionary of over 200 Latin words,
118
+ # combined with a handful of model sentence structures,
119
+
120
+ *Test case:*
121
+ 1. to generate Lorem Ipsum which looks reasonable -> generated Lorem Ipsum -> is therefore always free from repetition (xxx xxxx)
122
+ 2. [injected humour], or non-characteristic words etc.
123
+ 3. Lorem ipsum dolor sit amet, consectetur [adipiscing] elit
124
+ 4. sed do eiusmod [tempor] incididunt ut 'labore' et dolore magna aliqua
125
+ 5. Ut enim ad minim veniam,
126
+ 6. Quis nostrud exercitation ullamco laboris
127
+
128
+ *ER =* Duis aute irure dolor in reprehenderit: [Voluptate Velit].[dolore] = eu fugiat nulla pariatur
129
+
130
+ *AR =* Excepteur sint occaecat Cupidatat
131
+
132
+   !image-2020-09-04-18-24-26-052.png|thumbnail!
133
+
134
+ !image-2020-09-04-18-24-51-729.png|thumbnail!
135
+
136
+ !image-2020-09-04-18-26-01-262.png|thumbnail!
137
+
138
+ XXX_XXX.x.XXXX.XXXX.XX.XxxxXX_xxxXXXXX
139
+
140
+ [http://xxxx.xxx:0000/xxx/xx.jsp#xxxXxx=xxxx;xxxXxx=xxx]"
141
+ end
142
+
143
+ test "tc ar er case 4" do
144
+ assert testcase? "*Preconditions*
145
+ 1. Sed ut perspiciatis unde omnis iste
146
+ 2. Natus error sit voluptatem accusantium doloremque
147
+
148
+ *Test Steps*
149
+ 1. laudantium, totam → rem aperiam → eaque ipsa → 'quae ab illo ' 
150
+ 2. inventore veritatis et quasi architecto beatae
151
+
152
+ *ER* = Nemo enim ipsam voluptatem
153
+
154
+ *AR* = Neque porro quisquam est, qui dolorem ipsum quia dolor sit
155
+
156
+ !image-2020-09-04-18-45-10-682.png|thumbnail!
157
+
158
+ [http://xxxx.xxx:0000/xxx/xxx.jsp?xxx=xxxx#xxxXxx=xxx;xxxXxx=xxxxxx]
159
+ Ut enim ad minima veniam, quis nostrum exercitationem"
160
+ end
161
+
162
+ test "tc ar er case 5" do
163
+ assert testcase? "*Preconditions*
164
+ 1. But I must explain to you how all
165
+ 2. this mistaken idea of denouncing pleasure
166
+
167
+ *Test Steps*
168
+ 1. And praising → pain was → born and I will give
169
+ 2. Nor again is there anyone who loves or pursues or desires to obtain pain
170
+
171
+ *ER* = To take a trivial example,
172
+
173
+ *AR* = Which of us ever undertakes laborious physical exercise
174
+
175
+ !image-2020-xx-xx-xx-xx-xx-xxx.png|thumbnail!
176
+
177
+ [http://xxx.xxx:0000/xxx/xxx.jsp?xxx=xxxx;xxxXx=4428;xxxXx=xxxx]
178
+ except to obtain some advantage from it? "
179
+ end
180
+
181
+ test "tc ar er case 6" do
182
+ assert testcase? "[https://xxxx.xxxx.xxx.com/]
183
+
184
+ *Precondition:* But who has any right to find fault with a man who chooses
185
+
186
+ *TC:*
187
+ # njoy a pleasure that has no annoying consequences, : [yyyyyy.zzz.com|https://xxx.yyyy.com/]
188
+ # At vero eos et accusamus et iusto odio dignissimos: 8443286573113926860
189
+ # ducimus qui blanditiis [praesentium]
190
+ # Et harum quidem rerum facilis est et expedita distinctio.
191
+ # Nam libero tempore, cum soluta nobis est eligendi
192
+
193
+ *ER:* omnis voluptas assumenda est,
194
+
195
+ *AR:* omnis dolor repellendus.
196
+
197
+ [^screenshot-1.png]"
198
+ end
199
+
200
+ test "tc with colored ar er" do
201
+ assert testcase? "*TC:*
202
+ # Step 1
203
+ # Step 2
204
+ # Step ..
205
+ # Step N
206
+ {color:#00673A}ER{color}: XXXX
207
+ {color:#DE10AA}AR{color}: YYYY"
208
+ end
209
+
210
+ test "tc with colored bold ar er" do
211
+ assert testcase? "*TC:*
212
+ # Step 1
213
+ # Step 2
214
+ # Step ..
215
+ # Step N
216
+ *{color:#00673A}ER{color}* = XXXX
217
+ *{color:#DE10AA}AR{color}* = YYYY"
218
+ end
219
+
220
+ test "tc with ar er in brackets" do
221
+ assert testcase? "*TC Steps:*
222
+ # Step 1
223
+ # Step ..
224
+ # Step N
225
+ *[ER]* = XXXX
226
+ *[AR]* = YYYY"
227
+ end
228
+
229
+ test "tc with ar er in noformat" do
230
+ assert testcase? "*TC Steps:*
231
+ # Step 1
232
+ # Step ..
233
+ # Step N
234
+ {noformat}
235
+ *[ER]* = XXXX
236
+ *[AR]* = YYYY
237
+ {noformat}"
238
+ end
239
+
240
+ test "tc with colored ar er in brackets" do
241
+ assert testcase? "*TC Steps:*
242
+ # Step 1
243
+ # Step ..
244
+ # Step N
245
+ *{color:#00673A}[ER]{color}* = XXXX
246
+ *{color:#DE10AA}[AR]{color}* = YYYY"
247
+ end
248
+
249
+ # ensure that issue description has a test case, AR and ER
250
+ def testcase?(desc)
251
+ Testcase.new.passed(OpenStruct.new(description: desc))
252
+ end
253
+ end
254
+ end
@@ -0,0 +1,40 @@
1
+ # frozen_string_literal: true
2
+
3
+ # The MIT License
4
+ #
5
+ # Copyright (c) 2019-2020 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/task/accuracy/wiki"
27
+
28
+ module Lazylead
29
+ class WikiTest < Lazylead::Test
30
+ test "wiki reference is present" do
31
+ assert Wiki.new.passed(
32
+ OpenStruct.new(
33
+ remote_links: [
34
+ OpenStruct.new(attrs: { "relationship" => "Wiki Page" })
35
+ ]
36
+ )
37
+ )
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,53 @@
1
+ # frozen_string_literal: true
2
+
3
+ # The MIT License
4
+ #
5
+ # Copyright (c) 2019-2020 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/assignment"
32
+
33
+ module Lazylead
34
+ class AssignmentTest < Lazylead::Test
35
+ test "alert in case assignee changed by not authorized person" do
36
+ Lazylead::Smtp.new.enable
37
+ Task::Assignment.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 in ('DATAJDBC-480') and assignee is not empty",
44
+ "allowed" => "tom,mike,bob",
45
+ "subject" => "Assignment: How dare you?",
46
+ "template" => "lib/messages/illegal_assignee_change.erb"
47
+ )
48
+ )
49
+ assert_email "Assignment: How dare you?",
50
+ %w[DATAJDBC-480 01-Apr-2020 Minor Mark\ Paluch tom,mike,bob EntityInstantiators]
51
+ end
52
+ end
53
+ end
@@ -0,0 +1,97 @@
1
+ # frozen_string_literal: true
2
+
3
+ # The MIT License
4
+ #
5
+ # Copyright (c) 2019-2020 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
+ require_relative "../../../test"
27
+ require_relative "../../../../lib/lazylead/smtp"
28
+ require_relative "../../../../lib/lazylead/opts"
29
+ require_relative "../../../../lib/lazylead/postman"
30
+ require_relative "../../../../lib/lazylead/task/svn/diff"
31
+
32
+ module Lazylead
33
+ class DiffTest < Lazylead::Test
34
+ test "changes since revision" do
35
+ skip "No svn credentials provided" unless env? "svn_log_user",
36
+ "svn_log_password"
37
+ skip "No internet connection to riouxsvn.com" unless ping? "riouxsvn.com"
38
+ Lazylead::Smtp.new.enable
39
+ Task::Svn::Diff.new.run(
40
+ [],
41
+ Postman.new,
42
+ Opts.new(
43
+ "from" => "svnlog@test.com",
44
+ "svn_url" => "https://svn.riouxsvn.com/touch4ll",
45
+ "svn_user" => ENV["svn_log_user"],
46
+ "svn_password" => ENV["svn_log_password"],
47
+ "commit_url" => "https://view.commit.com?rev=",
48
+ "user" => "https://user.com?id=",
49
+ "to" => "lead@fake.com",
50
+ "since_rev" => "1",
51
+ "subject" => "[SVN] Changed since rev1",
52
+ "template" => "lib/messages/svn_diff.erb",
53
+ "template-attachment" => "lib/messages/svn_diff_attachment.erb"
54
+ )
55
+ )
56
+ assert_email_line "[SVN] Changed since rev1",
57
+ %w[r2 by dgroup at 2020-08-16]
58
+ end
59
+
60
+ test "changes since revision with attachment" do
61
+ skip "No svn credentials provided" unless env? "svn_log_user",
62
+ "svn_log_password"
63
+ skip "No internet connection to riouxsvn.com" unless ping? "riouxsvn.com"
64
+ skip "No postman credentials provided" unless env? "LL_SMTP_HOST",
65
+ "LL_SMTP_PORT",
66
+ "LL_SMTP_USER",
67
+ "LL_SMTP_PASS",
68
+ "LL_SMTP_TO",
69
+ "LL_SMTP_FROM"
70
+ Lazylead::Smtp.new(
71
+ Log.new,
72
+ NoSalt.new,
73
+ smtp_host: ENV["LL_SMTP_HOST"],
74
+ smtp_port: ENV["LL_SMTP_PORT"],
75
+ smtp_user: ENV["LL_SMTP_USER"],
76
+ smtp_pass: ENV["LL_SMTP_PASS"]
77
+ ).enable
78
+ Task::Svn::Diff.new.run(
79
+ [],
80
+ Postman.new,
81
+ Opts.new(
82
+ "from" => ENV["LL_SMTP_FROM"],
83
+ "svn_url" => "https://svn.riouxsvn.com/touch4ll",
84
+ "svn_user" => ENV["svn_log_user"],
85
+ "svn_password" => ENV["svn_log_password"],
86
+ "commit_url" => "https://view.commit.com?rev=",
87
+ "user" => "https://user.com?id=",
88
+ "to" => ENV["LL_SMTP_TO"],
89
+ "since_rev" => "1",
90
+ "subject" => "[SVN] Changed since rev1",
91
+ "template" => "lib/messages/svn_diff.erb",
92
+ "template-attachment" => "lib/messages/svn_diff_attachment.erb"
93
+ )
94
+ )
95
+ end
96
+ end
97
+ end
@@ -0,0 +1,61 @@
1
+ # frozen_string_literal: true
2
+
3
+ # The MIT License
4
+ #
5
+ # Copyright (c) 2019-2020 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
+ require_relative "../../../test"
27
+ require_relative "../../../../lib/lazylead/smtp"
28
+ require_relative "../../../../lib/lazylead/opts"
29
+ require_relative "../../../../lib/lazylead/postman"
30
+ require_relative "../../../../lib/lazylead/task/svn/grep"
31
+
32
+ module Lazylead
33
+ class GrepTest < Lazylead::Test
34
+ test "changes with text" do
35
+ skip "No svn credentials provided" unless env? "svn_log_user",
36
+ "svn_log_password"
37
+ skip "No internet connection to riouxsvn.com" unless ping? "riouxsvn.com"
38
+ Lazylead::Smtp.new.enable
39
+ Task::Svn::Grep.new.run(
40
+ [],
41
+ Postman.new,
42
+ Opts.new(
43
+ "from" => "svnlog@test.com",
44
+ "text" => "ping,https://github.com/dgroup/lazylead",
45
+ "svn_url" => "https://svn.riouxsvn.com/touch4ll",
46
+ "svn_user" => ENV["svn_log_user"],
47
+ "svn_password" => ENV["svn_log_password"],
48
+ "commit_url" => "https://view.commit.com?rev=",
49
+ "user" => "https://user.com?id=",
50
+ "to" => "lead@fake.com",
51
+ "now" => "2020-08-17T00:00:00+01:00",
52
+ "period" => "864000",
53
+ "subject" => "[SVN] Changes with text",
54
+ "template" => "lib/messages/svn_grep.erb"
55
+ )
56
+ )
57
+ assert_email_line "[SVN] Changes with text",
58
+ %w[r2 by dgroup at 2020-08-16]
59
+ end
60
+ end
61
+ end