aws-flow 2.3.1 → 2.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +8 -8
  2. data/aws-flow.gemspec +3 -2
  3. data/bin/aws-flow-ruby +1 -1
  4. data/bin/aws-flow-utils +5 -0
  5. data/lib/aws/decider.rb +7 -0
  6. data/lib/aws/decider/async_retrying_executor.rb +1 -1
  7. data/lib/aws/decider/data_converter.rb +161 -0
  8. data/lib/aws/decider/decider.rb +27 -14
  9. data/lib/aws/decider/flow_defaults.rb +28 -0
  10. data/lib/aws/decider/implementation.rb +0 -1
  11. data/lib/aws/decider/options.rb +2 -2
  12. data/lib/aws/decider/starter.rb +207 -0
  13. data/lib/aws/decider/task_poller.rb +4 -4
  14. data/lib/aws/decider/utilities.rb +38 -0
  15. data/lib/aws/decider/version.rb +1 -1
  16. data/lib/aws/decider/worker.rb +8 -7
  17. data/lib/aws/decider/workflow_definition_factory.rb +1 -1
  18. data/lib/aws/runner.rb +146 -65
  19. data/lib/aws/templates.rb +4 -0
  20. data/lib/aws/templates/activity.rb +69 -0
  21. data/lib/aws/templates/base.rb +87 -0
  22. data/lib/aws/templates/default.rb +146 -0
  23. data/lib/aws/templates/starter.rb +256 -0
  24. data/lib/aws/utils.rb +270 -0
  25. data/spec/aws/decider/integration/activity_spec.rb +7 -1
  26. data/spec/aws/decider/integration/data_converter_spec.rb +39 -0
  27. data/spec/aws/decider/integration/integration_spec.rb +12 -5
  28. data/spec/aws/decider/integration/options_spec.rb +23 -9
  29. data/spec/aws/decider/integration/starter_spec.rb +209 -0
  30. data/spec/aws/decider/unit/data_converter_spec.rb +276 -0
  31. data/spec/aws/decider/unit/decider_spec.rb +1360 -1386
  32. data/spec/aws/decider/unit/options_spec.rb +21 -22
  33. data/spec/aws/decider/unit/retry_spec.rb +8 -0
  34. data/spec/aws/decider/unit/starter_spec.rb +159 -0
  35. data/spec/aws/runner/integration/runner_integration_spec.rb +2 -3
  36. data/spec/aws/runner/unit/runner_unit_spec.rb +128 -38
  37. data/spec/aws/templates/unit/activity_spec.rb +89 -0
  38. data/spec/aws/templates/unit/base_spec.rb +72 -0
  39. data/spec/aws/templates/unit/default_spec.rb +141 -0
  40. data/spec/aws/templates/unit/starter_spec.rb +271 -0
  41. data/spec/spec_helper.rb +9 -11
  42. metadata +41 -4
@@ -16,7 +16,7 @@
16
16
  require 'bundler/setup'
17
17
  require 'aws/flow'
18
18
  require 'aws/decider'
19
- require 'aws/replayer'
19
+ require 'replayer'
20
20
  require 'runner'
21
21
 
22
22
  include AWS::Flow
@@ -34,14 +34,6 @@ end
34
34
 
35
35
  module Test
36
36
  module Integ
37
- def setup_domain(domain_name)
38
- swf = AWS::SimpleWorkflow.new
39
- domain = swf.domains[domain_name]
40
- unless domain.exists?
41
- swf.domains.create(domain_name, 10)
42
- end
43
- domain
44
- end
45
37
 
46
38
  def build_client(from_class)
47
39
  domain = get_test_domain
@@ -90,13 +82,17 @@ module Test
90
82
  last_run += 1
91
83
  File.open(file_name, 'w+') {|f| f.write(last_run)}
92
84
  current_date = Time.now.strftime("%d-%m-%Y")
85
+
93
86
  swf = AWS::SimpleWorkflow.new
94
- $rubyflow_decider_domain = domain_name || "rubyflow_#{current_date}-#{last_run}"
95
- domain = setup_domain($rubyflow_decider_domain)
87
+ $rubyflow_decider_domain = domain_name || "rubyflow_test_domain"
88
+ puts "Using test domain: #{$rubyflow_decider_domain}"
89
+ domain = AWS::Flow::Utilities.register_domain($rubyflow_decider_domain, 10)
90
+
96
91
  return swf, domain
97
92
  end
98
93
 
99
94
  def get_test_domain
95
+ setup_swf unless $rubyflow_decider_domain
100
96
  swf = AWS::SimpleWorkflow.new
101
97
  domain = swf.domains[$rubyflow_decider_domain]
102
98
  return domain
@@ -120,9 +116,11 @@ module Test
120
116
  def validate_execution(execution, decision="WorkflowExecutionCompleted")
121
117
  execution.events.map(&:event_type).last.should == decision
