dynflow 0.8.34 → 0.8.35
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/action/with_bulk_sub_plans.rb +1 -1
- data/lib/dynflow/delayed_executors/abstract_core.rb +2 -1
- data/lib/dynflow/execution_plan/steps/abstract.rb +9 -1
- data/lib/dynflow/version.rb +1 -1
- data/test/action_test.rb +7 -1
- data/test/semaphores_test.rb +2 -2
- data/test/test_helper.rb +4 -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: 290e1bf999cae6f5ced255f29c2b62bc5d1fb53d75a0184ca514afbd3deb9c04
|
4
|
+
data.tar.gz: 7e4bdad4c493342902070fa5f694569ff3cd1906c648bc403b47dccb03654646
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 50250e41adda66f5f8069378d916fa1a58771076420806aa9185bbd2467a36acb038aeda64f3d7757c43801796c2507e23e062307bb40e9fd5ddaed18c0a5236
|
7
|
+
data.tar.gz: 0aeae17937111257652845446f8ea5726d735651a57dd3d915f74e943a785566eb9340b5e1356e45bac86c2fe15033dff2e6b8fab50ae17aa05abe2bc32e4749
|
@@ -58,7 +58,7 @@ module Dynflow
|
|
58
58
|
|
59
59
|
# The same logic as in Action::WithSubPlans, but calculated using the expected total count
|
60
60
|
def run_progress
|
61
|
-
if counts_set?
|
61
|
+
if counts_set? && total_count > 0
|
62
62
|
sum = output.values_at(:success_count, :cancelled_count, :failed_count).reduce(:+)
|
63
63
|
sum.to_f / total_count
|
64
64
|
else
|
@@ -154,11 +154,19 @@ module Dynflow
|
|
154
154
|
@started_at ||= start
|
155
155
|
block.call
|
156
156
|
ensure
|
157
|
-
|
157
|
+
calculate_progress(action)
|
158
158
|
@ended_at = Time.now
|
159
159
|
@execution_time += @ended_at - start
|
160
160
|
@real_time = @ended_at - @started_at
|
161
161
|
end
|
162
|
+
|
163
|
+
def calculate_progress(action)
|
164
|
+
@progress_done, @progress_weight = action.calculated_progress
|
165
|
+
if @progress_done.is_a?(Float) && !@progress_done.finite?
|
166
|
+
action_logger.error("Unexpected progress value #{@progress_done} for step #{execution_plan_id}##{id}")
|
167
|
+
@progress_done = 0
|
168
|
+
end
|
169
|
+
end
|
162
170
|
end
|
163
171
|
end
|
164
172
|
end
|
data/lib/dynflow/version.rb
CHANGED
data/test/action_test.rb
CHANGED
@@ -619,6 +619,7 @@ module Dynflow
|
|
619
619
|
|
620
620
|
describe ::Dynflow::Action::WithPollingSubPlans do
|
621
621
|
include TestHelpers
|
622
|
+
include Testing
|
622
623
|
|
623
624
|
let(:clock) { Dynflow::Testing::ManagedClock.new }
|
624
625
|
|
@@ -627,8 +628,8 @@ module Dynflow
|
|
627
628
|
total = 2
|
628
629
|
plan = world.plan(PollingParentAction, count: total)
|
629
630
|
plan.state.must_equal :planned
|
630
|
-
world.execute(plan.id)
|
631
631
|
clock.pending_pings.count.must_equal 0
|
632
|
+
world.execute(plan.id)
|
632
633
|
wait_for do
|
633
634
|
plan.sub_plans_count == total &&
|
634
635
|
plan.sub_plans.all? { |sub| sub.result == :success }
|
@@ -674,6 +675,11 @@ module Dynflow
|
|
674
675
|
end
|
675
676
|
end
|
676
677
|
|
678
|
+
it 'handles empty sub plans when calculating progress' do
|
679
|
+
action = create_and_plan_action(PollingBulkParentAction, :count => 0)
|
680
|
+
action.run_progress.must_equal 0.1
|
681
|
+
end
|
682
|
+
|
677
683
|
describe ::Dynflow::Action::Singleton do
|
678
684
|
include TestHelpers
|
679
685
|
|
data/test/semaphores_test.rb
CHANGED
@@ -61,7 +61,7 @@ module Dynflow
|
|
61
61
|
end
|
62
62
|
|
63
63
|
describe ::Dynflow::Semaphores::Aggregating do
|
64
|
-
let(:
|
64
|
+
let(:semaphore_class) { ::Dynflow::Semaphores::Aggregating }
|
65
65
|
let(:child_class) { ::Dynflow::Semaphores::Stateful }
|
66
66
|
let(:children) do
|
67
67
|
{
|
@@ -77,7 +77,7 @@ module Dynflow
|
|
77
77
|
end
|
78
78
|
|
79
79
|
it 'can be used as counter' do
|
80
|
-
semaphore =
|
80
|
+
semaphore = semaphore_class.new(children)
|
81
81
|
assert_semaphore_state semaphore, 3, 2
|
82
82
|
semaphore.get.must_equal 1
|
83
83
|
assert_semaphore_state semaphore, 2, 1
|
data/test/test_helper.rb
CHANGED
@@ -2,6 +2,7 @@ require 'bundler/setup'
|
|
2
2
|
require 'minitest/reporters'
|
3
3
|
require 'minitest/autorun'
|
4
4
|
require 'minitest/spec'
|
5
|
+
ENV['MT_NO_PLUGINS'] = 'true'
|
5
6
|
|
6
7
|
MiniTest::Reporters.use! if ENV['RM_INFO']
|
7
8
|
|
@@ -192,8 +193,10 @@ module TestHelpers
|
|
192
193
|
executor_id_for_plan(triggered.id)
|
193
194
|
end
|
194
195
|
|
196
|
+
plan = client_world.persistence.load_execution_plan(triggered.id)
|
197
|
+
step = plan.steps.values.last
|
195
198
|
wait_for do
|
196
|
-
client_world.persistence.
|
199
|
+
client_world.persistence.load_step(step.execution_plan_id, step.id, client_world).state == :suspended
|
197
200
|
end
|
198
201
|
|
199
202
|
executor = WorldFactory.created_worlds.find { |e| e.id == executor_id }
|
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: 0.8.
|
4
|
+
version: 0.8.35
|
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:
|
12
|
+
date: 2018-02-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: multi_json
|
@@ -594,7 +594,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
594
594
|
version: '0'
|
595
595
|
requirements: []
|
596
596
|
rubyforge_project:
|
597
|
-
rubygems_version: 2.
|
597
|
+
rubygems_version: 2.7.3
|
598
598
|
signing_key:
|
599
599
|
specification_version: 4
|
600
600
|
summary: DYNamic workFLOW engine
|