lazylead 0.10.0 → 0.10.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 487f4f5deba01c6b85f9730f2652d5b70af87822206acd256de236051f8f3af9
4
- data.tar.gz: f8ac846170c9bade03fa003b16bd27b86b0565a0218afdc315a1ae1b1ca7794f
3
+ metadata.gz: ddf0f9e22eff50a83a0161cc969c6397c326d88a21dcc0a191634645a22bff67
4
+ data.tar.gz: ed262c75c351a8bdfc317123b04de69c854af92fe79234b01e85c3664e16a576
5
5
  SHA512:
6
- metadata.gz: 81c5cfc1ccb93691b58250b5a27b41963e37f2c375195483dbd8e21e1da3fbbe0c94944cef83b38c821a10297d62152e20dc36eb39ed50d1724f5badae4bd3af
7
- data.tar.gz: cb01af60779d0555610ea2f2b993ad61880863fe3515154bbcf0415f4e003a30a7a461bbc1907f8ff61461aaf6715fbe4190eecc4a2fa1210c36dc171d59cba7
6
+ metadata.gz: dc478328e0831adf45af81deaf82427e6f279607d3547fafe5c9593707eb3d39642426fc5f0239a0147fd0d007931e2712337a73da49dd33e6e423c16b947f9c
7
+ data.tar.gz: 930bb2edee338509549c3afe7d9d0dcea5f5391e7f5f6b6bf9cdfc9f2263cb723efedc0596df4e33babdf9d4c02af1401442dfa1ab7f5ffac6b13dccfb2b160b
data/.rubocop.yml CHANGED
@@ -42,7 +42,7 @@ Metrics/MethodLength:
42
42
  - "test/**/*"
43
43
 
44
44
  Metrics/ParameterLists:
45
- Max: 3
45
+ Max: 4
46
46
 
47
47
  Layout/HashAlignment:
48
48
  EnforcedColonStyle:
data/lazylead.gemspec CHANGED
@@ -32,7 +32,7 @@ Gem::Specification.new do |s|
32
32
  s.rubygems_version = "2.2"
33
33
  s.required_ruby_version = ">=2.6.5"
34
34
  s.name = "lazylead"
35
- s.version = "0.10.0"
35
+ s.version = "0.10.1"
36
36
  s.license = "MIT"
37
37
  s.summary = "Eliminate the annoying work within bug-trackers."
38
38
  s.description = "Ticketing systems (Github, Jira, etc.) are strongly
@@ -45,7 +45,7 @@ tasks instead of solving technical problems."
45
45
  s.authors = ["Yurii Dubinka"]
46
46
  s.email = "yurii.dubinka@gmail.com"
47
47
  s.homepage = "http://github.com/dgroup/lazylead"
48
- s.post_install_message = "Thanks for installing Lazylead v0.10.0!
48
+ s.post_install_message = "Thanks for installing Lazylead v0.10.1!
49
49
  Read our blog posts: https://lazylead.org
50
50
  Stay in touch with the community in Telegram: https://t.me/lazylead
51
51
  Follow us on Twitter: https://twitter.com/lazylead
@@ -58,7 +58,7 @@ tasks instead of solving technical problems."
58
58
  s.add_runtime_dependency "activerecord", "6.1.3"
59
59
  s.add_runtime_dependency "backtrace", "0.3"
60
60
  s.add_runtime_dependency "colorize", "0.8.1"
61
- s.add_runtime_dependency "faraday", "1.5.0"
61
+ s.add_runtime_dependency "faraday", "1.5.1"
62
62
  s.add_runtime_dependency "get_process_mem", "0.2.7"
63
63
  s.add_runtime_dependency "inifile", "3.0.0"
64
64
  s.add_runtime_dependency "jira-ruby", "2.1.5"
@@ -87,12 +87,12 @@ tasks instead of solving technical problems."
87
87
  s.add_development_dependency "minitest-hooks", "1.5.0"
88
88
  s.add_development_dependency "minitest-reporters", "1.4.3"
89
89
  s.add_development_dependency "net-ping", "2.0.8"
90
- s.add_development_dependency "rake", "13.0.4"
90
+ s.add_development_dependency "rake", "13.0.6"
91
91
  s.add_development_dependency "random-port", "0.5.1"
92
92
  s.add_development_dependency "rdoc", "6.3.2"
93
93
  s.add_development_dependency "rubocop", "1.18.3"
94
94
  s.add_development_dependency "rubocop-minitest", "0.14.0"
95
- s.add_development_dependency "rubocop-performance", "1.11.3"
95
+ s.add_development_dependency "rubocop-performance", "1.11.4"
96
96
  s.add_development_dependency "rubocop-rake", "0.6.0"
97
97
  s.add_development_dependency "rubocop-rspec", "2.4.0"
98
98
  s.add_development_dependency "sqlint", "0.2.0"
@@ -22,18 +22,13 @@
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 "requirement"
25
+ require_relative "required"
26
26
 
27
27
  module Lazylead
