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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: '085cf607bfa2da0da617fa6d5b02b44db8ffc038'
4
- data.tar.gz: d212611e59f46a686277f7318795239d5f36c109
2
+ SHA256:
3
+ metadata.gz: e36392c5ebe5f3a20b879eca68d46ff0ee715985d7107af64f69b4ef256bf19e
4
+ data.tar.gz: 3177acf84d594013c47f5a6413fc56f47dbb121727c5549948ef2f30ec2099de
5
5
  SHA512:
6
- metadata.gz: bd10ae9a1ccc68899f6723f646c7f32c9bb0d7ad5b463d94cdceed56a61ab42c83412206bd6e73f6983d627b4b2c58bcaf504676b9a3a4dce69781d4f90e2637
7
- data.tar.gz: e08f5bac717d9898ebcbbbe12d79eedc2cc5175cbe911e57a79db65f24c9889b5a018e9220c3361baa4c1c23178c72684171fefb8d925729f980745218a5df03
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
 
@@ -1,3 +1,3 @@
1
1
  module Dynflow
2
- VERSION = '1.0.4'.freeze
2
+ VERSION = '1.0.5'.freeze
3
3
  end
@@ -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
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-08 00:00:00.000000000 Z
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.6.12
605
+ rubygems_version: 2.7.3
606
606
  signing_key:
607
607
  specification_version: 4
608
608
  summary: DYNamic workFLOW engine