122
118
  end
119
+
123
120
  def validate_execution_failed(execution)
124
121
  validate_execution(execution, "WorkflowExecutionFailed")
125
122
  end
123
+
126
124
  end
127
125
 
128
126
  module Unit
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: 2.3.1
4
+ version: 2.4.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: 2014-12-18 00:00:00.000000000 Z
11
+ date: 2015-01-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-v1
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: '1'
20
20
  - - ! '>='
21
21
  - !ruby/object:Gem::Version
22
- version: 1.60.1
22
+ version: 1.60.2
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,11 +29,32 @@ dependencies:
29
29
  version: '1'
30
30
  - - ! '>='
31
31
  - !ruby/object:Gem::Version
32
- version: 1.60.1
32
+ version: 1.60.2
33
+ - !ruby/object:Gem::Dependency
34
+ name: lru_redux
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ~>
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
40
+ - - ! '>='
41
+ - !ruby/object:Gem::Version
42
+ version: 0.8.1
43
+ type: :runtime
44
+ prerelease: false
45
+ version_requirements: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - ~>
48
+ - !ruby/object:Gem::Version
49
+ version: '0'
50
+ - - ! '>='
51
+ - !ruby/object:Gem::Version
52
+ version: 0.8.1
33
53
  description: Library to provide the AWS Flow Framework for Ruby
34
54
  email: ''
35
55
  executables:
36
56
  - aws-flow-ruby
57
+ - aws-flow-utils
37
58
  extensions: []
38
59
  extra_rdoc_files: []
39
60
  files:
@@ -43,6 +64,7 @@ files:
43
64
  - Rakefile
44
65
  - aws-flow.gemspec
45
66
  - bin/aws-flow-ruby
67
+ - bin/aws-flow-utils
46
68
  - lib/aws/decider.rb
47
69
  - lib/aws/decider/activity.rb
48
70
  - lib/aws/decider/activity_definition.rb
@@ -58,6 +80,7 @@ files:
58
80
  - lib/aws/decider/history_helper.rb
59
81
  - lib/aws/decider/implementation.rb
60
82
  - lib/aws/decider/options.rb
83
+ - lib/aws/decider/starter.rb
61
84
  - lib/aws/decider/state_machines.rb
62
85
  - lib/aws/decider/task_handler.rb
63
86
  - lib/aws/decider/task_poller.rb
@@ -81,12 +104,21 @@ files:
81
104
  - lib/aws/flow/tasks.rb
82
105
  - lib/aws/replayer.rb
83
106
  - lib/aws/runner.rb
107
+ - lib/aws/templates.rb
108
+ - lib/aws/templates/activity.rb
109
+ - lib/aws/templates/base.rb
110
+ - lib/aws/templates/default.rb
111
+ - lib/aws/templates/starter.rb
112
+ - lib/aws/utils.rb
84
113
  - spec/aws/decider/integration/activity_spec.rb
114
+ - spec/aws/decider/integration/data_converter_spec.rb
85
115
  - spec/aws/decider/integration/integration_spec.rb
86
116
  - spec/aws/decider/integration/options_spec.rb
87
117
  - spec/aws/decider/integration/setup.rb
118
+ - spec/aws/decider/integration/starter_spec.rb
88
119
  - spec/aws/decider/unit/activity_spec.rb
89
120
  - spec/aws/decider/unit/async_retrying_executor_spec.rb
121
+ - spec/aws/decider/unit/data_converter_spec.rb
90
122
  - spec/aws/decider/unit/decider_spec.rb
91
123
  - spec/aws/decider/unit/executor_spec.rb
92
124
  - spec/aws/decider/unit/flow_defaults_spec.rb
@@ -95,6 +127,7 @@ files:
95
127
  - spec/aws/decider/unit/retry_spec.rb
96
128
  - spec/aws/decider/unit/rubyflow.rb
97
129
  - spec/aws/decider/unit/setup.rb
130
+ - spec/aws/decider/unit/starter_spec.rb
98
131
  - spec/aws/decider/unit/worker_spec.rb
99
132
  - spec/aws/decider/unit/workflow_client_spec.rb
100
133
  - spec/aws/flow/async_backtrace_spec.rb
@@ -111,6 +144,10 @@ files:
111
144
  - spec/aws/replayer/unit/replayer_spec.rb
112
145
  - spec/aws/runner/integration/runner_integration_spec.rb
113
146
  - spec/aws/runner/unit/runner_unit_spec.rb
147
+ - spec/aws/templates/unit/activity_spec.rb
148
+ - spec/aws/templates/unit/base_spec.rb
149
+ - spec/aws/templates/unit/default_spec.rb
150
+ - spec/aws/templates/unit/starter_spec.rb
114
151
  - spec/spec_helper.rb
115
152
  homepage: https://aws.amazon.com/swf/details/flow/
116
153
  licenses: []