lazylead 0.6.0 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 50916d6916b46d8ea4c92fc6c4a02b75d6f9e35bbaad260057dd61bb0e25b650
4
- data.tar.gz: d536e0d99c760a853d3a24f47d2b1a8fbece654790af65ec02fe7c3bf69af085
3
+ metadata.gz: 847a338ce12f9cd01529f1e6a66d810e68cde504e2a0873ecb41b869adcda7cc
4
+ data.tar.gz: 8ca65bb46faced2b89f07f1b65002b2890ecf2c78d4d53e74d017a712133d0f4
5
5
  SHA512:
6
- metadata.gz: da6131b9e02115b3b61c70c3a38665f563f4ff7d37f20b0939073f11c05549c061403e9fa1711897b26917b88f324e89dd42c64128a27b72b6ebbf0b134e1d20
7
- data.tar.gz: bcc6287781baced0f0c0e0d4506fc1fa18439c98ff66a9254704620b537e9eb448daabdef646aa145ddf2d744c2f07f805ef717612bba0e4b86901be8ef33a85
6
+ metadata.gz: f527721696b9f7215efc7628ea39c6cbf18c3145908d715ef5e698de57fcb5b6b28af8d0fe167b54b5418c9f15915071d0ff7ff2c7df3315f107f0d49c4c95d9
7
+ data.tar.gz: 1a71de8819ce9aa81fd0e11c4d0248e8b44d846d17f71adb0be18c6a74c9fe58d2ad257fd639f263c29546898cea0725dd6850dbdb417de6e03f541009fbebe0
@@ -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.6.0"
35
+ s.version = "0.6.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.6.0!
48
+ s.post_install_message = "Thanks for installing Lazylead v0.6.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
@@ -70,8 +70,8 @@ tasks instead of solving technical problems."
70
70
  s.add_runtime_dependency "rufus-scheduler", "3.6.0"
71
71
  s.add_runtime_dependency "slop", "4.4"
72
72
  s.add_runtime_dependency "sqlite3", "1.4.2"
73
+ s.add_runtime_dependency "tempfile", "0.1.0"
73
74
  s.add_runtime_dependency "tilt", "2.0.10"
74
- s.add_runtime_dependency "tmpdir", "0.1.0"
75
75
  s.add_runtime_dependency "tzinfo", "1.1"
76
76
  s.add_runtime_dependency "tzinfo-data", "1.2019.3"
77
77
  s.add_runtime_dependency "vcs4sql", "0.1.0"
@@ -81,7 +81,12 @@ module Lazylead
81
81
  @log.warn "ll-001: No tasks found."
82
82
  else
83
83
  todo.find_each do |task|
84
- @schedule.register task
84
+ if task.to_h?
85
+ @schedule.register task
86
+ else
87
+ @log.warn "ll-011: Scheduling skipped due to configuration " \
88
+ "mistake in #{task}"
89
+ end
85
90
  end
86
91
  @schedule.join
87
92
  end
@@ -80,6 +80,13 @@ module Lazylead
80
80
  JSON.parse(properties).to_h
81
81
  end
82
82
 
83
+ def to_h?
84
+ return true unless to_hash.nil?
85
+ false
86
+ rescue StandardError => _e
87
+ false
88
+ end
89
+
83
90
  def to_s
84
91
  attributes.map { |k, v| "#{k}='#{v}'" }.join(", ")
85
92
  end
@@ -38,10 +38,10 @@ module Lazylead
38
38
  return false if issue.description.nil?
39
39
  @tc = @ar = @er = -1
40
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)
41
+ line = escape l.downcase.gsub(/(\s+|\*)/, "")
42
+ detect_tc line, i
43
+ detect_ar line, i
44
+ detect_er line, i
45
45
  break if with_tc_ar_er?
46
46
  end
47
47
  with_tc_ar_er?
@@ -65,19 +65,20 @@ module Lazylead
65
65
  # Detect index of line with test case
66
66
  def detect_tc(line, index)
67
67
  return unless @tc.negative?
68
- @tc = index if eql?(line, %w[testcase: tc: teststeps: teststeps steps:])
68
+ @tc = index if eql? line,
69
+ %w[testcase: tc: teststeps: teststeps steps: tcsteps:]
69
70
  end
70
71
 
71
72
  # Detect index of line with actual result
72
73
  def detect_ar(line, index)
73
74
  return unless @ar.negative? && index > @tc