28
28
  # A requirement that Jira field "Environment" provided by the reporter.
29
- class Environment < Requirement
29
+ class Environment < Lazylead::Required
30
30
  def initialize(score = 0.5)
31
- super "Environment details (URL, patches)", score, "Environment"
32
- end
33
-
34
- # @return true if an issue has non-empty "Environment" field
35
- def passed(issue)
36
- non_blank? issue, "environment"
31
+ super "Environment details (URL, patches)", score, "Environment", "environment"
37
32
  end
38
33
  end
39
34
  end
@@ -28,7 +28,7 @@ module Lazylead
28
28
  # Check that ticket has video record(s) with reproducing results.
29
29
  class Records < Lazylead::Attachment
30
30
  def initialize(ext = [])
31
- super("Recorded internal reproducing results", 5, "Attachments")
31
+ super("Internal reproducing results (video)", 5, "Attachments")
32
32
  @ext = ext
33
33
  return unless @ext.empty?
34
34
  @ext = %w[.webm .mkv .flv .flv .vob .ogv .ogg .drc .gif .gifv .mng .avi
@@ -0,0 +1,43 @@
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 "requirement"
26
+
27
+ module Lazylead
28
+ #
29
+ # Check that ticket has mandatory non-blank field(s).
30
+ #
31
+ class Required < Lazylead::Requirement
32
+ def initialize(desc, score, msg, *fields)
33
+ super desc, score, msg
34
+ @fields = fields
35
+ end
36
+
37
+ def passed(issue)
38
+ return false if @fields.nil? || @fields.empty?
39
+ return true if @fields.all? { |f| non_blank?(issue, f) }
40
+ false
41
+ end
42
+ end
43
+ end
@@ -35,7 +35,7 @@ module Lazylead
35
35
  class Screenshots < Lazylead::Requirement
36
36
  # @param minimum The number of expected screenshots
37
37
  def initialize(minimum: 1, score: 2, ext: %w[.jpg .jpeg .exif .tiff .tff .bmp .png .svg])
38
- super "Screenshots", score, "Description,Attachments"
38
+ super "Internal reproducing results (screenshots)", score, "Description,Attachments"
39
39
  @minimum = minimum
40
40
  @ext = ext
41
41
  end
@@ -32,18 +32,18 @@ module Lazylead
32
32
  # @param envs regexp expressions to match servers in description.
33
33
  #
34
34
  def initialize(score: 2, envs: [], desc: "Internal reproducing results")
35
- super desc, score, "Description/Environment"
35
+ super desc, score, "Description"
36
36
  @envs = envs
37
37
  end
38
38
 
39
39
  def passed(issue)
40
40
  return true if @envs.empty?
41
- "#{issue['environment']}\n#{issue.description}".split("\n")
42
- .reject(&:blank?)
43
- .map(&:strip)
44
- .flat_map { |l| l.split.map(&:strip) }
45
- .select { |u| url?(u) }
46
- .any? { |u| match?(u) }
41
+ issue.description.split("\n")
42
+ .reject(&:blank?)
43
+ .map(&:strip)
44
+ .flat_map { |l| l.split.map(&:strip) }
45
+ .select { |u| url?(u) }
46
+ .any? { |u| match?(u) }
47
47
  end
48
48
 
49
49
  # Ensure that particular text contains web url
@@ -37,11 +37,11 @@ module Lazylead
37
37
  def passed(issue)
38
38
  return false if issue.description.nil?
39
39
  @tc = @ar = @er = -1
40
- issue.description.split("\n").reject(&:blank?).each_with_index do |l, i|
41
- line = escape l.downcase.gsub(/(\s+|\*|\+)/, "")
42
- detect_tc line, i
43
- detect_ar line, i
44
- detect_er line, i
40
+ issue.description.split("\n").reject(&:blank?).map(&:downcase).each_with_index do |l, i|
41
+ line = escape l.gsub(/(\s+|\*|\+)/, "")
42
+ detect_tc i, l, line
43
+ detect_ar i, l, line
44
+ detect_er i, l, line
45
45
  break if with_tc_ar_er?
46
46
  end
47
47
  with_tc_ar_er?
@@ -63,30 +63,37 @@ module Lazylead
63
63
  end
64
64
 
65
65
  # Detect index of line with test case
66
- def detect_tc(line, index)
66
+ # @param index The line number in description
67
+ # @param src The whole line in lower case from description
68
+ # @param strip The escaped line in lower case from description without special symbol(s)
69
+ def detect_tc(index, src, strip)
67
70
  return unless @tc.negative?
68
- @tc = index if eql? line, %w[testcase: tc: teststeps: teststeps steps: tcsteps: tc testcases
69
- steps usecase pre-requisitesandsteps:]
71
+ keywords = %w[testcase: tc: teststeps: teststeps steps: tcsteps: tc testcases steps usecase
72
+ pre-requisitesandsteps:]
73
+ @tc = index if keywords.any? { |k| strip.eql? k }
74
+ @tc = index if keywords.any? { |k| src.include? k }
70
75
  end
71
76
 
72
77
  # Detect index of line with actual result
73
- def detect_ar(line, index)
78
+ # @param index The line number in description
79
+ # @param src The whole line in lower case from description
80
+ # @param strip The escaped line in lower case from description without special symbol(s)
81
+ def detect_ar(index, src, strip)
74
82
  return unless @ar.negative? && index > @tc
75
- @ar = index if starts? line, %w[ar: actualresult: ar= [ar] actualresult]
83
+ keywords = %w[ar: actualresult: ar= [ar] actualresult]
84
+ @ar = index if keywords.any? { |k| strip.start_with? k }
85
+ @ar = index if keywords.any? { |k| src.include? k }
76
86
  end
77
87
 
78
88
  # Detect index of line with expected result
79
- def detect_er(line, index)
89
+ # @param index The line number in description
90
+ # @param src The whole line in lower case from description
91
+ # @param strip The escaped line in lower case from description without special symbol(s)
92
+ def detect_er(index, src, strip)
80
93
  return unless @er.negative? && index > @tc
81
- @er = index if starts? line, %w[er: expectedresult: er= [er] expectedresult]
82
- end
83
-
84
- def starts?(line, text)
85
- text.any? { |t| line.start_with? t }
86
- end
87
-
88
- def eql?(line, text)
89
- text.any? { |t| t.eql? line }
94
+ keywords = %w[er: expectedresult: er= [er] expectedresult]
95
+ @er = index if keywords.any? { |k| strip.start_with? k }
96
+ @er = index if keywords.any? { |k| src.include? k }
90
97
  end
91
98
  end
92
99
  end
@@ -23,5 +23,5 @@
23
23
  # OR OTHER DEALINGS IN THE SOFTWARE.
24
24
 
25
25
  module Lazylead
26
- VERSION = "0.10.0"
26
+ VERSION = "0.10.1"
27
27
  end
@@ -300,6 +300,13 @@ module Lazylead
300
300
  *{color:#DE10AA}Actual Result:{color}* = YYYY"
301
301
  end
302
302
 
303
+ test "TC with h3" do
304
+ assert testcase? "h3. Steps: Start updating
305
+ h3. ER: updating failed
306
+ h3. AR: updating should be passed
307
+ h3. Screenshots: !r37.png|thumbnail!"
308
+ end
309
+
303
310
  # ensure that issue description has a test case, AR and ER
304
311
  def testcase?(desc)
305
312
  Testcase.new.passed(OpenStruct.new(description: desc))
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.10.0
4
+ version: 0.10.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-07-06 00:00:00.000000000 Z
11
+ date: 2021-07-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.5.0
61
+ version: 1.5.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.5.0
68
+ version: 1.5.1
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: get_process_mem
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -464,14 +464,14 @@ dependencies:
464
464
  requirements:
465
465
  - - '='
466
466
  - !ruby/object:Gem::Version
467
- version: 13.0.4
467
+ version: 13.0.6
468
468
  type: :development
469
469
  prerelease: false
470
470
  version_requirements: !ruby/object:Gem::Requirement
471
471
  requirements:
472
472
  - - '='
473
473
  - !ruby/object:Gem::Version
474
- version: 13.0.4
474
+ version: 13.0.6
475
475
  - !ruby/object:Gem::Dependency
476
476
  name: random-port
477
477
  requirement: !ruby/object:Gem::Requirement
@@ -534,14 +534,14 @@ dependencies:
534
534
  requirements:
535
535
  - - '='
536
536
  - !ruby/object:Gem::Version
537
- version: 1.11.3
537
+ version: 1.11.4
538
538
  type: :development
539
539
  prerelease: false
540
540
  version_requirements: !ruby/object:Gem::Requirement
541
541
  requirements:
542
542
  - - '='
543
543
  - !ruby/object:Gem::Version
544
- version: 1.11.3
544
+ version: 1.11.4
545
545
  - !ruby/object:Gem::Dependency
546
546
  name: rubocop-rake
547
547
  requirement: !ruby/object:Gem::Requirement
@@ -697,6 +697,7 @@ files:
697
697
  - lib/lazylead/task/accuracy/logs_link.rb
698
698
  - lib/lazylead/task/accuracy/onlyll.rb
699
699
  - lib/lazylead/task/accuracy/records.rb
700
+ - lib/lazylead/task/accuracy/required.rb
700
701
  - lib/lazylead/task/accuracy/requirement.rb
701
702
  - lib/lazylead/task/accuracy/screenshots.rb
702
703
  - lib/lazylead/task/accuracy/servers.rb
@@ -790,7 +791,7 @@ licenses:
790
791
  - MIT
791
792
  metadata: {}
792
793
  post_install_message: |-
793
- Thanks for installing Lazylead v0.10.0!
794
+ Thanks for installing Lazylead v0.10.1!
794
795
  Read our blog posts: https://lazylead.org
795
796
  Stay in touch with the community in Telegram: https://t.me/lazylead
796
797
  Follow us on Twitter: https://twitter.com/lazylead