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 +4 -4
- data/lazylead.gemspec +3 -3
- data/lib/lazylead/cli/app.rb +6 -1
- data/lib/lazylead/model.rb +7 -0
- data/lib/lazylead/task/accuracy/testcase.rb +8 -7
- data/lib/lazylead/task/svn/diff.rb +19 -10
- data/lib/lazylead/version.rb +1 -1
- data/lib/messages/svn_diff.erb +9 -9
- data/lib/messages/svn_diff_attachment.erb +1 -1
- data/test/lazylead/model_test.rb +10 -0
- data/test/lazylead/task/accuracy/testcase_test.rb +29 -0
- data/upgrades/sqlite/999.testdata.sql +2 -1
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 847a338ce12f9cd01529f1e6a66d810e68cde504e2a0873ecb41b869adcda7cc
|
4
|
+
data.tar.gz: 8ca65bb46faced2b89f07f1b65002b2890ecf2c78d4d53e74d017a712133d0f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f527721696b9f7215efc7628ea39c6cbf18c3145908d715ef5e698de57fcb5b6b28af8d0fe167b54b5418c9f15915071d0ff7ff2c7df3315f107f0d49c4c95d9
|
7
|
+
data.tar.gz: 1a71de8819ce9aa81fd0e11c4d0248e8b44d846d17f71adb0be18c6a74c9fe58d2ad257fd639f263c29546898cea0725dd6850dbdb417de6e03f541009fbebe0
|
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.6.
|
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.
|
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"
|
data/lib/lazylead/cli/app.rb
CHANGED
@@ -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
|
-
|
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
|
data/lib/lazylead/model.rb
CHANGED
@@ -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
|
42
|
-
detect_tc
|
43
|
-
detect_ar
|
44
|
-
detect_er
|
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?
|
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?
|
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?
|
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 "
|
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
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
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}
|
70
|
-
|
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
|
data/lib/lazylead/version.rb
CHANGED
data/lib/messages/svn_diff.erb
CHANGED
@@ -77,7 +77,7 @@
|
|
77
77
|
.commit * {
|
78
78
|
padding-left: 4px;
|
79
79
|
font-size: 8px;
|
80
|
-
line-height:
|
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
|
-
|
93
|
-
<%
|
94
|
-
|
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
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
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 %>
|
data/test/lazylead/model_test.rb
CHANGED
@@ -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.
|
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-
|
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:
|
224
|
+
name: tempfile
|
225
225
|
requirement: !ruby/object:Gem::Requirement
|
226
226
|
requirements:
|
227
227
|
- - '='
|
228
228
|
- !ruby/object:Gem::Version
|
229
|
-
version:
|
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:
|
236
|
+
version: 0.1.0
|
237
237
|
- !ruby/object:Gem::Dependency
|
238
|
-
name:
|
238
|
+
name: tilt
|
239
239
|
requirement: !ruby/object:Gem::Requirement
|
240
240
|
requirements:
|
241
241
|
- - '='
|
242
242
|
- !ruby/object:Gem::Version
|
243
|
-
version: 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.
|
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.
|
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
|