lazylead 0.3.1 → 0.5.0

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.
Files changed (77) hide show
  1. checksums.yaml +4 -4
  2. data/.0pdd.yml +4 -1
  3. data/.docs/accuracy.md +107 -0
  4. data/.docs/accuracy_email.jpg +0 -0
  5. data/.docs/accuracy_jira_comment.jpg +0 -0
  6. data/.docs/duedate_expired.md +3 -3
  7. data/.docs/propagate_down.md +4 -4
  8. data/.gitattributes +1 -0
  9. data/.github/dependabot.yml +6 -0
  10. data/.pdd +1 -1
  11. data/.rubocop.yml +6 -0
  12. data/Rakefile +2 -0
  13. data/bin/lazylead +7 -4
  14. data/lazylead.gemspec +5 -4
  15. data/lib/lazylead/exchange.rb +16 -9
  16. data/lib/lazylead/log.rb +30 -8
  17. data/lib/lazylead/model.rb +78 -22
  18. data/lib/lazylead/opts.rb +80 -0
  19. data/lib/lazylead/postman.rb +1 -1
  20. data/lib/lazylead/schedule.rb +18 -17
  21. data/lib/lazylead/smtp.rb +1 -1
  22. data/lib/lazylead/system/jira.rb +55 -14
  23. data/lib/lazylead/system/synced.rb +2 -1
  24. data/lib/lazylead/task/accuracy/accuracy.rb +136 -0
  25. data/lib/lazylead/task/accuracy/affected_build.rb +39 -0
  26. data/lib/lazylead/task/accuracy/attachment.rb +44 -0
  27. data/lib/lazylead/task/accuracy/environment.rb +39 -0
  28. data/lib/lazylead/task/accuracy/logs.rb +40 -0
  29. data/lib/lazylead/task/accuracy/records.rb +45 -0
  30. data/lib/lazylead/task/accuracy/requirement.rb +49 -0
  31. data/lib/lazylead/task/accuracy/servers.rb +50 -0
  32. data/lib/lazylead/task/accuracy/stacktrace.rb +63 -0
  33. data/lib/lazylead/task/accuracy/testcase.rb +75 -0
  34. data/lib/lazylead/task/accuracy/wiki.rb +41 -0
  35. data/lib/lazylead/task/alert.rb +8 -6
  36. data/lib/lazylead/task/confluence_ref.rb +4 -3
  37. data/lib/lazylead/task/echo.rb +22 -0
  38. data/lib/lazylead/task/fix_version.rb +18 -7
  39. data/lib/lazylead/task/missing_comment.rb +7 -5
  40. data/lib/lazylead/task/propagate_down.rb +11 -3
  41. data/lib/lazylead/task/savepoint.rb +1 -1
  42. data/lib/lazylead/task/touch.rb +119 -0
  43. data/lib/lazylead/version.rb +1 -1
  44. data/lib/messages/accuracy.erb +118 -0
  45. data/lib/messages/svn_log.erb +117 -0
  46. data/lib/messages/svn_touch.erb +147 -0
  47. data/license.txt +1 -1
  48. data/readme.md +20 -19
  49. data/test/lazylead/cc_test.rb +2 -2
  50. data/test/lazylead/cli/app_test.rb +12 -12
  51. data/test/lazylead/exchange_test.rb +3 -3
  52. data/test/lazylead/model_test.rb +4 -4
  53. data/test/lazylead/opts_test.rb +70 -0
  54. data/test/lazylead/postman_test.rb +1 -1
  55. data/test/lazylead/smtp_test.rb +1 -1
  56. data/test/lazylead/system/jira_test.rb +65 -1
  57. data/test/lazylead/task/accuracy/accuracy_test.rb +73 -0
  58. data/test/lazylead/task/accuracy/affected_build_test.rb +42 -0
  59. data/test/lazylead/task/accuracy/attachment_test.rb +50 -0
  60. data/test/lazylead/task/accuracy/environment_test.rb +42 -0
  61. data/test/lazylead/task/accuracy/logs_test.rb +78 -0
  62. data/test/lazylead/task/accuracy/records_test.rb +60 -0
  63. data/test/lazylead/task/accuracy/servers_test.rb +66 -0
  64. data/test/lazylead/task/accuracy/stacktrace_test.rb +113 -0
  65. data/test/lazylead/task/accuracy/testcase_test.rb +205 -0
  66. data/test/lazylead/task/accuracy/wiki_test.rb +40 -0
  67. data/test/lazylead/task/assignee_alert_test.rb +2 -2
  68. data/test/lazylead/task/duedate_test.rb +36 -26
  69. data/test/lazylead/task/fix_version_test.rb +9 -6
  70. data/test/lazylead/task/missing_comment_test.rb +11 -9
  71. data/test/lazylead/task/propagate_down_test.rb +4 -2
  72. data/test/lazylead/task/touch_test.rb +88 -0
  73. data/test/test.rb +25 -0
  74. data/upgrades/sqlite/001-install-main-lazylead-tables.sql +1 -5
  75. data/upgrades/sqlite/999.testdata.sql +12 -16
  76. metadata +65 -8
  77. data/.travis.yml +0 -16
