aws-flow 2.4.0 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/aws-flow.gemspec +1 -0
- data/lib/aws/decider.rb +0 -1
- data/lib/aws/decider/starter.rb +6 -8
- data/lib/aws/decider/utilities.rb +6 -0
- data/lib/aws/decider/version.rb +1 -1
- data/lib/aws/decider/worker.rb +6 -0
- data/lib/aws/flow/future.rb +86 -6
- data/lib/aws/flow/implementation.rb +84 -13
- data/lib/aws/runner.rb +1 -1
- data/lib/aws/templates.rb +2 -0
- data/lib/aws/templates/activity.rb +41 -0
- data/lib/aws/templates/default.rb +11 -8
- data/lib/aws/templates/result.rb +183 -0
- data/lib/aws/templates/starter.rb +152 -226
- data/lib/aws/templates/utilities.rb +59 -0
- data/spec/aws/decider/integration/activity_spec.rb +1 -0
- data/spec/aws/decider/integration/options_spec.rb +16 -9
- data/spec/aws/decider/integration/starter_spec.rb +6 -7
- data/spec/aws/decider/unit/starter_spec.rb +2 -2
- data/spec/aws/decider/unit/worker_spec.rb +42 -0
- data/spec/aws/flow/{async_backtrace_spec.rb → unit/async_backtrace_spec.rb} +0 -0
- data/spec/aws/flow/{async_scope_spec.rb → unit/async_scope_spec.rb} +0 -0
- data/spec/aws/flow/{begin_rescue_ensure_spec.rb → unit/begin_rescue_ensure_spec.rb} +0 -0
- data/spec/aws/flow/unit/external_condition_variable_spec.rb +59 -0
- data/spec/aws/flow/{external_task_spec.rb → unit/external_task_spec.rb} +0 -0
- data/spec/aws/flow/{factories.rb → unit/factories.rb} +0 -0
- data/spec/aws/flow/{fiber_condition_variable_spec.rb → unit/fiber_condition_variable_spec.rb} +0 -0
- data/spec/aws/flow/{fiber_spec.rb → unit/fiber_spec.rb} +0 -0
- data/spec/aws/flow/{flow_spec.rb → unit/flow_spec.rb} +0 -0
- data/spec/aws/flow/{future_spec.rb → unit/future_spec.rb} +188 -0
- data/spec/aws/flow/{simple_dfa_spec.rb → unit/simple_dfa_spec.rb} +0 -0
- data/spec/aws/runner/integration/runner_integration_spec.rb +1 -0
- data/spec/aws/runner/unit/runner_unit_spec.rb +3 -3
- data/spec/aws/templates/unit/activity_spec.rb +9 -10
- data/spec/aws/templates/unit/base_spec.rb +10 -11
- data/spec/aws/templates/unit/default_spec.rb +23 -6
- data/spec/aws/templates/unit/result_spec.rb +130 -0
- data/spec/aws/templates/unit/starter_spec.rb +32 -105
- data/spec/aws/templates/unit/utilities_spec.rb +80 -0
- metadata +19 -13
@@ -0,0 +1,80 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe AWS::Flow::Templates::Utils do
|
4
|
+
|
5
|
+
context "#register_on_failure" do
|
6
|
+
|
7
|
+
it "calls the register_default methods on failure and calls the block again" do
|
8
|
+
|
9
|
+
block = double
|
10
|
+
expect(block).to receive(:test).once.and_raise(AWS::SimpleWorkflow::Errors::UnknownResourceFault)
|
11
|
+
expect(block).to receive(:test).once
|
12
|
+
|
13
|
+
expect(AWS::Flow::Templates::Utils).to receive(:register_defaults).with("foo")
|
14
|
+
AWS::Flow::Templates::Utils.register_on_failure("foo") { block.test }
|
15
|
+
|
16
|
+
end
|
17
|
+
|
18
|
+
it "calls the block once if no failure" do
|
19
|
+
|
20
|
+
block = double
|
21
|
+
expect(block).to receive(:test).once
|
22
|
+
|
23
|
+
AWS::Flow::Templates::Utils.register_on_failure("foo") { block.test }
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
27
|
+
|
28
|
+
context "#register_defaults" do
|
29
|
+
|
30
|
+
it "registers default workflow and activity in default domain" do
|
31
|
+
expect(AWS::Flow::Utilities).to receive(:register_domain) do |x|
|
32
|
+
x.should == FlowConstants.defaults[:domain]
|
33
|
+
end
|
34
|
+
|
35
|
+
expect(AWS::Flow::Templates::Utils).to receive(:register_default_workflow)
|
36
|
+
expect(AWS::Flow::Templates::Utils).to receive(:register_default_result_activity)
|
37
|
+
AWS::Flow::Templates::Utils.register_defaults
|
38
|
+
end
|
39
|
+
|
40
|
+
it "registers default workflow and activity in a non default domain" do
|
41
|
+
expect(AWS::Flow::Utilities).to receive(:register_domain) do |x|
|
42
|
+
x.should == "foo"
|
43
|
+
end
|
44
|
+
|
45
|
+
expect(AWS::Flow::Templates::Utils).to receive(:register_default_workflow)
|
46
|
+
expect(AWS::Flow::Templates::Utils).to receive(:register_default_result_activity)
|
47
|
+
AWS::Flow::Templates::Utils.register_defaults("foo")
|
48
|
+
end
|
49
|
+
|
50
|
+
end
|
51
|
+
|
52
|
+
context "#register_default_workflow" do
|
53
|
+
|
54
|
+
it "registers the default workflow" do
|
55
|
+
domain = double
|
56
|
+
allow(domain).to receive(:client).and_return(domain)
|
57
|
+
expect_any_instance_of(AWS::Flow::WorkflowWorker).to receive(:add_implementation) do |k|
|
58
|
+
k.should == AWS::Flow::Templates.const_get("#{FlowConstants.defaults[:prefix_name]}")
|
59
|
+
end
|
60
|
+
expect_any_instance_of(AWS::Flow::WorkflowWorker).to receive(:register)
|
61
|
+
AWS::Flow::Templates::Utils.register_default_workflow(domain)
|
62
|
+
end
|
63
|
+
|
64
|
+
end
|
65
|
+
|
66
|
+
context "#register_default_result_activity" do
|
67
|
+
|
68
|
+
it "registers the default result activity" do
|
69
|
+
domain = double
|
70
|
+
allow(domain).to receive(:client).and_return(domain)
|
71
|
+
expect_any_instance_of(AWS::Flow::ActivityWorker).to receive(:add_implementation) do |k|
|
72
|
+
k.should == AWS::Flow::Templates.const_get("#{FlowConstants.defaults[:result_activity_prefix]}")
|
73
|
+
end
|
74
|
+
expect_any_instance_of(AWS::Flow::ActivityWorker).to receive(:register)
|
75
|
+
AWS::Flow::Templates::Utils.register_default_result_activity(domain)
|
76
|
+
end
|
77
|
+
|
78
|
+
end
|
79
|
+
|
80
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aws-flow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Steger, Paritosh Mohan, Jacques Thomas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-02-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-v1
|
@@ -108,7 +108,9 @@ files:
|
|
108
108
|
- lib/aws/templates/activity.rb
|
109
109
|
- lib/aws/templates/base.rb
|
110
110
|
- lib/aws/templates/default.rb
|
111
|
+
- lib/aws/templates/result.rb
|
111
112
|
- lib/aws/templates/starter.rb
|
113
|
+
- lib/aws/templates/utilities.rb
|
112
114
|
- lib/aws/utils.rb
|
113
115
|
- spec/aws/decider/integration/activity_spec.rb
|
114
116
|
- spec/aws/decider/integration/data_converter_spec.rb
|
@@ -130,16 +132,17 @@ files:
|
|
130
132
|
- spec/aws/decider/unit/starter_spec.rb
|
131
133
|
- spec/aws/decider/unit/worker_spec.rb
|
132
134
|
- spec/aws/decider/unit/workflow_client_spec.rb
|
133
|
-
- spec/aws/flow/async_backtrace_spec.rb
|
134
|
-
- spec/aws/flow/async_scope_spec.rb
|
135
|
-
- spec/aws/flow/begin_rescue_ensure_spec.rb
|
136
|
-
- spec/aws/flow/
|
137
|
-
- spec/aws/flow/
|
138
|
-
- spec/aws/flow/
|
139
|
-
- spec/aws/flow/
|
140
|
-
- spec/aws/flow/
|
141
|
-
- spec/aws/flow/
|
142
|
-
- spec/aws/flow/
|
135
|
+
- spec/aws/flow/unit/async_backtrace_spec.rb
|
136
|
+
- spec/aws/flow/unit/async_scope_spec.rb
|
137
|
+
- spec/aws/flow/unit/begin_rescue_ensure_spec.rb
|
138
|
+
- spec/aws/flow/unit/external_condition_variable_spec.rb
|
139
|
+
- spec/aws/flow/unit/external_task_spec.rb
|
140
|
+
- spec/aws/flow/unit/factories.rb
|
141
|
+
- spec/aws/flow/unit/fiber_condition_variable_spec.rb
|
142
|
+
- spec/aws/flow/unit/fiber_spec.rb
|
143
|
+
- spec/aws/flow/unit/flow_spec.rb
|
144
|
+
- spec/aws/flow/unit/future_spec.rb
|
145
|
+
- spec/aws/flow/unit/simple_dfa_spec.rb
|
143
146
|
- spec/aws/replayer/integration/replayer_spec.rb
|
144
147
|
- spec/aws/replayer/unit/replayer_spec.rb
|
145
148
|
- spec/aws/runner/integration/runner_integration_spec.rb
|
@@ -147,10 +150,13 @@ files:
|
|
147
150
|
- spec/aws/templates/unit/activity_spec.rb
|
148
151
|
- spec/aws/templates/unit/base_spec.rb
|
149
152
|
- spec/aws/templates/unit/default_spec.rb
|
153
|
+
- spec/aws/templates/unit/result_spec.rb
|
150
154
|
- spec/aws/templates/unit/starter_spec.rb
|
155
|
+
- spec/aws/templates/unit/utilities_spec.rb
|
151
156
|
- spec/spec_helper.rb
|
152
157
|
homepage: https://aws.amazon.com/swf/details/flow/
|
153
|
-
licenses:
|
158
|
+
licenses:
|
159
|
+
- Apache-2.0
|
154
160
|
metadata: {}
|
155
161
|
post_install_message:
|
156
162
|
rdoc_options: []
|