74
- @ar = index if starts?(line, %w[ar: actualresult: ar= *ar*= *ar*:])
75
+ @ar = index if starts? line, %w[ar: actualresult: ar= [ar]]
75
76
  end
76
77
 
77
78
  # Detect index of line with expected result
78
79
  def detect_er(line, index)
79
80
  return unless @er.negative? && index > @tc
80
- @er = index if starts?(line, %w[er: expectedresult: er= *er*= *er*:])
81
+ @er = index if starts? line, %w[er: expectedresult: er= [er]]
81
82
  end
82
83
 
83
84
  def starts?(line, text)
@@ -22,8 +22,9 @@
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 "tmpdir"
25
+ require "tempfile"
26
26
  require "nokogiri"
27
+ require "backtrace"
27
28
  require "active_support/core_ext/hash/conversions"
28
29
  require_relative "../../salt"
29
30
  require_relative "../../opts"
@@ -58,18 +59,26 @@ module Lazylead
58
59
  Dir.mktmpdir do |dir|
59
60
  name = "svn-log-#{Date.today.strftime('%d-%b-%Y')}.html"
60
61
  f = File.open(File.join(dir, name), "w")
61
- f.write(
62
- Email.new(
63
- opts["template-attachment"],
64
- opts.merge(stdout: stdout, version: Lazylead::VERSION)
65
- ).render
66
- )
67
- postman.send opts.merge(stdout: stdout, attachments: [f.path])
62
+ begin
63
+ f.write make_attachment(stdout, opts)
64
+ f.close
65
+ postman.send opts.merge(stdout: stdout, attachments: [f.path])
66
+ ensure
67
+ File.delete(f)
68
+ end
68
69
  rescue StandardError => e
69
- @log.error "ll-010: Can't send an email for #{opts} based on "\
70
- "'#{stdout}'", e
70
+ @log.error "ll-010: Can't send an email for #{opts} due to " \
71
+ "#{Backtrace.new(e)}' based on #{stdout}'"
71
72
  end
72
73
  end
74
+
75
+ # Assemble HTML for attachment based on SVN output
76
+ def make_attachment(stdout, opts)
77
+ Email.new(
78
+ opts["template-attachment"],
79
+ opts.merge(stdout: stdout, version: Lazylead::VERSION)
80
+ ).render
81
+ end
73
82
  end
74
83
  end
75
84
  end
@@ -23,5 +23,5 @@
23
23
  # OR OTHER DEALINGS IN THE SOFTWARE.
24
24
 
25
25
  module Lazylead
26
- VERSION = "0.6.0"
26
+ VERSION = "0.6.1"
27
27
  end
@@ -77,7 +77,7 @@
77
77
  .commit * {
78
78
  padding-left: 4px;
79
79
  font-size: 8px;
80
- line-height: 15px;
80
+ line-height: 12px;
81
81
  }
82
82
  </style>
83
83
  <title>SVN log</title>
@@ -89,17 +89,17 @@
89
89
  <% stdout.split("------------------------------------------------------------------------").reject(&:blank?).reverse.each do |commit| %>
90
90
  <div class="commit">
91
91
  <% commit.split("\n").reject(&:blank?).each_with_index do |line, index| %>
92
- <% if index.zero? %>
93
- <% details = line.split("|").map(&:strip).reject(&:blank?) %>
94
- <p style="background: gainsboro;">
92
+ <p style="background: gainsboro;">
93
+ <% if index.zero? %>
94
+ <% details = line.split("|").map(&:strip).reject(&:blank?) %>
95
95
  <a href="<%= commit_url %><%= details[0][1..-1] %>"><%= details[0] %></a>
96
96
  by <a href="<%= user %><%= details[1] %>"><%= details[1] %></a>
97
97
  at <span style="color: #275a90;"><%= details[2] %></span>
98
- </p>
99
- <% end %>
100
- <% if index == 1 %>
101
- <p style="background: gainsboro;"><%= line %></p>
102
- <% end %>
98
+ <% end %>
99
+ <% if index == 1 %>
100
+ <span style="padding-left: 4px"><%= line %></span>
101
+ <% end %>
102
+ </p>
103
103
  <% end %>
104
104
  </div>
105
105
  <% end %>
@@ -108,7 +108,7 @@
108
108
  <% end %>
109
109
  <% end %>
110
110
  </div>
111
- <br/><br/><br/>
111
+ <br/>
112
112
  <% end %>
