lazylead 0.6.1 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +7 -2
- data/.docker/Dockerfile +17 -6
- data/.docs/duedate_expired.md +1 -1
- data/.rubocop.yml +119 -3
- data/.simplecov +1 -1
- data/Gemfile +1 -1
- data/Guardfile +2 -2
- data/Rakefile +7 -4
- data/bin/lazylead +4 -2
- data/lazylead.gemspec +33 -29
- data/lib/lazylead.rb +2 -2
- data/lib/lazylead/allocated.rb +1 -1
- data/lib/lazylead/cc.rb +22 -21
- data/lib/lazylead/cli/app.rb +3 -3
- data/lib/lazylead/confluence.rb +10 -3
- data/lib/lazylead/email.rb +1 -21
- data/lib/lazylead/exchange.rb +17 -29
- data/lib/lazylead/home.rb +1 -1
- data/lib/lazylead/log.rb +1 -1
- data/lib/lazylead/model.rb +25 -17
- data/lib/lazylead/opts.rb +68 -3
- data/lib/lazylead/postman.rb +14 -19
- data/lib/lazylead/requires.rb +38 -0
- data/lib/lazylead/salt.rb +2 -1
- data/lib/lazylead/schedule.rb +1 -1
- data/lib/lazylead/smtp.rb +1 -1
- data/lib/lazylead/system/empty.rb +1 -1
- data/lib/lazylead/system/fake.rb +1 -1
- data/lib/lazylead/system/jira.rb +28 -20
- data/lib/lazylead/system/synced.rb +1 -1
- data/lib/lazylead/task/accuracy/accuracy.rb +23 -30
- data/lib/lazylead/task/accuracy/affected_build.rb +1 -1
- data/lib/lazylead/task/accuracy/attachment.rb +3 -7
- data/lib/lazylead/task/accuracy/environment.rb +1 -1
- data/lib/lazylead/task/accuracy/logs.rb +10 -5
- data/lib/lazylead/task/accuracy/onlyll.rb +147 -0
- data/lib/lazylead/task/accuracy/records.rb +2 -2
- data/lib/lazylead/task/accuracy/requirement.rb +1 -1
- data/lib/lazylead/task/accuracy/servers.rb +17 -8
- data/lib/lazylead/task/accuracy/stacktrace.rb +2 -2
- data/lib/lazylead/task/accuracy/testcase.rb +3 -3
- data/lib/lazylead/task/accuracy/wiki.rb +1 -1
- data/lib/lazylead/task/{alert.rb → alert/alert.rb} +6 -6
- data/lib/lazylead/task/alert/alertif.rb +75 -0
- data/lib/lazylead/task/alert/changed_to.rb +58 -0
- data/lib/lazylead/task/assignment.rb +1 -1
- data/lib/lazylead/task/confluence_ref.rb +1 -1
- data/lib/lazylead/task/echo.rb +1 -1
- data/lib/lazylead/task/fix_version.rb +5 -3
- data/lib/lazylead/task/loading.rb +94 -0
- data/lib/lazylead/task/missing_comment.rb +1 -1
- data/lib/lazylead/task/propagate_down.rb +4 -4
- data/lib/lazylead/task/savepoint.rb +1 -1
- data/lib/lazylead/task/svn/diff.rb +6 -14
- data/lib/lazylead/task/svn/grep.rb +41 -13
- data/lib/lazylead/task/svn/touch.rb +3 -5
- data/lib/lazylead/version.rb +2 -2
- data/lib/messages/accuracy.erb +1 -1
- data/lib/messages/alertif.erb +134 -0
- data/lib/messages/created_recently.erb +110 -0
- data/lib/messages/illegal_fixversion_change.erb +8 -2
- data/lib/messages/loading.erb +117 -0
- data/lib/messages/only_ll.erb +107 -0
- data/lib/messages/svn_diff_attachment.erb +18 -8
- data/lib/messages/svn_grep.erb +1 -1
- data/readme.md +3 -3
- data/test/lazylead/allocated_test.rb +1 -1
- data/test/lazylead/cc_test.rb +2 -1
- data/test/lazylead/cli/app_test.rb +2 -2
- data/test/lazylead/confluence_test.rb +1 -1
- data/test/lazylead/exchange_test.rb +1 -1
- data/test/lazylead/model_test.rb +11 -1
- data/test/lazylead/opts_test.rb +48 -1
- data/test/lazylead/postman_test.rb +9 -6
- data/test/lazylead/salt_test.rb +1 -1
- data/test/lazylead/smoke_test.rb +14 -1
- data/test/lazylead/smtp_test.rb +2 -5
- data/test/lazylead/system/jira_test.rb +10 -1
- data/test/lazylead/task/accuracy/accuracy_test.rb +1 -1
- data/test/lazylead/task/accuracy/affected_build_test.rb +1 -1
- data/test/lazylead/task/accuracy/attachment_test.rb +2 -2
- data/test/lazylead/task/accuracy/environment_test.rb +1 -1
- data/test/lazylead/task/accuracy/logs_test.rb +13 -1
- data/test/lazylead/task/accuracy/onlyll_test.rb +138 -0
- data/test/lazylead/task/accuracy/records_test.rb +1 -1
- data/test/lazylead/task/accuracy/score_test.rb +2 -2
- data/test/lazylead/task/accuracy/servers_test.rb +3 -3
- data/test/lazylead/task/accuracy/stacktrace_test.rb +1 -1
- data/test/lazylead/task/accuracy/testcase_test.rb +28 -1
- data/test/lazylead/task/accuracy/wiki_test.rb +1 -1
- data/test/lazylead/task/alert/alertif_test.rb +54 -0
- data/test/lazylead/task/{assignee_alert_test.rb → alert/assignee_alert_test.rb} +10 -10
- data/test/lazylead/task/alert/changed_to_test.rb +42 -0
- data/test/lazylead/task/assignment_test.rb +1 -1
- data/test/lazylead/task/confluence_ref_test.rb +1 -1
- data/test/lazylead/task/created_recently_test.rb +53 -0
- data/test/lazylead/task/duedate_test.rb +5 -12
- data/test/lazylead/task/echo_test.rb +1 -1
- data/test/lazylead/task/fix_version_test.rb +2 -1
- data/test/lazylead/task/loading_test.rb +54 -0
- data/test/lazylead/task/missing_comment_test.rb +1 -1
- data/test/lazylead/task/propagate_down_test.rb +5 -4
- data/test/lazylead/task/savepoint_test.rb +10 -7
- data/test/lazylead/task/svn/diff_test.rb +1 -1
- data/test/lazylead/task/svn/grep_test.rb +44 -2
- data/test/lazylead/task/svn/touch_test.rb +1 -1
- data/test/lazylead/version_test.rb +1 -1
- data/test/sqlite_test.rb +1 -1
- data/test/test.rb +8 -9
- data/upgrades/sqlite/001-install-main-lazylead-tables.sql +1 -1
- data/upgrades/sqlite/999.testdata.sql +3 -2
- metadata +133 -58
@@ -92,7 +92,8 @@
|
|
92
92
|
<tr>
|
93
93
|
<th id="key">Key</th>
|
94
94
|
<th id="priority">Priority</th>
|
95
|
-
<th id="
|
95
|
+
<th id="from">From</th>
|
96
|
+
<th id="to">To</th>
|
96
97
|
<th id="when">When</th>
|
97
98
|
<th id="who">Who</th>
|
98
99
|
<th id="reporter">Reporter</th>
|
@@ -102,7 +103,12 @@
|
|
102
103
|
<tr>
|
103
104
|
<td><a href='<%= v.issue.url %>'><%= v.issue.key %></a></td>
|
104
105
|
<td><%= v.issue.priority %></td>
|
105
|
-
<td><%= v.
|
106
|
+
<td><%= v.last["items"]
|
107
|
+
.select { |h| h["field"] == "Fix Version" }
|
108
|
+
.map { |h| h["fromString"] }
|
109
|
+
.reject(&:blank?)
|
110
|
+
.join(",") %></td>
|
111
|
+
<td><%= v.to %></td>
|
106
112
|
<td><%= DateTime.parse(v.last["created"])
|
107
113
|
.strftime('%d-%b-%Y %I:%M:%S %p') %></td>
|
108
114
|
<td><span style='color: red'><%= v.last["author"]["displayName"] %></span>
|
@@ -0,0 +1,117 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html lang="en">
|
3
|
+
<head>
|
4
|
+
<style> /* CSS styles taken from https://github.com/yegor256/tacit */
|
5
|
+
th {
|
6
|
+
font-weight: 600
|
7
|
+
}
|
8
|
+
|
9
|
+
table tr {
|
10
|
+
border-bottom-width: 2.16px
|
11
|
+
}
|
12
|
+
|
13
|
+
table tr th {
|
14
|
+
border-bottom-width: 2.16px
|
15
|
+
}
|
16
|
+
|
17
|
+
table tr td, table tr th {
|
18
|
+
overflow: hidden;
|
19
|
+
padding: 5.4px 3.6px;
|
20
|
+
line-height: 20px;
|
21
|
+
}
|
22
|
+
|
23
|
+
.auto {
|
24
|
+
min-width: auto;
|
25
|
+
white-space: nowrap;
|
26
|
+
}
|
27
|
+
|
28
|
+
a {
|
29
|
+
color: #275a90;
|
30
|
+
text-decoration: none
|
31
|
+
}
|
32
|
+
|
33
|
+
a:hover {
|
34
|
+
text-decoration: underline
|
35
|
+
}
|
36
|
+
|
37
|
+
* {
|
38
|
+
border: 0;
|
39
|
+
border-collapse: separate;
|
40
|
+
border-spacing: 0;
|
41
|
+
box-sizing: border-box;
|
42
|
+
margin: 0;
|
43
|
+
max-width: 100%;
|
44
|
+
padding: 0;
|
45
|
+
vertical-align: baseline;
|
46
|
+
font-family: system-ui, "Helvetica Neue", Helvetica, Arial, sans-serif;
|
47
|
+
font-size: 13px;
|
48
|
+
font-stretch: normal;
|
49
|
+
font-style: normal;
|
50
|
+
font-weight: 400;
|
51
|
+
}
|
52
|
+
|
53
|
+
html, body {
|
54
|
+
width: 100%
|
55
|
+
}
|
56
|
+
|
57
|
+
html {
|
58
|
+
height: 100%
|
59
|
+
}
|
60
|
+
|
61
|
+
body {
|
62
|
+
background: #fff;
|
63
|
+
color: #1a1919;
|
64
|
+
padding: 36px
|
65
|
+
}
|
66
|
+
</style>
|
67
|
+
<title>Loading</title>
|
68
|
+
</head>
|
69
|
+
<body>
|
70
|
+
<table summary="tickets">
|
71
|
+
<tr>
|
72
|
+
<th id="uid">ID</th>
|
73
|
+
<th id="name">User</th>
|
74
|
+
<th id="total">
|
75
|
+
<a href="https://jira.spring.io/issues/?jql=<%= CGI.escape(jql) %>">Assigned From</a>
|
76
|
+
</th>
|
77
|
+
<th id="duedate">Next Due date</th>
|
78
|
+
</tr>
|
79
|
+
<% assignments.each do |teammate, assignment| %>
|
80
|
+
<% if assignment.free? %>
|
81
|
+
<tr style="background: #FCEC88">
|
82
|
+
<% else %>
|
83
|
+
<tr>
|
84
|
+
<% end %>
|
85
|
+
<td>
|
86
|
+
<div class="auto"><a href="<%= user_link %>"><%= teammate %></a></div>
|
87
|
+
</td>
|
88
|
+
<td>
|
89
|
+
<div class="auto"><%= assignment.name %></div>
|
90
|
+
</td>
|
91
|
+
<td>
|
92
|
+
<div class="auto">
|
93
|
+
<% if assignment.free? %>
|
94
|
+
<span style="color: red">0</span>
|
95
|
+
<% else %>
|
96
|
+
<a href="https://jira.spring.io/issues/?jql=<%= CGI.escape("#{jql} and assignee=#{teammate}") %>"><%= assignment.size %></a>
|
97
|
+
<% end %>
|
98
|
+
</div>
|
99
|
+
</td>
|
100
|
+
<td>
|
101
|
+
<div class="auto">
|
102
|
+
<% if assignment.next.kind_of?(Date) && Date.current.after?(assignment.next) %>
|
103
|
+
<span style="color: red"><%= assignment.next %></span>
|
104
|
+
<% else %>
|
105
|
+
<%= assignment.next %>
|
106
|
+
<% end %>
|
107
|
+
</div>
|
108
|
+
</td>
|
109
|
+
</tr>
|
110
|
+
<% end %>
|
111
|
+
</table>
|
112
|
+
<br/>
|
113
|
+
<p>Posted by
|
114
|
+
<a href="https://github.com/dgroup/lazylead">lazylead v<%= version %></a>.
|
115
|
+
</p>
|
116
|
+
</body>
|
117
|
+
</html>
|
@@ -0,0 +1,107 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html lang="en">
|
3
|
+
<head>
|
4
|
+
<style> /* CSS styles taken from https://github.com/yegor256/tacit */
|
5
|
+
th {
|
6
|
+
font-weight: 600
|
7
|
+
}
|
8
|
+
|
9
|
+
table tr {
|
10
|
+
border-bottom-width: 2.16px
|
11
|
+
}
|
12
|
+
|
13
|
+
table tr th {
|
14
|
+
border-bottom-width: 2.16px
|
15
|
+
}
|
16
|
+
|
17
|
+
table tr td, table tr th {
|
18
|
+
overflow: hidden;
|
19
|
+
padding: 5.4px 3.6px;
|
20
|
+
line-height: 14px;
|
21
|
+
}
|
22
|
+
|
23
|
+
#summary {
|
24
|
+
text-align: left;
|
25
|
+
}
|
26
|
+
|
27
|
+
.auto {
|
28
|
+
min-width: auto;
|
29
|
+
white-space: nowrap;
|
30
|
+
}
|
31
|
+
|
32
|
+
a {
|
33
|
+
color: #275a90;
|
34
|
+
text-decoration: none
|
35
|
+
}
|
36
|
+
|
37
|
+
a:hover {
|
38
|
+
text-decoration: underline
|
39
|
+
}
|
40
|
+
|
41
|
+
* {
|
42
|
+
border: 0;
|
43
|
+
border-collapse: separate;
|
44
|
+
border-spacing: 0;
|
45
|
+
box-sizing: border-box;
|
46
|
+
margin: 0;
|
47
|
+
max-width: 100%;
|
48
|
+
padding: 0;
|
49
|
+
vertical-align: baseline;
|
50
|
+
font-family: system-ui, "Helvetica Neue", Helvetica, Arial, sans-serif;
|
51
|
+
font-size: 13px;
|
52
|
+
font-stretch: normal;
|
53
|
+
font-style: normal;
|
54
|
+
font-weight: 400;
|
55
|
+
line-height: 29.7px
|
56
|
+
}
|
57
|
+
|
58
|
+
html, body {
|
59
|
+
width: 100%
|
60
|
+
}
|
61
|
+
|
62
|
+
html {
|
63
|
+
height: 100%
|
64
|
+
}
|
65
|
+
|
66
|
+
body {
|
67
|
+
background: #fff;
|
68
|
+
color: #1a1919;
|
69
|
+
padding: 36px
|
70
|
+
}
|
71
|
+
</style>
|
72
|
+
<title>Only LL</title>
|
73
|
+
</head>
|
74
|
+
<body>
|
75
|
+
<p>Hi,</p>
|
76
|
+
<p>The LL accuracy labels are cleaned from the following tickets:</p>
|
77
|
+
<table summary="table with tickets triage score">
|
78
|
+
<tr>
|
79
|
+
<th id="key">Key</th>
|
80
|
+
<th id="priority">Priority</th>
|
81
|
+
<th id="reporter">Reporter</th>
|
82
|
+
<th id="violators">Violators</th>
|
83
|
+
<th id="summary">Summary</th>
|
84
|
+
<th id="labels">Labels</th>
|
85
|
+
</tr>
|
86
|
+
<% tickets.each do |t| %>
|
87
|
+
<tr>
|
88
|
+
<td>
|
89
|
+
<div class="auto">
|
90
|
+
<a href="<%= t.issue.url %>"><%= t.issue.key %></a>
|
91
|
+
</div>
|
92
|
+
</td>
|
93
|
+
<td><%= t.issue.priority %></td>
|
94
|
+
<td>
|
95
|
+
<div class="auto"><%= t.issue.reporter.name %></div>
|
96
|
+
</td>
|
97
|
+
<td><%= t.violators.join(', ') %></td>
|
98
|
+
<td><%= t.issue.summary %></td>
|
99
|
+
<td><%= t.issue.labels.join(', ') %></td>
|
100
|
+
</tr>
|
101
|
+
<% end %>
|
102
|
+
</table>
|
103
|
+
<p>Posted by
|
104
|
+
<a href="https://github.com/dgroup/lazylead">lazylead v<%= version %></a>.
|
105
|
+
</p>
|
106
|
+
</body>
|
107
|
+
</html>
|
@@ -64,7 +64,7 @@
|
|
64
64
|
padding: 36px
|
65
65
|
}
|
66
66
|
|
67
|
-
.commit {
|
67
|
+
.commit, .table-of-contents {
|
68
68
|
min-width: 100%;
|
69
69
|
border-radius: 3.5px;
|
70
70
|
overflow: hidden;
|
@@ -74,26 +74,36 @@
|
|
74
74
|
border: 1px solid #BCC6CC;
|
75
75
|
}
|
76
76
|
|
77
|
-
.commit * {
|
77
|
+
.commit *, .table-of-contents * {
|
78
78
|
padding-left: 4px;
|
79
79
|
font-size: 8px;
|
80
80
|
line-height: 15px;
|
81
81
|
}
|
82
|
+
|
83
|
+
.table-of-contents {
|
84
|
+
border: none;
|
85
|
+
}
|
82
86
|
</style>
|
83
87
|
<title>SVN log</title>
|
84
88
|
</head>
|
85
89
|
<body>
|
86
90
|
<p>Hi,</p>
|
87
|
-
<p>
|
91
|
+
<p>Commit(s) since <code><%= since_rev %></code> revision in <a href="<%= svn_url %>"><%= svn_url %></a>:</p>
|
92
|
+
<div id="table-of-contents" class="table-of-contents">
|
93
|
+
<ul>
|
94
|
+
<% stdout.split("------------------------------------------------------------------------").reject(&:blank?).reverse.each do |commit| %>
|
95
|
+
<% details = commit.split("\n").reject(&:blank?).first.split("|").map(&:strip).reject(&:blank?) %>
|
96
|
+
<li><a href="#<%= details[0] %>"><%= details[0] %></a> by <%= details[1] %> at <%= details[2] %></li>
|
97
|
+
<% end %>
|
98
|
+
</ul>
|
99
|
+
</div>
|
88
100
|
<% stdout.split("------------------------------------------------------------------------").reject(&:blank?).reverse.each do |commit| %>
|
89
101
|
<div class="commit">
|
90
102
|
<% commit.split("\n").reject(&:blank?).each_with_index do |line, index| %>
|
91
103
|
<% if index.zero? %>
|
92
104
|
<% details = line.split("|").map(&:strip).reject(&:blank?) %>
|
93
|
-
<p style="background: gainsboro;">
|
94
|
-
<a href="
|
95
|
-
by <a href="<%= user %><%= details[1] %>"><%= details[1] %></a>
|
96
|
-
at <span style="color: #275a90;"><%= details[2] %></span>
|
105
|
+
<p style="background: gainsboro;" id="<%= details[0] %>"><a href="<%= commit_url %><%= details[0][1..-1] %>"><%= details[0] %></a> by <a href="<%= user %><%= details[1] %>"><%= details[1] %></a> at <span style="color: #275a90;"><%= details[2] %></span>
|
106
|
+
<a href="#table-of-contents">↑</a>
|
97
107
|
</p>
|
98
108
|
<% else %>
|
99
109
|
<% if line.start_with?("+++") || line.start_with?("---") %>
|
@@ -103,7 +113,7 @@
|
|
103
113
|
<% elsif line.start_with?("-") %>
|
104
114
|
<p style="<%= "background: lightsalmon;" %>"><%= line.gsub(/[<>]/, '<' => '<', '>' => '>') %></p>
|
105
115
|
<% else %>
|
106
|
-
<p style="background: gainsboro;"><%= line.gsub(/[<>]/,'<' => '<', '>' => '>') %></p>
|
116
|
+
<p style="background: gainsboro;"><%= line.gsub(/[<>]/, '<' => '<', '>' => '>') %></p>
|
107
117
|
<% end %>
|
108
118
|
<% end %>
|
109
119
|
<% end %>
|
data/lib/messages/svn_grep.erb
CHANGED
@@ -93,7 +93,7 @@
|
|
93
93
|
by <a href="<%= user %><%= commit.author %>"><%= commit.author %></a>
|
94
94
|
at <span style="color: #275a90;"><%= commit.time %></span>
|
95
95
|
</p>
|
96
|
-
<% commit.
|
96
|
+
<% commit.diff(text.split(",")).each do |line| %>
|
97
97
|
<% if line.start_with?("+++") || line.start_with?("---") %>
|
98
98
|
<p style="background: gainsboro;"><%= line.gsub(/[<>]/, '<' => '<', '>' => '>') %></p>
|
99
99
|
<% elsif text.split(",").any? { |t| line.include? t } %>
|
data/readme.md
CHANGED
@@ -32,9 +32,9 @@ Join our telegram group [lazylead.org](https://t.me/lazyleads) for discussions.
|
|
32
32
|
|
33
33
|
| Daily annoying task | Jira | Github | Trello |
|
34
34
|
| :---------------------------------------------------------------------------------- | :---: | :----: | :----: |
|
35
|
-
| [Notify ticket's assignee](lib/lazylead/task/alert.rb)
|
36
|
-
| [Notify ticket's reporter](lib/lazylead/task/alert.rb)
|
37
|
-
| [Notify ticket's manager](lib/lazylead/task/alert.rb)
|
35
|
+
| [Notify ticket's assignee](lib/lazylead/task/alert/alert.rb) | ✅ | ⌛ | ⌛ |
|
36
|
+
| [Notify ticket's reporter](lib/lazylead/task/alert/alert.rb) | ✅ | ⌛ | ⌛ |
|
37
|
+
| [Notify ticket's manager](lib/lazylead/task/alert/alert.rb) | ✅ | ⌛ | ⌛ |
|
38
38
|
| [Notify about illegal "Fix Version" modification](lib/lazylead/task/fix_version.rb) | ✅ | ❌ | ❌ |
|
39
39
|
| [Expected comment in ticket is missing](lib/lazylead/task/missing_comment.rb) | ✅ | ⌛ | ⌛ |
|
40
40
|
| [Propagate some fields from parent ticket into sub-tasks](.docs/propagate_down.md) | ✅ | ❌ | ❌ |
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# The MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2019-
|
5
|
+
# Copyright (c) 2019-2021 Yurii Dubinka
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"),
|
data/test/lazylead/cc_test.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# The MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2019-
|
5
|
+
# Copyright (c) 2019-2021 Yurii Dubinka
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"),
|
@@ -49,6 +49,7 @@ module Lazylead
|
|
49
49
|
assert Lazylead::CC.new.undefined? "type" => " "
|
50
50
|
end
|
51
51
|
end
|
52
|
+
|
52
53
|
class PlainCcTest < Lazylead::Test
|
53
54
|
test "cc has valid email" do
|
54
55
|
assert_equal "a@fake.com", Lazylead::PlainCC.new("a@fake.com").cc.first
|
@@ -2,10 +2,10 @@
|
|
2
2
|
|
3
3
|
# The MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2019-
|
5
|
+
# Copyright (c) 2019-2021 Yurii Dubinka
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
|
-
# of this software and associated documentation files (the "Software"
|
8
|
+
# of this software and associated documentation files (the "Software"),
|
9
9
|
# to deal in the Software without restriction, including without limitation
|
10
10
|
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
11
11
|
# and/or sell copies of the Software, and to permit persons to whom
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# The MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2019-
|
5
|
+
# Copyright (c) 2019-2021 Yurii Dubinka
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"),
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# The MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2019-
|
5
|
+
# Copyright (c) 2019-2021 Yurii Dubinka
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"),
|
data/test/lazylead/model_test.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# The MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2019-
|
5
|
+
# Copyright (c) 2019-2021 Yurii Dubinka
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"),
|
@@ -82,5 +82,15 @@ module Lazylead
|
|
82
82
|
)
|
83
83
|
refute ORM::Task.find(260).to_h?
|
84
84
|
end
|
85
|
+
|
86
|
+
test "second ticketing system is found" do
|
87
|
+
CLI::App.new(Log.new, NoSchedule.new).run(
|
88
|
+
home: ".",
|
89
|
+
sqlite: "test/resources/#{no_ext(__FILE__)}.#{__method__}.db",
|
90
|
+
vcs4sql: "upgrades/sqlite",
|
91
|
+
testdata: true
|
92
|
+
)
|
93
|
+
assert_kind_of Jira, ORM::Task.find(270).second_sys
|
94
|
+
end
|
85
95
|
end
|
86
96
|
end
|
data/test/lazylead/opts_test.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# The MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2019-
|
5
|
+
# Copyright (c) 2019-2021 Yurii Dubinka
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"),
|
@@ -66,5 +66,52 @@ module Lazylead
|
|
66
66
|
test "except keys" do
|
67
67
|
assert_equal 1, Opts.new("one" => "1", "two" => "2").except("one").size
|
68
68
|
end
|
69
|
+
|
70
|
+
test "attachment is blank" do
|
71
|
+
assert_empty Opts.new("attachments" => "").msg_attachments
|
72
|
+
end
|
73
|
+
|
74
|
+
test "attachment is nil" do
|
75
|
+
assert_empty Opts.new("attachments" => nil).msg_attachments
|
76
|
+
end
|
77
|
+
|
78
|
+
test "attachment is absent" do
|
79
|
+
assert_empty Opts.new({}).msg_attachments
|
80
|
+
end
|
81
|
+
|
82
|
+
test "attachment is present" do
|
83
|
+
assert_equal %w[readme.md],
|
84
|
+
Opts.new("attachments" => "readme.md").msg_attachments
|
85
|
+
end
|
86
|
+
|
87
|
+
test "attachments are present" do
|
88
|
+
assert_equal %w[readme.md license.txt],
|
89
|
+
Opts.new("attachments" => "readme.md,license.txt")
|
90
|
+
.msg_attachments
|
91
|
+
end
|
92
|
+
|
93
|
+
test "attachments are present as symbol" do
|
94
|
+
assert_equal %w[readme.md license.txt],
|
95
|
+
Opts.new(attachments: " readme.md , license.txt ")
|
96
|
+
.msg_attachments
|
97
|
+
end
|
98
|
+
|
99
|
+
test "attachments is present as array" do
|
100
|
+
assert_equal %w[readme.md license.txt],
|
101
|
+
Opts.new(attachments: %w[readme.md license.txt])
|
102
|
+
.msg_attachments
|
103
|
+
end
|
104
|
+
|
105
|
+
test "value has numeric value" do
|
106
|
+
assert Opts.new("key" => "1").numeric? "key"
|
107
|
+
end
|
108
|
+
|
109
|
+
test "text value is not a numeric" do
|
110
|
+
refute Opts.new("key" => "val").numeric? "key"
|
111
|
+
end
|
112
|
+
|
113
|
+
test "nil is not a numeric" do
|
114
|
+
refute Opts.new("key" => nil).numeric? "key"
|
115
|
+
end
|
69
116
|
end
|
70
117
|
end
|