lazylead 0.10.3 → 0.11.1
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.
- checksums.yaml +4 -4
- data/.githooks/commit-msg +13 -0
- data/.rultor.yml +1 -0
- data/Rakefile +9 -1
- data/lazylead.gemspec +9 -8
- data/lib/lazylead/cli/app.rb +1 -1
- data/lib/lazylead/model.rb +24 -3
- data/lib/lazylead/opts.rb +13 -1
- data/lib/lazylead/schedule.rb +8 -1
- data/lib/lazylead/system/jira.rb +25 -4
- data/lib/lazylead/task/accuracy/accuracy.rb +33 -4
- data/lib/lazylead/task/accuracy/has_label.rb +48 -0
- data/lib/lazylead/task/accuracy/logs_link.rb +2 -2
- data/lib/lazylead/task/accuracy/memes.rb +77 -0
- data/lib/lazylead/task/accuracy/records.rb +3 -1
- data/lib/lazylead/task/accuracy/wiki_url.rb +46 -0
- data/lib/lazylead/version.rb +1 -1
- data/lib/messages/svn_grep.erb +1 -0
- data/test/lazylead/exchange_test.rb +21 -14
- data/test/lazylead/opts_test.rb +16 -0
- data/test/lazylead/retry_test.rb +85 -0
- data/test/lazylead/system/jira_test.rb +13 -5
- data/test/lazylead/task/accuracy/accuracy_test.rb +28 -0
- data/test/lazylead/task/accuracy/has_label_test.rb +54 -0
- data/test/lazylead/task/accuracy/memes_test.rb +77 -0
- data/test/lazylead/task/accuracy/records_test.rb +16 -0
- data/test/lazylead/task/accuracy/score_test.rb +7 -0
- data/test/lazylead/task/accuracy/screenshots_test.rb +2 -0
- data/test/lazylead/task/accuracy/wiki_url_test.rb +58 -0
- data/test/lazylead/task/svn/grep_test.rb +1 -2
- data/test/lazylead/task/svn/touch_test.rb +1 -1
- data/test/sqlite_test.rb +1 -1
- data/test/test.rb +47 -0
- metadata +41 -15
@@ -24,6 +24,7 @@
|
|
24
24
|
|
25
25
|
require_relative "../../../test"
|
26
26
|
require_relative "../../../../lib/lazylead/task/accuracy/records"
|
27
|
+
require_relative "../../../../lib/lazylead/system/jira"
|
27
28
|
|
28
29
|
module Lazylead
|
29
30
|
class RecordsTest < Lazylead::Test
|
@@ -56,5 +57,20 @@ module Lazylead
|
|
56
57
|
)
|
57
58
|
)
|
58
59
|
end
|
60
|
+
|
61
|
+
test "mime type has .gif despite on ext" do
|
62
|
+
assert Records.new.passed(
|
63
|
+
OpenStruct.new(
|
64
|
+
attachments: [
|
65
|
+
OpenStruct.new(
|
66
|
+
attrs: {
|
67
|
+
"filename" => "snapshot.png",
|
68
|
+
"mimeType" => "image/gif"
|
69
|
+
}
|
70
|
+
)
|
71
|
+
]
|
72
|
+
)
|
73
|
+
)
|
74
|
+
end
|
59
75
|
end
|
60
76
|
end
|
@@ -66,6 +66,13 @@ module Lazylead
|
|
66
66
|
"57" => "#19DD1E",
|
67
67
|
"90" => "#0FA81A"
|
68
68
|
}.to_json.to_s,
|
69
|
+
memes: Memes.new(
|
70
|
+
{
|
71
|
+
"0-9.9" => "https://meme.com?id=awful1.gif,https://meme.com?id=awful2.gif",
|
72
|
+
"70-89.9" => "https://meme.com?id=nice.gif",
|
73
|
+
"90-100" => "https://meme.com?id=wow.gif"
|
74
|
+
}.to_json.to_s
|
75
|
+
),
|
69
76
|
"docs" => "https://github.com/dgroup/lazylead/blob/master/.github/ISSUE_TEMPLATE/bug_report.md"
|
70
77
|
)
|
71
78
|
).evaluate.comment
|
@@ -27,6 +27,8 @@ require_relative "../../../../lib/lazylead/task/accuracy/screenshots"
|
|
27
27
|
require_relative "../../../../lib/lazylead/system/jira"
|
28
28
|
|
29
29
|
module Lazylead
|
30
|
+
# @todo #/DEV Rename the tests name as some of them are too huge.
|
31
|
+
# The maximum name size should be 56 symbols as it gives fancy format for test output in terminal
|
30
32
|
class ScreenshotsTest < Lazylead::Test
|
31
33
|
test "issue has two .png files with reference in description" do
|
32
34
|
assert Screenshots.new.passed(
|
@@ -0,0 +1,58 @@
|
|
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/task/accuracy/wiki_url"
|
27
|
+
|
28
|
+
module Lazylead
|
29
|
+
class WikiUrlTest < Lazylead::Test
|
30
|
+
test "wiki reference is present as url" do
|
31
|
+
assert WikiUrl.new("https://wiki.com/page=").passed(
|
32
|
+
OpenStruct.new(
|
33
|
+
remote_links: [
|
34
|
+
OpenStruct.new(
|
35
|
+
attrs: { "object" => { "url" => "https://wiki.com/page=5" } }
|
36
|
+
)
|
37
|
+
]
|
38
|
+
)
|
39
|
+
)
|
40
|
+
end
|
41
|
+
|
42
|
+
test "wiki reference is absent as url" do
|
43
|
+
refute WikiUrl.new("https://wiki.com/page=").passed(
|
44
|
+
OpenStruct.new(
|
45
|
+
remote_links: [
|
46
|
+
OpenStruct.new(
|
47
|
+
attrs: {}
|
48
|
+
)
|
49
|
+
]
|
50
|
+
)
|
51
|
+
)
|
52
|
+
end
|
53
|
+
|
54
|
+
test "wiki score" do
|
55
|
+
greater_then WikiUrl.new("https://wiki.com/page=").score, 0
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
@@ -33,8 +33,7 @@ require_relative "../../../../lib/lazylead/task/svn/svn"
|
|
33
33
|
module Lazylead
|
34
34
|
class GrepTest < Lazylead::Test
|
35
35
|
test "changes with text" do
|
36
|
-
skip "No svn credentials provided" unless env? "svn_log_user",
|
37
|
-
"svn_log_password"
|
36
|
+
skip "No svn credentials provided" unless env? "svn_log_user", "svn_log_password"
|
38
37
|
skip "No internet connection to riouxsvn.com" unless ping? "riouxsvn.com"
|
39
38
|
Lazylead::Smtp.new.enable
|
40
39
|
Task::Svn::Grep.new.run(
|
data/test/sqlite_test.rb
CHANGED
@@ -46,7 +46,7 @@ module Lazylead
|
|
46
46
|
tbl = t.first.to_s
|
47
47
|
cols = t.values_at(1).sort.join(",")
|
48
48
|
raise "No columns found for table #{tbl} in #{tables}" if cols.empty?
|
49
|
-
|
49
|
+
refute_nil schema[tbl], "Table '#{tbl}' not found in #{schema}"
|
50
50
|
assert_equal cols, schema[tbl], "Columns mismatch for '#{tbl}'"
|
51
51
|
end
|
52
52
|
end
|
data/test/test.rb
CHANGED
@@ -51,6 +51,15 @@ module Lazylead
|
|
51
51
|
include Minitest::Hooks
|
52
52
|
|
53
53
|
make_my_diffs_pretty!
|
54
|
+
parallelize(workers: ENV["MT_CPU"].to_i)
|
55
|
+
|
56
|
+
parallelize_setup do |worker|
|
57
|
+
SimpleCov.command_name "#{SimpleCov.command_name}-#{worker}"
|
58
|
+
end
|
59
|
+
|
60
|
+
parallelize_teardown do |_worker|
|
61
|
+
SimpleCov.result
|
62
|
+
end
|
54
63
|
|
55
64
|
def around
|
56
65
|
Timeout.timeout(
|
@@ -147,5 +156,43 @@ module Lazylead
|
|
147
156
|
require "net/ping"
|
148
157
|
Net::Ping::External.new(host).ping?
|
149
158
|
end
|
159
|
+
|
160
|
+
# Ensure that actual array contain at least expected array.
|
161
|
+
# @param exp
|
162
|
+
# The array with expected values
|
163
|
+
# @param act
|
164
|
+
# The array with actual values
|
165
|
+
def assert_array(exp, act)
|
166
|
+
assert_equal exp.size, act.size, "Size mismatch between arrays"
|
167
|
+
assert array?(exp, act), "No match between '#{exp}' and '#{act}'"
|
168
|
+
end
|
169
|
+
|
170
|
+
# Compare that actual array contain(not equal!) at least expected array.
|
171
|
+
# @return true
|
172
|
+
# If array <exp> contain array <act>
|
173
|
+
# rubocop:disable Metrics/PerceivedComplexity
|
174
|
+
# rubocop:disable Metrics/CyclomaticComplexity
|
175
|
+
def array?(exp, act)
|
176
|
+
rows = []
|
177
|
+
exp.each do |row|
|
178
|
+
rows << if row.respond_to? :each
|
179
|
+
act.any? do |arow|
|
180
|
+
next unless arow.respond_to? :[]
|
181
|
+
row.each_with_index.map { |c, i| c.eql? arow[i] }.all? { |c| c }
|
182
|
+
end
|
183
|
+
else
|
184
|
+
act.any? { |arow| row.eql? arow }
|
185
|
+
end
|
186
|
+
end
|
187
|
+
rows.all? { |r| r }
|
188
|
+
end
|
189
|
+
# rubocop:enable Metrics/PerceivedComplexity
|
190
|
+
# rubocop:enable Metrics/CyclomaticComplexity
|
191
|
+
|
192
|
+
# Ensure that text is blank.
|
193
|
+
def assert_blank(text)
|
194
|
+
assert_respond_to text, :blank?, "Text has no method :blank?"
|
195
|
+
assert text.blank?, "Text isn't blank"
|
196
|
+
end
|
150
197
|
end
|
151
198
|
end
|
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.
|
4
|
+
version: 0.11.1
|
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-
|
11
|
+
date: 2021-09-13 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.
|
61
|
+
version: 1.7.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.
|
68
|
+
version: 1.7.1
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: get_process_mem
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -164,6 +164,20 @@ dependencies:
|
|
164
164
|
- - '='
|
165
165
|
- !ruby/object:Gem::Version
|
166
166
|
version: 1.0.0
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
name: nokogiri
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - '='
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: 1.11.3
|
174
|
+
type: :runtime
|
175
|
+
prerelease: false
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - '='
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: 1.11.3
|
167
181
|
- !ruby/object:Gem::Dependency
|
168
182
|
name: openssl
|
169
183
|
requirement: !ruby/object:Gem::Requirement
|
@@ -352,14 +366,14 @@ dependencies:
|
|
352
366
|
requirements:
|
353
367
|
- - '='
|
354
368
|
- !ruby/object:Gem::Version
|
355
|
-
version: 0.
|
369
|
+
version: 0.6.0
|
356
370
|
type: :development
|
357
371
|
prerelease: false
|
358
372
|
version_requirements: !ruby/object:Gem::Requirement
|
359
373
|
requirements:
|
360
374
|
- - '='
|
361
375
|
- !ruby/object:Gem::Version
|
362
|
-
version: 0.
|
376
|
+
version: 0.6.0
|
363
377
|
- !ruby/object:Gem::Dependency
|
364
378
|
name: guard
|
365
379
|
requirement: !ruby/object:Gem::Requirement
|
@@ -506,42 +520,42 @@ dependencies:
|
|
506
520
|
requirements:
|
507
521
|
- - '='
|
508
522
|
- !ruby/object:Gem::Version
|
509
|
-
version: 1.
|
523
|
+
version: 1.20.0
|
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: 1.
|
530
|
+
version: 1.20.0
|
517
531
|
- !ruby/object:Gem::Dependency
|
518
532
|
name: rubocop-minitest
|
519
533
|
requirement: !ruby/object:Gem::Requirement
|
520
534
|
requirements:
|
521
535
|
- - '='
|
522
536
|
- !ruby/object:Gem::Version
|
523
|
-
version: 0.
|
537
|
+
version: 0.15.0
|
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: 0.
|
544
|
+
version: 0.15.0
|
531
545
|
- !ruby/object:Gem::Dependency
|
532
546
|
name: rubocop-performance
|
533
547
|
requirement: !ruby/object:Gem::Requirement
|
534
548
|
requirements:
|
535
549
|
- - '='
|
536
550
|
- !ruby/object:Gem::Version
|
537
|
-
version: 1.11.
|
551
|
+
version: 1.11.5
|
538
552
|
type: :development
|
539
553
|
prerelease: false
|
540
554
|
version_requirements: !ruby/object:Gem::Requirement
|
541
555
|
requirements:
|
542
556
|
- - '='
|
543
557
|
- !ruby/object:Gem::Version
|
544
|
-
version: 1.11.
|
558
|
+
version: 1.11.5
|
545
559
|
- !ruby/object:Gem::Dependency
|
546
560
|
name: rubocop-rake
|
547
561
|
requirement: !ruby/object:Gem::Requirement
|
@@ -604,14 +618,14 @@ dependencies:
|
|
604
618
|
requirements:
|
605
619
|
- - '='
|
606
620
|
- !ruby/object:Gem::Version
|
607
|
-
version: 0.6.
|
621
|
+
version: 0.6.3
|
608
622
|
type: :development
|
609
623
|
prerelease: false
|
610
624
|
version_requirements: !ruby/object:Gem::Requirement
|
611
625
|
requirements:
|
612
626
|
- - '='
|
613
627
|
- !ruby/object:Gem::Version
|
614
|
-
version: 0.6.
|
628
|
+
version: 0.6.3
|
615
629
|
description: |-
|
616
630
|
Ticketing systems (Github, Jira, etc.) are strongly
|
617
631
|
integrated into our processes and everyone understands their necessity. As soon
|
@@ -645,6 +659,7 @@ files:
|
|
645
659
|
- ".docs/duedate_expired.md"
|
646
660
|
- ".docs/propagate_down.md"
|
647
661
|
- ".gitattributes"
|
662
|
+
- ".githooks/commit-msg"
|
648
663
|
- ".github/CODE_OF_CONDUCT.md"
|
649
664
|
- ".github/CONTRIBUTING.md"
|
650
665
|
- ".github/ISSUE_TEMPLATE.md"
|
@@ -693,8 +708,10 @@ files:
|
|
693
708
|
- lib/lazylead/task/accuracy/affected_build.rb
|
694
709
|
- lib/lazylead/task/accuracy/attachment.rb
|
695
710
|
- lib/lazylead/task/accuracy/environment.rb
|
711
|
+
- lib/lazylead/task/accuracy/has_label.rb
|
696
712
|
- lib/lazylead/task/accuracy/logs.rb
|
697
713
|
- lib/lazylead/task/accuracy/logs_link.rb
|
714
|
+
- lib/lazylead/task/accuracy/memes.rb
|
698
715
|
- lib/lazylead/task/accuracy/onlyll.rb
|
699
716
|
- lib/lazylead/task/accuracy/records.rb
|
700
717
|
- lib/lazylead/task/accuracy/records_link.rb
|
@@ -705,6 +722,7 @@ files:
|
|
705
722
|
- lib/lazylead/task/accuracy/stacktrace.rb
|
706
723
|
- lib/lazylead/task/accuracy/testcase.rb
|
707
724
|
- lib/lazylead/task/accuracy/wiki.rb
|
725
|
+
- lib/lazylead/task/accuracy/wiki_url.rb
|
708
726
|
- lib/lazylead/task/alert/alert.rb
|
709
727
|
- lib/lazylead/task/alert/alertif.rb
|
710
728
|
- lib/lazylead/task/alert/changed_to.rb
|
@@ -747,6 +765,7 @@ files:
|
|
747
765
|
- test/lazylead/model_test.rb
|
748
766
|
- test/lazylead/opts_test.rb
|
749
767
|
- test/lazylead/postman_test.rb
|
768
|
+
- test/lazylead/retry_test.rb
|
750
769
|
- test/lazylead/salt_test.rb
|
751
770
|
- test/lazylead/smoke_test.rb
|
752
771
|
- test/lazylead/smtp_test.rb
|
@@ -755,8 +774,10 @@ files:
|
|
755
774
|
- test/lazylead/task/accuracy/affected_build_test.rb
|
756
775
|
- test/lazylead/task/accuracy/attachment_test.rb
|
757
776
|
- test/lazylead/task/accuracy/environment_test.rb
|
777
|
+
- test/lazylead/task/accuracy/has_label_test.rb
|
758
778
|
- test/lazylead/task/accuracy/logs_link_test.rb
|
759
779
|
- test/lazylead/task/accuracy/logs_test.rb
|
780
|
+
- test/lazylead/task/accuracy/memes_test.rb
|
760
781
|
- test/lazylead/task/accuracy/onlyll_test.rb
|
761
782
|
- test/lazylead/task/accuracy/records_llink_test.rb
|
762
783
|
- test/lazylead/task/accuracy/records_test.rb
|
@@ -766,6 +787,7 @@ files:
|
|
766
787
|
- test/lazylead/task/accuracy/stacktrace_test.rb
|
767
788
|
- test/lazylead/task/accuracy/testcase_test.rb
|
768
789
|
- test/lazylead/task/accuracy/wiki_test.rb
|
790
|
+
- test/lazylead/task/accuracy/wiki_url_test.rb
|
769
791
|
- test/lazylead/task/alert/alertif_test.rb
|
770
792
|
- test/lazylead/task/alert/assignee_alert_test.rb
|
771
793
|
- test/lazylead/task/alert/changed_to_test.rb
|
@@ -793,7 +815,7 @@ licenses:
|
|
793
815
|
- MIT
|
794
816
|
metadata: {}
|
795
817
|
post_install_message: |-
|
796
|
-
Thanks for installing Lazylead v0.
|
818
|
+
Thanks for installing Lazylead v0.11.1!
|
797
819
|
Read our blog posts: https://lazylead.org
|
798
820
|
Stay in touch with the community in Telegram: https://t.me/lazylead
|
799
821
|
Follow us on Twitter: https://twitter.com/lazylead
|
@@ -826,6 +848,7 @@ test_files:
|
|
826
848
|
- test/lazylead/model_test.rb
|
827
849
|
- test/lazylead/opts_test.rb
|
828
850
|
- test/lazylead/postman_test.rb
|
851
|
+
- test/lazylead/retry_test.rb
|
829
852
|
- test/lazylead/salt_test.rb
|
830
853
|
- test/lazylead/smoke_test.rb
|
831
854
|
- test/lazylead/smtp_test.rb
|
@@ -834,8 +857,10 @@ test_files:
|
|
834
857
|
- test/lazylead/task/accuracy/affected_build_test.rb
|
835
858
|
- test/lazylead/task/accuracy/attachment_test.rb
|
836
859
|
- test/lazylead/task/accuracy/environment_test.rb
|
860
|
+
- test/lazylead/task/accuracy/has_label_test.rb
|
837
861
|
- test/lazylead/task/accuracy/logs_link_test.rb
|
838
862
|
- test/lazylead/task/accuracy/logs_test.rb
|
863
|
+
- test/lazylead/task/accuracy/memes_test.rb
|
839
864
|
- test/lazylead/task/accuracy/onlyll_test.rb
|
840
865
|
- test/lazylead/task/accuracy/records_llink_test.rb
|
841
866
|
- test/lazylead/task/accuracy/records_test.rb
|
@@ -845,6 +870,7 @@ test_files:
|
|
845
870
|
- test/lazylead/task/accuracy/stacktrace_test.rb
|
846
871
|
- test/lazylead/task/accuracy/testcase_test.rb
|
847
872
|
- test/lazylead/task/accuracy/wiki_test.rb
|
873
|
+
- test/lazylead/task/accuracy/wiki_url_test.rb
|
848
874
|
- test/lazylead/task/alert/alertif_test.rb
|
849
875
|
- test/lazylead/task/alert/assignee_alert_test.rb
|
850
876
|
- test/lazylead/task/alert/changed_to_test.rb
|