113
113
  <p>Posted by
114
114
  <a href="https://github.com/dgroup/lazylead">lazylead v<%= version %></a>.
@@ -72,5 +72,15 @@ module Lazylead
72
72
  )
73
73
  assert_equal "value", ORM::Task.find(171).props["envkey"]
74
74
  end
75
+
76
+ test "task properties are parsed despite on wrong config" do
77
+ CLI::App.new(Log.new, NoSchedule.new).run(
78
+ home: ".",
79
+ sqlite: "test/resources/#{no_ext(__FILE__)}.#{__method__}.db",
80
+ vcs4sql: "upgrades/sqlite",
81
+ testdata: true
82
+ )
83
+ refute ORM::Task.find(260).to_h?
84
+ end
75
85
  end
76
86
  end
@@ -217,6 +217,35 @@ module Lazylead
217
217
  *{color:#DE10AA}AR{color}* = YYYY"
218
218
  end
219
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
+
220
249
  # ensure that issue description has a test case, AR and ER
221
250
  def testcase?(desc)
222
251
  Testcase.new.passed(OpenStruct.new(description: desc))
@@ -37,4 +37,5 @@ values ('echo', 'cron:* * * * *', 'false', 1, 1, 1, 'Lazylead::Task::Echo', '{}'
37
37
  ('task with complex cc', '', 'false', 165, 1, 1, 'Lazylead::Task::Echo','{"cc":{"type":"Lazylead::PredefinedCC","opts": {"jvm":"tom@fake.com","jdbc":"mike@fake.com"}}}'),
38
38
  ('issue 171', '', 'false', 171, 1, 1, 'Lazylead::Task::Echo', '{"envkey":"${key171}"}'),
39
39
  ('issue 195', '', 'false', 195, 1, 1, 'Lazylead::Task::Accuracy', '{"key":"value"}'),
40
- ('issue 130', 'in:0.001s', 'true', 130, 1, 1, 'Lazylead::Task::EchoIO', '{}');
40
+ ('issue 130', 'in:0.001s', 'true', 130, 1, 1, 'Lazylead::Task::EchoIO', '{}'),
41
+ ('issue 260', 'cron:* * * * *', 'false', 260, 1, 1, 'Lazylead::Task::EchoIO', '{abc}');
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.6.0
4
+ version: 0.6.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: 2020-11-16 00:00:00.000000000 Z
11
+ date: 2020-11-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -221,33 +221,33 @@ dependencies:
221
221
  - !ruby/object:Gem::Version
222
222
  version: 1.4.2
223
223
  - !ruby/object:Gem::Dependency
224
- name: tilt
224
+ name: tempfile
225
225
  requirement: !ruby/object:Gem::Requirement
226
226
  requirements:
227
227
  - - '='
228
228
  - !ruby/object:Gem::Version
229
- version: 2.0.10
229
+ version: 0.1.0
230
230
  type: :runtime
231
231
  prerelease: false
232
232
  version_requirements: !ruby/object:Gem::Requirement
233
233
  requirements:
234
234
  - - '='
235
235
  - !ruby/object:Gem::Version
236
- version: 2.0.10
236
+ version: 0.1.0
237
237
  - !ruby/object:Gem::Dependency
238
- name: tmpdir
238
+ name: tilt
239
239
  requirement: !ruby/object:Gem::Requirement
240
240
  requirements:
241
241
  - - '='
242
242
  - !ruby/object:Gem::Version
243
- version: 0.1.0
243
+ version: 2.0.10
244
244
  type: :runtime
245
245
  prerelease: false
246
246
  version_requirements: !ruby/object:Gem::Requirement
247
247
  requirements:
248
248
  - - '='
249
249
  - !ruby/object:Gem::Version
250
- version: 0.1.0
250
+ version: 2.0.10
251
251
  - !ruby/object:Gem::Dependency
252
252
  name: tzinfo
253
253
  requirement: !ruby/object:Gem::Requirement
@@ -698,7 +698,7 @@ licenses:
698
698
  - MIT
699
699
  metadata: {}
700
700
  post_install_message: |-
701
- Thanks for installing Lazylead v0.6.0!
701
+ Thanks for installing Lazylead v0.6.1!
702
702
  Read our blog posts: https://lazylead.org
703
703
  Stay in touch with the community in Telegram: https://t.me/lazylead
704
704
  Follow us on Twitter: https://twitter.com/lazylead