@@ -0,0 +1,117 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <style>
5
+ /* CSS styles taken from https://github.com/yegor256/tacit */
6
+ pre, code, kbd, samp, var, output {
7
+ font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
8
+ font-size: 14.4px
9
+ }
10
+
11
+ pre code {
12
+ background: none;
13
+ border: 0;
14
+ line-height: 29.7px;
15
+ padding: 0
16
+ }
17
+
18
+ code, kbd {
19
+ background: #daf1e0;
20
+ border-radius: 3.6px;
21
+ color: #2a6f3b;
22
+ display: inline-block;
23
+ line-height: 18px;
24
+ padding: 3.6px 6.3px 2.7px
25
+ }
26
+
27
+ a {
28
+ color: #275a90;
29
+ text-decoration: none
30
+ }
31
+
32
+ a:hover {
33
+ text-decoration: underline
34
+ }
35
+
36
+ * {
37
+ border: 0;
38
+ border-collapse: separate;
39
+ border-spacing: 0;
40
+ box-sizing: border-box;
41
+ margin: 0;
42
+ max-width: 100%;
43
+ padding: 0;
44
+ vertical-align: baseline;
45
+ font-family: system-ui, "Helvetica Neue", Helvetica, Arial, sans-serif;
46
+ font-size: 13px;
47
+ font-stretch: normal;
48
+ font-style: normal;
49
+ font-weight: 400;
50
+ line-height: 29.7px
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
+
67
+ .commit {
68
+ min-width: 100%;
69
+ border-radius: 3.5px;
70
+ overflow: hidden;
71
+ display: inline-block;
72
+ line-height: 15px;
73
+ font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
74
+ border: 1px solid #BCC6CC;
75
+ }
76
+
77
+ .commit * {
78
+ padding-left: 4px;
79
+ font-size: 8px;
80
+ line-height: 15px;
81
+ }
82
+ </style>
83
+ <title>SVN log</title>
84
+ </head>
85
+ <body>
86
+ <p>Hi,</p>
87
+ <p>The following file(s) changed since <code><%= since_rev %></code> rev in <a href="<%= svn_url %>"><%= svn_url %></a>:</p>
88
+ <% stdout.split("------------------------------------------------------------------------").reject(&:blank?).reverse.each do |commit| %>
89
+ <div class="commit">
90
+ <% commit.split("\n").reject(&:blank?).each_with_index do |line, index| %>
91
+ <% if index.zero? %>
92
+ <% details = line.split("|").map(&:strip).reject(&:blank?) %>
93
+ <p style="background: gainsboro;">
94
+ <a href="<%= commit_url %><%= details[0][1 .. -1] %>"><%= details[0] %></a>
95
+ by<a href="<%= user %><%= details[1] %>"><%= details[1] %></a>
96
+ at<span style="color: #275a90;"><%= details[2] %></span>
97
+ </p>
98
+ <% else %>
99
+ <% if line.start_with?("+++") || line.start_with?("---") %>
100
+ <p style="background: gainsboro;"><%= line.gsub(/[<>]/, '<' => '&lt;', '>' => '&gt;') %></p>
101
+ <% elsif line.start_with?("+") %>
102
+ <p style="<%= "background: darkseagreen;" %>"><%= line.gsub(/[<>]/, '<' => '&lt;', '>' => '&gt;') %></p>
103
+ <% elsif line.start_with?("-") %>
104
+ <p style="<%= "background: lightsalmon;" %>"><%= line.gsub(/[<>]/, '<' => '&lt;', '>' => '&gt;') %></p>
105
+ <% else %>
106
+ <p style="background: gainsboro;"><%= line.gsub(/[<>]/,'<' => '&lt;', '>' => '&gt;') %></p>
107
+ <% end %>
108
+ <% end %>
109
+ <% end %>
110
+ </div>
111
+ <br/><br/><br/>
112
+ <% end %>
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,147 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <style>
5
+ /* CSS styles taken from https://github.com/yegor256/tacit */
6
+ th {
7
+ font-weight: 600;
8
+ text-align: left;
9
+ }
10
+
11
+ td {
12
+ vertical-align: top;
13
+ }
14
+
15
+ table tr {
16
+ border-bottom-width: 2.16px
17
+ }
18
+
19
+ table tr th {
20
+ border-bottom-width: 2.16px
21
+ }
22
+
23
+ table tr td, table tr th {
24
+ overflow: hidden; /*padding: 5.4px 3.6px*/
25
+ padding-left: 2px;
26
+ padding-right: 2px;
27
+ }
28
+
29
+ td:nth-child(3) {
30
+ min-width: 120px;
31
+ max-width: 200px;
32
+ }
33
+
34
+ td:nth-child(4) {
35
+ min-width: 300px;
36
+ max-width: 500px;
37
+ }
38
+
39
+ pre, code, kbd, samp, var, output {
40
+ font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
41
+ font-size: 14.4px
42
+ }
43
+
44
+ pre code {
45
+ background: none;
46
+ border: 0;
47
+ line-height: 29.7px;
48
+ padding: 0
49
+ }
50
+
51
+ code, kbd {
52
+ background: #daf1e0;
53
+ border-radius: 3.6px;
54
+ color: #2a6f3b;
55
+ display: inline-block;
56
+ line-height: 18px;
57
+ padding: 3.6px 6.3px 2.7px
58
+ }
59
+
60
+ a {
61
+ color: #275a90;
62
+ text-decoration: none
63
+ }
64
+
65
+ a:hover {
66
+ text-decoration: underline
67
+ }
68
+
69
+ * {
70
+ border: 0;
71
+ border-collapse: separate;
72
+ border-spacing: 0;
73
+ box-sizing: border-box;
74
+ margin: 0;
75
+ max-width: 100%;
76
+ padding: 0;
77
+ vertical-align: baseline;
78
+ font-family: system-ui, "Helvetica Neue", Helvetica, Arial, sans-serif;
79
+ font-size: 13px;
80
+ font-stretch: normal;
81
+ font-style: normal;
82
+ font-weight: 400;
83
+ line-height: 29.7px
84
+ }
85
+
86
+ html, body {
87
+ width: 100%
88
+ }
89
+
90
+ html {
91
+ height: 100%
92
+ }
93
+
94
+ body {
95
+ background: #fff;
96
+ color: #1a1919;
97
+ padding: 36px
98
+ }
99
+
100
+ .msg {
101
+ background: #eff6e8;
102
+ border-radius: 3.6px;
103
+ color: #2a6f3b;
104
+ display: inline-block;
105
+ line-height: 18px;
106
+ padding: 3.6px 6.3px 2.7px
107
+ }
108
+ </style>
109
+ <title>SVN touch</title>
110
+ </head>
111
+ <body>
112
+ <p>Hi,</p>
113
+ <p>The critical file(s) <code><%= files %></code> have been changed recently:</p>
114
+ <table summary="table with svn commits where critical files have been changed">
115
+ <tr>
116
+ <th id="rev">Revision</th>
117
+ <th id="author">Author</th>
118
+ <th id="when">When</th>
119
+ <th id="files">File(s)</th>
120
+ <th id="commit_msg">Commit</th>
121
+ </tr>
122
+ <% entries.each do |e| %>
123
+ <tr>
124
+ <td><a href="<%= commit_url %><%= e.revision %>"><%= e.revision %></a></td>
125
+ <td><a href="<%= user %><%= e.author %>"><%= e.author %></a></td>
126
+ <td><%= Time.strptime(e.date, "%Y-%m-%dT%H:%M").strftime("%Y-%m-%d %H:%M") %></td>
127
+ <td>
128
+ <% if e.paths.path.respond_to? :join %>
129
+ <%= e.paths
130
+ .path
131
+ .map { |file| "<a href='#{commit_url}#{e.revision}'>#{file}</a>" }
132
+ .join("<br/>") %>
133
+ <% else %>
134
+ <a href="<%= commit_url %><%= e.revision %>"><%= e.paths.path %></a>
135
+ <% end %>
136
+ </td>
137
+ <td>
138
+ <div class="msg"><%= e.msg %></div>
139
+ </td>
140
+ </tr>
141
+ <% end %>
142
+ </table>
143
+ <p>Posted by
144
+ <a href="https://github.com/dgroup/lazylead">lazylead v<%= version %></a>.
145
+ </p>
146
+ </body>
147
+ </html>
@@ -1,6 +1,6 @@
1
1
  The MIT License
2
2
 
3
- Copyright (c) 2019-2020 Yurii Dubinka
3
+ Copyright (c) 2019-2021 Yurii Dubinka
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"),
data/readme.md CHANGED
@@ -38,6 +38,7 @@ Join our telegram group [lazylead.org](https://t.me/lazyleads) for discussions.
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) | ✅ | ❌ | ❌ |
41
+ | [Evaluate the ticket formatting accuracy](.docs/accuracy.md) | ✅ | ⌛ | ⌛ |
41
42
  | Print the current capacity of team into newly created tasks | ⌛ | ⌛ | ⌛ |
42
43
  | Create/retrofit the defect automatically into latest release | ⌛ | ⌛ | ❌ |
43
44
  | [Notify about expired(ing) due dates](.docs/duedate_expired.md) | ✅ | ❌ | ⌛ |
@@ -112,13 +113,14 @@ For simplicity, we are using [docker-compose](https://docs.docker.com/compose/):
112
113
  ll > docker-compose -f .github/tasks.yml up
113
114
  Creating lazylead ... done
114
115
  Attaching to lazylead
115
- lazylead | [2020-06-06T10:35:13] DEBUG Memory footprint at start is 52MB
116
- lazylead | [2020-06-06T10:35:13] DEBUG Database: '/lazylead/db/ll.db', sql migration dir: '/lazylead/upgrades/sqlite'
117
- lazylead | [2020-06-06T10:35:13] DEBUG Migration applied to /lazylead/db/ll.db from /lazylead/upgrades/sqlite
118
- lazylead | [2020-06-06T10:35:13] DEBUG Database connection established
119
- lazylead | [2020-06-06T10:35:13] WARN SMTP connection enabled in test mode.
120
- lazylead | [2020-06-06T10:35:13] WARN ll-001: No tasks found.
121
- lazylead | [2020-06-06T10:35:13] DEBUG Memory footprint at the end is 66MB
116
+ lazylead | [2020-08-09T06:17:32] DEBUG [main] Version: 0.5.0
117
+ lazylead | [2020-08-09T06:17:32] DEBUG [main] Memory footprint at start is 52MB
118
+ lazylead | [2020-08-09T06:17:32] DEBUG [main] Database: '/lazylead/db/ll.db', sql migration dir: '/lazylead/upgrades/sqlite'
119
+ lazylead | [2020-08-09T06:17:32] DEBUG [main] Migration applied to /lazylead/db/ll.db from /lazylead/upgrades/sqlite
120
+ lazylead | [2020-08-09T06:17:32] DEBUG [main] Database connection established
121
+ lazylead | [2020-08-09T06:17:32] DEBUG [main] SMTP connection established with {host} as {user}.
122
+ lazylead | [2020-08-09T06:17:32] WARN [main] ll-001: No tasks found.
123
+ lazylead | [2020-08-09T06:17:32] DEBUG [main] Memory footprint at the end is 67MB
122
124
  lazylead exited with code 0
123
125
  ll >
124
126
  ```
@@ -133,16 +135,16 @@ For simplicity, we are using [docker-compose](https://docs.docker.com/compose/):
133
135
  values (1, 'Dream team with lazylead', '{}');
134
136
  insert into systems(id, properties)
135
137
  values (1,'{"type":"Lazylead::Jira", "username":"${jira_user}", "password":"${jira_password}", "site":"${jira_url}", "context_path":""}');
136
- insert into tasks (name, cron, enabled, id, system, team_id, action, properties)
138
+ insert into tasks (name, schedule, enabled, id, system, team_id, action, properties)
137
139
  values ('Expired due dates',
138
- '0 8 * * 1-5',
140
+ 'cron:0 8 * * 1-5',
139
141
  'true',
140
142
  1, 1, 1,
141
143
  'Lazylead::Task::AssigneeAlert',
142
144
  '{"sql":"filter=555", "cc":"<youremail.com>", "subject":"[LL] Expired due dates", "template":"lib/messages/due_date_expired.erb", "postman":"Lazylead::Exchange"}');
143
145
 
144
146
  ```
145
- Yes, for task scheduling we are using [cron](https://crontab.guru).
147
+ Yes, for task scheduling we are using [cron](https://crontab.guru) here, but you may use other scheduling types from [rufus-scheduler](https://github.com/jmettraux/rufus-scheduler).
146
148
 
147
149
  4. Once you changed `./ll.db`, please restart the container using `docker-compose -f .github/tasks.yml restart`
148
150
  ```bash
@@ -152,15 +154,14 @@ For simplicity, we are using [docker-compose](https://docs.docker.com/compose/):
152
154
  check the logs and stop container if needed
153
155
  ```bash
154
156
  ll > docker logs lazylead
155
- 2020-06-06T11:37:36] DEBUG Memory footprint at start is 52MB
156
- [2020-06-06T11:37:37] DEBUG Database: '/lazylead/db/ll.db', sql migration dir: '/lazylead/upgrades/sqlite'
157
- [2020-06-06T11:37:37] DEBUG Migration applied to /lazylead/db/ll.db from /lazylead/upgrades/sqlite
158
- [2020-06-06T11:37:37] DEBUG Database connection established
159
- [2020-06-06T11:37:37] WARN SMTP connection enabled in test mode.
160
- [2020-06-06T11:37:37] DEBUG Task scheduled: id='1', name='Expired due dates', cron='0 8 * * 1-5', system='1', action='Lazylead::Task::AssigneeAlert', team_id='1', description='', enabled='true', properties='{"sql":"filter=555", "cc":"my.email@google.com", "subject":"[LL] Expired due dates", "template":"lib/messages/due_date_expired.erb", "postman":"Lazylead::Exchange"}'
157
+ lazylead | [2020-08-09T06:17:32] DEBUG [main] Version: 0.5.0
158
+ lazylead | [2020-08-09T06:17:32] DEBUG [main] Memory footprint at start is 52MB
159
+ lazylead | [2020-08-09T06:17:32] DEBUG [main] Database: '/lazylead/db/ll.db', sql migration dir: '/lazylead/upgrades/sqlite'
160
+ lazylead | [2020-08-09T06:17:32] DEBUG [main] Migration applied to /lazylead/db/ll.db from /lazylead/upgrades/sqlite
161
+ lazylead | [2020-08-09T06:17:32] DEBUG [main] Database connection established
162
+ lazylead | [2020-08-09T06:17:32] DEBUG [main] SMTP connection established with {host} as {user}.
163
+ lazylead | [2020-08-09T06:17:32] DEBUG [main] Task scheduled: id='1', name='Expired due dates', cron='0 8 * * 1-5', system='1', action='Lazylead::Task::AssigneeAlert', team_id='1', description='', enabled='true', properties='{"sql":"filter=555", "cc":"my.email@google.com", "subject":"[LL] Expired due dates", "template":"lib/messages/due_date_expired.erb", "postman":"Lazylead::Exchange"}'
161
164
  ...
162
- ll > docker stop lazylead
163
- lazylead
164
165
  ```
165
166
 
166
167
  ### How to contribute?
@@ -173,4 +174,4 @@ bundle exec rake
173
174
  Everyone interacting in this project’s codebases, issue trackers, chat rooms is expected to follow the [code of conduct](.github/CODE_OF_CONDUCT.md).
174
175
 
175
176
  Contributors:
176
- * [dgroup](https://github.com/dgroup) as Yurii Dubinka (yurii.dubinka@gmail.com)
177
+ * [dgroup](https://github.com/dgroup) as Yurii Dubinka ([yurii.dubinka@gmail.com](mailto:yurii.dubinka@gmail.com))
@@ -129,7 +129,7 @@ module Lazylead
129
129
  end
130
130
 
131
131
  test "detect plain cc" do
132
- CLI::App.new(Log::NOTHING, NoSchedule.new).run(
132
+ CLI::App.new(Log.new, NoSchedule.new).run(
133
133
  home: ".",
134
134
  sqlite: "test/resources/#{no_ext(__FILE__)}.#{__method__}.db",
135
135
  vcs4sql: "upgrades/sqlite",
@@ -140,7 +140,7 @@ module Lazylead
140
140
  end
141
141
 
142
142
  test "detect complex cc by predefined component" do
143
- CLI::App.new(Log::NOTHING, NoSchedule.new).run(
143
+ CLI::App.new(Log.new, NoSchedule.new).run(
144
144
  home: ".",
145
145
  sqlite: "test/resources/#{no_ext(__FILE__)}.#{__method__}.db",
146
146
  vcs4sql: "upgrades/sqlite",
@@ -31,7 +31,7 @@ module Lazylead
31
31
  module CLI
32
32
  class AppTest < Lazylead::SqliteTest
33
33
  test "LL database structure installed successfully" do
34
- CLI::App.new(Log::NOTHING, NoSchedule.new).run(
34
+ CLI::App.new(Log.new, NoSchedule.new).run(
35
35
  home: ".",
36
36
  sqlite: "test/resources/#{no_ext(__FILE__)}.#{__method__}.db",
37
37
  vcs4sql: "upgrades/sqlite"
@@ -39,14 +39,14 @@ module Lazylead
39
39
  assert_tables "test/resources/#{no_ext(__FILE__)}.#{__method__}.db",
40
40
  systems: %w[id properties],
41
41
  teams: %w[id name properties],
42
- tasks: %w[id name cron system action team_id enabled properties]
42
+ tasks: %w[id name schedule system action team_id enabled properties]
43
43
  assert_fk "test/resources/#{no_ext(__FILE__)}.#{__method__}.db",
44
44
  %w[tasks team_id teams id],
45
45
  %w[tasks system systems id]
46
46
  end
47
47
 
48
48
  test "activesupport is activated for access to domain entities" do
49
- CLI::App.new(Log::NOTHING, Schedule.new(Log::NOTHING, false)).run(
49
+ CLI::App.new(Log.new, NoSchedule.new).run(
50
50
  home: ".",
51
51
  sqlite: "test/resources/#{no_ext(__FILE__)}.#{__method__}.db",
52
52
  vcs4sql: "upgrades/sqlite",
@@ -57,16 +57,16 @@ module Lazylead
57
57
  "Required team record wasn't found in the database"
58
58
  end
59
59
 
60
- # @todo #10/DEV Think about using "timecop" >v0.9.1 gem in order to make
61
- # E2E application skeleton https://stackoverflow.com/questions/59955571.
62
- # The depedency for gemspec should be after *thin* in .gemspec
63
- # ..
64
- # s.add_runtime_dependency "thin", "1.7.2"
65
- # s.add_runtime_dependency "timecop", "0.9.1"
66
- # ..
67
- # More https://github.com/travisjeffery/timecop
68
60
  test "scheduled task was triggered successfully" do
69
- skip "Not implemented yet"
61
+ CLI::App.new(Log.new, Schedule.new(cling: false)).run(
62
+ home: ".",
63
+ sqlite: "test/resources/#{no_ext(__FILE__)}.#{__method__}.db",
64
+ vcs4sql: "upgrades/sqlite",
65
+ testdata: true
66
+ )
67
+ sleep 0.4
68
+ assert (Time.now - 5.seconds) < Time.parse(File.open("test/resources/echo.txt").first),
69
+ "Scheduled task wasn't executed few seconds ago"
70
70
  end
71
71
  end
72
72
  end
@@ -36,7 +36,7 @@ module Lazylead
36
36
  "exchange_user",
37
37
  "exchange_password",
38
38
  "exchange_to"
39
- Exchange.new(Log::NOTHING, NoSalt.new).send(
39
+ Exchange.new(Log.new, NoSalt.new).send(
40
40
  to: ENV["exchange_to"],
41
41
  tickets: NoAuthJira.new("https://jira.spring.io")
42
42
  .issues("key = DATAJDBC-480"),
@@ -52,7 +52,7 @@ module Lazylead
52
52
  "enc_exchange_psw",
53
53
  "enc_exchange_to"
54
54
  Exchange.new(
55
- Log::NOTHING,
55
+ Log.new,
56
56
  Salt.new("exchange_salt"),
57
57
  "exchange_url" => ENV["exchange_url"],
58
58
  "exchange_user" => ENV["enc_exchange_usr"],
@@ -72,7 +72,7 @@ module Lazylead
72
72
  "exchange_password",
73
73
  "exchange_to"
74
74
  Exchange.new(
75
- Log::NOTHING,
75
+ Log.new,
76
76
  Salt.new("exchange_salt"),
77
77
  "exchange_url" => ENV["exchange_url"],
78
78
  "exchange_user" => ENV["enc_exchange_usr"],
@@ -31,7 +31,7 @@ require_relative "../../lib/lazylead/schedule"
31
31
  module Lazylead
32
32
  class OrmTest < Lazylead::SqliteTest
33
33
  test "convert column to json" do
34
- CLI::App.new(Log::NOTHING, NoSchedule.new).run(
34
+ CLI::App.new(Log.new, NoSchedule.new).run(
35
35
  home: ".",
36
36
  sqlite: "test/resources/#{no_ext(__FILE__)}.#{__method__}.db",
37
37
  vcs4sql: "upgrades/sqlite",
@@ -42,7 +42,7 @@ module Lazylead
42
42
 
43
43
  test "env properties injected" do
44
44
  ENV["usr"] = "Mike"
45
- CLI::App.new(Log::NOTHING, NoSchedule.new).run(
45
+ CLI::App.new(Log.new, NoSchedule.new).run(
46
46
  home: ".",
47
47
  sqlite: "test/resources/#{no_ext(__FILE__)}.#{__method__}.db",
48
48
  vcs4sql: "upgrades/sqlite",
@@ -53,7 +53,7 @@ module Lazylead
53
53
  end
54
54
 
55
55
  test "postman initiated through orm" do
56
- CLI::App.new(Log::NOTHING, NoSchedule.new).run(
56
+ CLI::App.new(Log.new, NoSchedule.new).run(
57
57
  home: ".",
58
58
  sqlite: "test/resources/#{no_ext(__FILE__)}.#{__method__}.db",
59
59
  vcs4sql: "upgrades/sqlite",
@@ -64,7 +64,7 @@ module Lazylead
64
64
 
65
65
  test "task properties are using ENV variables" do
66
66
  ENV["key171"] = "value"
67
- CLI::App.new(Log::NOTHING, NoSchedule.new).run(
67
+ CLI::App.new(Log.new, NoSchedule.new).run(
68
68
  home: ".",
69
69
  sqlite: "test/resources/#{no_ext(__FILE__)}.#{__method__}.db",
70
70
  vcs4sql: "upgrades/sqlite",