foreman-tasks 8.0.0 → 8.0.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c20057a80b1bb1d9bed71d8363714629ca6daeb5f7fab04a101096733e1af031
|
4
|
+
data.tar.gz: 3e8b4ac765c89c95961f2bb9bf62aa2fb5a957a0422b300523457d41f9514973
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0dfabca75eaa8a0a1ac0cb2fab181643f8485095499b64b75f4d4bcdfec05497e97d436c83f0883ec8a95bf458a9f38e7459243f24e72c905dc114055f108831
|
7
|
+
data.tar.gz: 119368e5d1f23cac73a2ddccf37d5157113d4674bd7da1a61320195c8112d4321f15856a7d06580bbef032c2035c00cfef8732bfb5fcd09f400a5ce4e5cffde7
|
@@ -96,7 +96,7 @@ module ForemanTasks
|
|
96
96
|
end
|
97
97
|
|
98
98
|
def next_occurrence_time(time = Time.zone.now)
|
99
|
-
@parser ||= Fugit.
|
99
|
+
@parser ||= Fugit.do_parse_cron(cron_line)
|
100
100
|
# @parser.next(start_time) is not inclusive of the start_time hence stepping back one run to include checking start_time for the first run.
|
101
101
|
before_next = @parser.next_time(@parser.previous_time(time.iso8601))
|
102
102
|
return before_next.utc.localtime if before_next >= time && tasks.count == 0
|
@@ -54,6 +54,17 @@ class RecurringLogicsTest < ActiveSupport::TestCase
|
|
54
54
|
_(ForemanTasks::RecurringLogic.cronline_hash(:monthly, time_hash, days, days_of_week)).must_equal expected_result_monthly
|
55
55
|
end
|
56
56
|
|
57
|
+
it 'validates cronline correctly' do
|
58
|
+
recurring_logic = ::ForemanTasks::RecurringLogic.new_from_cronline('* * * * abc')
|
59
|
+
assert_not recurring_logic.valid_cronline?
|
60
|
+
recurring_logic = ::ForemanTasks::RecurringLogic.new_from_cronline(nil)
|
61
|
+
assert_not recurring_logic.valid_cronline?
|
62
|
+
recurring_logic = ::ForemanTasks::RecurringLogic.new_from_cronline('* * * * *')
|
63
|
+
assert recurring_logic.valid_cronline?
|
64
|
+
recurring_logic = ::ForemanTasks::RecurringLogic.new_from_cronline('0 22 * * mon-fri')
|
65
|
+
assert recurring_logic.valid_cronline?
|
66
|
+
end
|
67
|
+
|
57
68
|
it 'can have limited number of repeats' do
|
58
69
|
parser = ForemanTasks::RecurringLogic.new_from_cronline('* * * * *')
|
59
70
|
parser.state = 'active'
|