lazylead 0.8.1 → 0.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -273,6 +273,24 @@ module Lazylead
273
273
  *{color:#DE10AA}[AR]{color}* = YYYY"
274
274
  end
275
275
 
276
+ test "TC named use case" do
277
+ assert testcase? "{color:#0747a6}+*Use case*+{color}
278
+ # Step 1
279
+ # Step ..
280
+ # Step N
281
+ *{color:#00673A}[ER]{color}* = XXXX
282
+ *{color:#DE10AA}[AR]{color}* = YYYY"
283
+ end
284
+
285
+ test "TC with full ar er words" do
286
+ assert testcase? "{color:#0747a6}+*Use case*+{color}
287
+ # Step 1
288
+ # Step ..
289
+ # Step N
290
+ *{color:#00673A}Expected result:{color}* = XXXX
291
+ *{color:#DE10AA}Actual Result:{color}* = YYYY"
292
+ end
293
+
276
294
  # ensure that issue description has a test case, AR and ER
277
295
  def testcase?(desc)
278
296
  Testcase.new.passed(OpenStruct.new(description: desc))
@@ -40,10 +40,12 @@ module Lazylead
40
40
  Opts.new(
41
41
  "to" => "lead@company.com",
42
42
  "from" => "ll@company.com",
43
- "jql" => "key=STS-3599",
43
+ "jql" => "key in (STS-3599, XD-3739, XD-3744)",
44
44
  "team" => "mclaren:Tom McLaren,milesparker:Mi Pa",
45
45
  "user_link" => "https://user.com?id=",
46
- "fields" => "description,assignee,component,priority,summary,duedate",
46
+ "search_link" => "https://jira.spring.io/issues/?jql=",
47
+ "fields" => "assignee,duedate,customfield_10480",
48
+ "sprint" => "customfield_10480",
47
49
  "subject" => "[LL] Team loading",
48
50
  "template" => "lib/messages/loading.erb"
49
51
  )
@@ -0,0 +1,61 @@
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/micromanager"
32
+
33
+ module Lazylead
34
+ class MicromanagerTest < Lazylead::Test
35
+ test "alert in case duedate changed by not authorized person" do
36
+ Lazylead::Smtp.new.enable
37
+ Task::Micromanager.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 ('STS-3599','SPR-6541') and duedate is not empty",
44
+ "fields" => "assignee,duedate,priority,created,summary,reporter",
45
+ "allowed" => "tom,mike,bob",
46
+ "period" => "86400",
47
+ "now" => "2009-12-10T00:04:00.000+0000",
48
+ "subject" => "DD: How dare you?",
49
+ "template" => "lib/messages/illegal_duedate_change.erb"
50
+ )
51
+ )
52
+ assert_email "DD: How dare you?",
53
+ %w[SPR-6541 Major (kdonald) 2009-12-10 Spring's\ Maven\ Central tom,mike,bob]
54
+ end
55
+
56
+ test "since for past 1 min" do
57
+ greater_or_eq Task::Micromanager.new.since("period" => 60).to_i,
58
+ (Time.now - 60).to_i
59
+ end
60
+ end
61
+ end
@@ -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
- %w[r2 by dgroup at 2020-08-16]
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"],
data/test/test.rb CHANGED
@@ -126,6 +126,18 @@ module Lazylead
126
126
  "Words '#{words.join(',')}' wasn't found in '#{mail.join('\n')}'"
127
127
  end
128
128
 
129
+ def assert_attachment(subject, regexp)
130
+ parts = Mail::TestMailer.deliveries
131
+ .find { |m| m.subject.eql? subject }
132
+ .body.parts.parts
133
+ .select do |p|
134
+ p.header.fields.any? { |f| f.value.start_with? "attachment" }
135
+ end
136
+ refute_empty parts, "No attachments found within the email"
137
+ assert parts.first.header.fields.any? { |f| f.value.match regexp },
138
+ "No attachments found matches to '#{regexp}' in #{subject}"
139
+ end
140
+
129
141
  # Ping remote host
130
142
  # https://github.com/eitoball/net-ping
131
143
  # https://stackoverflow.com/a/35508446/6916890
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lazylead
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.9.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yurii Dubinka
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-14 00:00:00.000000000 Z
11
+ date: 2021-05-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - '='
60
60
  - !ruby/object:Gem::Version
61
- version: 1.3.0
61
+ version: 1.4.1
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - '='
67
67
  - !ruby/object:Gem::Version
68
- version: 1.3.0
68
+ version: 1.4.1
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: get_process_mem
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -206,6 +206,20 @@ dependencies:
206
206
  - - '='
207
207
  - !ruby/object:Gem::Version
208
208
  version: 3.0.0
209
+ - !ruby/object:Gem::Dependency
210
+ name: rubyzip
211
+ requirement: !ruby/object:Gem::Requirement
212
+ requirements:
213
+ - - '='
214
+ - !ruby/object:Gem::Version
215
+ version: 2.3.0
216
+ type: :runtime
217
+ prerelease: false
218
+ version_requirements: !ruby/object:Gem::Requirement
219
+ requirements:
220
+ - - '='
221
+ - !ruby/object:Gem::Version
222
+ version: 2.3.0
209
223
  - !ruby/object:Gem::Dependency
210
224
  name: rufus-scheduler
211
225
  requirement: !ruby/object:Gem::Requirement
@@ -338,14 +352,14 @@ dependencies:
338
352
  requirements:
339
353
  - - '='
340
354
  - !ruby/object:Gem::Version
341
- version: 0.5.1
355
+ version: 0.5.2
342
356
  type: :development
343
357
  prerelease: false
344
358
  version_requirements: !ruby/object:Gem::Requirement
345
359
  requirements:
346
360
  - - '='
347
361
  - !ruby/object:Gem::Version
348
- version: 0.5.1
362
+ version: 0.5.2
349
363
  - !ruby/object:Gem::Dependency
350
364
  name: guard
351
365
  requirement: !ruby/object:Gem::Requirement
@@ -478,56 +492,56 @@ dependencies:
478
492
  requirements:
479
493
  - - '='
480
494
  - !ruby/object:Gem::Version
481
- version: 6.3.0
495
+ version: 6.3.1
482
496
  type: :development
483
497
  prerelease: false
484
498
  version_requirements: !ruby/object:Gem::Requirement
485
499
  requirements:
486
500
  - - '='
487
501
  - !ruby/object:Gem::Version
488
- version: 6.3.0
502
+ version: 6.3.1
489
503
  - !ruby/object:Gem::Dependency
490
504
  name: rubocop
491
505
  requirement: !ruby/object:Gem::Requirement
492
506
  requirements:
493
507
  - - '='
494
508
  - !ruby/object:Gem::Version
495
- version: 1.11.0
509
+ version: 1.13.0
496
510
  type: :development
497
511
  prerelease: false
498
512
  version_requirements: !ruby/object:Gem::Requirement
499
513
  requirements:
500
514
  - - '='
501
515
  - !ruby/object:Gem::Version
502
- version: 1.11.0
516
+ version: 1.13.0
503
517
  - !ruby/object:Gem::Dependency
504
518
  name: rubocop-minitest
505
519
  requirement: !ruby/object:Gem::Requirement
506
520
  requirements:
507
521
  - - '='
508
522
  - !ruby/object:Gem::Version
509
- version: 0.10.3
523
+ version: 0.12.1
510
524
  type: :development
511
525
  prerelease: false
512
526
  version_requirements: !ruby/object:Gem::Requirement
513
527
  requirements:
514
528
  - - '='
515
529
  - !ruby/object:Gem::Version
516
- version: 0.10.3
530
+ version: 0.12.1
517
531
  - !ruby/object:Gem::Dependency
518
532
  name: rubocop-performance
519
533
  requirement: !ruby/object:Gem::Requirement
520
534
  requirements:
521
535
  - - '='
522
536
  - !ruby/object:Gem::Version
523
- version: 1.10.1
537
+ version: 1.11.1
524
538
  type: :development
525
539
  prerelease: false
526
540
  version_requirements: !ruby/object:Gem::Requirement
527
541
  requirements:
528
542
  - - '='
529
543
  - !ruby/object:Gem::Version
530
- version: 1.10.1
544
+ version: 1.11.1
531
545
  - !ruby/object:Gem::Dependency
532
546
  name: rubocop-rake
533
547
  requirement: !ruby/object:Gem::Requirement
@@ -548,28 +562,28 @@ dependencies:
548
562
  requirements:
549
563
  - - '='
550
564
  - !ruby/object:Gem::Version
551
- version: 2.2.0
565
+ version: 2.3.0
552
566
  type: :development
553
567
  prerelease: false
554
568
  version_requirements: !ruby/object:Gem::Requirement
555
569
  requirements:
556
570
  - - '='
557
571
  - !ruby/object:Gem::Version
558
- version: 2.2.0
572
+ version: 2.3.0
559
573
  - !ruby/object:Gem::Dependency
560
574
  name: sqlint
561
575
  requirement: !ruby/object:Gem::Requirement
562
576
  requirements:
563
577
  - - '='
564
578
  - !ruby/object:Gem::Version
565
- version: 0.1.10
579
+ version: 0.2.0
566
580
  type: :development
567
581
  prerelease: false
568
582
  version_requirements: !ruby/object:Gem::Requirement
569
583
  requirements:
570
584
  - - '='
571
585
  - !ruby/object:Gem::Version
572
- version: 0.1.10
586
+ version: 0.2.0
573
587
  - !ruby/object:Gem::Dependency
574
588
  name: tempfile
575
589
  requirement: !ruby/object:Gem::Requirement
@@ -648,7 +662,6 @@ files:
648
662
  - ".simplecov"
649
663
  - CNAME
650
664
  - Gemfile
651
- - Guardfile
652
665
  - Rakefile
653
666
  - appveyor.yml
654
667
  - bin/.ruby-version
@@ -683,6 +696,7 @@ files:
683
696
  - lib/lazylead/task/accuracy/onlyll.rb
684
697
  - lib/lazylead/task/accuracy/records.rb
685
698
  - lib/lazylead/task/accuracy/requirement.rb
699
+ - lib/lazylead/task/accuracy/screenshots.rb
686
700
  - lib/lazylead/task/accuracy/servers.rb
687
701
  - lib/lazylead/task/accuracy/stacktrace.rb
688
702
  - lib/lazylead/task/accuracy/testcase.rb
@@ -695,6 +709,7 @@ files:
695
709
  - lib/lazylead/task/echo.rb
696
710
  - lib/lazylead/task/fix_version.rb
697
711
  - lib/lazylead/task/loading.rb
712
+ - lib/lazylead/task/micromanager.rb
698
713
  - lib/lazylead/task/missing_comment.rb
699
714
  - lib/lazylead/task/propagate_down.rb
700
715
  - lib/lazylead/task/savepoint.rb
@@ -707,6 +722,7 @@ files:
707
722
  - lib/messages/created_recently.erb
708
723
  - lib/messages/due_date_expired.erb
709
724
  - lib/messages/illegal_assignee_change.erb
725
+ - lib/messages/illegal_duedate_change.erb
710
726
  - lib/messages/illegal_fixversion_change.erb
711
727
  - lib/messages/loading.erb
712
728
  - lib/messages/missing_comment.erb
@@ -738,6 +754,7 @@ files:
738
754
  - test/lazylead/task/accuracy/onlyll_test.rb
739
755
  - test/lazylead/task/accuracy/records_test.rb
740
756
  - test/lazylead/task/accuracy/score_test.rb
757
+ - test/lazylead/task/accuracy/screenshots_test.rb
741
758
  - test/lazylead/task/accuracy/servers_test.rb
742
759
  - test/lazylead/task/accuracy/stacktrace_test.rb
743
760
  - test/lazylead/task/accuracy/testcase_test.rb
@@ -752,6 +769,7 @@ files:
752
769
  - test/lazylead/task/echo_test.rb
753
770
  - test/lazylead/task/fix_version_test.rb
754
771
  - test/lazylead/task/loading_test.rb
772
+ - test/lazylead/task/micromanager_test.rb
755
773
  - test/lazylead/task/missing_comment_test.rb
756
774
  - test/lazylead/task/propagate_down_test.rb
757
775
  - test/lazylead/task/savepoint_test.rb
@@ -768,7 +786,7 @@ licenses:
768
786
  - MIT
769
787
  metadata: {}
770
788
  post_install_message: |-
771
- Thanks for installing Lazylead v0.8.1!
789
+ Thanks for installing Lazylead v0.9.2!
772
790
  Read our blog posts: https://lazylead.org
773
791
  Stay in touch with the community in Telegram: https://t.me/lazylead
774
792
  Follow us on Twitter: https://twitter.com/lazylead
@@ -813,6 +831,7 @@ test_files:
813
831
  - test/lazylead/task/accuracy/onlyll_test.rb
814
832
  - test/lazylead/task/accuracy/records_test.rb
815
833
  - test/lazylead/task/accuracy/score_test.rb
834
+ - test/lazylead/task/accuracy/screenshots_test.rb
816
835
  - test/lazylead/task/accuracy/servers_test.rb
817
836
  - test/lazylead/task/accuracy/stacktrace_test.rb
818
837
  - test/lazylead/task/accuracy/testcase_test.rb
@@ -827,6 +846,7 @@ test_files:
827
846
  - test/lazylead/task/echo_test.rb
828
847
  - test/lazylead/task/fix_version_test.rb
829
848
  - test/lazylead/task/loading_test.rb
849
+ - test/lazylead/task/micromanager_test.rb
830
850
  - test/lazylead/task/missing_comment_test.rb
831
851
  - test/lazylead/task/propagate_down_test.rb
832
852
  - test/lazylead/task/savepoint_test.rb
data/Guardfile DELETED
@@ -1,33 +0,0 @@
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
- # Guardfile for Lazylead
26
- guard :minitest, all_after_pass: false, all_on_start: false do
27
- # with Minitest::Unit
28
- watch(%r{^test/(.*)/?test_(.*)\.rb$})
29
- watch(%r{^test/test\.rb$}) { "test" }
30
- watch(%r{^lib/lazylead/(.*/)?([^/]+)\.rb$}) do |m|
31
- "test/#{m[1]}test_#{m[2]}.rb"
32
- end
33
- end