dynflow 1.0.4 → 1.0.5
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 +5 -5
- data/lib/dynflow/active_job/queue_adapter.rb +6 -2
- data/lib/dynflow/version.rb +1 -1
- data/test/activejob_adapter_test.rb +10 -3
- data/web/views/index.erb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: e36392c5ebe5f3a20b879eca68d46ff0ee715985d7107af64f69b4ef256bf19e
|
4
|
+
data.tar.gz: 3177acf84d594013c47f5a6413fc56f47dbb121727c5549948ef2f30ec2099de
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 41e469d615fb041a1323b6d512f31b57aafe55de76b35212b1d615e249822214aeda51f5710221932d4d7e78aae9515f500f80278b7d056f42403c24a28cdd31
|
7
|
+
data.tar.gz: b7a202cf192a9d7af21e556971876867f180eb2a6319cd624075af854bb2a64ed0cd12435076261dc71aad4439ff01ebc3c2216799f85d0dbff30e0d495658d7
|
@@ -3,11 +3,15 @@ module Dynflow
|
|
3
3
|
module QueueAdapters
|
4
4
|
module QueueMethods
|
5
5
|
def enqueue(job)
|
6
|
-
::Rails.application.dynflow.world.trigger(JobWrapper, job.serialize)
|
6
|
+
::Rails.application.dynflow.world.trigger(JobWrapper, job.serialize).tap do |plan|
|
7
|
+
job.provider_job_id = plan.id
|
8
|
+
end
|
7
9
|
end
|
8
10
|
|
9
11
|
def enqueue_at(job, timestamp)
|
10
|
-
::Rails.application.dynflow.world.delay(JobWrapper, { :start_at => Time.at(timestamp) }, job.serialize)
|
12
|
+
::Rails.application.dynflow.world.delay(JobWrapper, { :start_at => Time.at(timestamp) }, job.serialize).tap do |plan|
|
13
|
+
job.provider_job_id = plan.id
|
14
|
+
end
|
11
15
|
end
|
12
16
|
end
|
13
17
|
|
data/lib/dynflow/version.rb
CHANGED
@@ -12,8 +12,11 @@ module Dynflow
|
|
12
12
|
end
|
13
13
|
|
14
14
|
describe 'running jobs' do
|
15
|
+
let :world do
|
16
|
+
WorldFactory.create_world
|
17
|
+
end
|
18
|
+
|
15
19
|
before(:all) do
|
16
|
-
world = WorldFactory.create_world
|
17
20
|
::ActiveJob::QueueAdapters.send(:include, ::Dynflow::ActiveJob::QueueAdapters)
|
18
21
|
::ActiveJob::Base.queue_adapter = :dynflow
|
19
22
|
dynflow_mock = Minitest::Mock.new
|
@@ -42,16 +45,20 @@ module Dynflow
|
|
42
45
|
end
|
43
46
|
|
44
47
|
it 'enqueues the job' do
|
48
|
+
job = nil
|
45
49
|
out, = capture_subprocess_io do
|
46
|
-
SampleJob.perform_later 'hello'
|
50
|
+
job = SampleJob.perform_later 'hello'
|
47
51
|
end
|
52
|
+
assert world.persistence.load_execution_plan(job.provider_job_id)
|
48
53
|
assert_match(/Enqueued Dynflow::SampleJob/, out)
|
49
54
|
end
|
50
55
|
|
51
56
|
it 'schedules job in the future' do
|
57
|
+
job = nil
|
52
58
|
out, = capture_subprocess_io do
|
53
|
-
SampleJob.set(:wait => 1.seconds).perform_later 'hello'
|
59
|
+
job = SampleJob.set(:wait => 1.seconds).perform_later 'hello'
|
54
60
|
end
|
61
|
+
assert world.persistence.load_execution_plan(job.provider_job_id)
|
55
62
|
assert_match(/Enqueued Dynflow::SampleJob.*at.*UTC/, out)
|
56
63
|
end
|
57
64
|
end
|
data/web/views/index.erb
CHANGED
@@ -20,7 +20,7 @@
|
|
20
20
|
<% @plans.each do |plan| %>
|
21
21
|
<tr>
|
22
22
|
<td><%= h(plan.id) %></td>
|
23
|
-
<td><%= h(plan.label || plan.root_plan_step.action_class.name) %></td>
|
23
|
+
<td><%= h(plan.label || (plan.root_plan_step && plan.root_plan_step.action_class.name)) %></td>
|
24
24
|
<th><%= h(plan.state) %></th>
|
25
25
|
<th><%= h(plan.result) %></th>
|
26
26
|
<th><%= h(plan.started_at) %></th>
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dynflow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ivan Necas
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-06-
|
12
|
+
date: 2018-06-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: multi_json
|
@@ -602,7 +602,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
602
602
|
version: '0'
|
603
603
|
requirements: []
|
604
604
|
rubyforge_project:
|
605
|
-
rubygems_version: 2.
|
605
|
+
rubygems_version: 2.7.3
|
606
606
|
signing_key:
|
607
607
|
specification_version: 4
|
608
608
|
summary: DYNamic workFLOW engine
|