ruby-sfn-local 0.1.23 → 0.1.26

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2894068622db2c20baedbefb1b890af2144736538c253a6e9d073bd3c381aa5b
4
- data.tar.gz: 005de56e64a03ff270b1f8a5f16ccb75060fb0fb9d6cc8d7146ad90710cb26cd
3
+ metadata.gz: ff99b4bae62c62426875ba1648587694c067f1a6d75e93141f3db3cd190d7d77
4
+ data.tar.gz: eba01eca2c917702c83d9d41f76059895cda06e748789f0612f30ee84463f6a3
5
5
  SHA512:
6
- metadata.gz: 06f0d307de2fa217ad4bf2f79e8d6beb6909406420d677098e8919142099a67debdc251a1353613a4dee07a341a6801a5f00838dc7a5697da69c41e49ee51397
7
- data.tar.gz: 29b01ff318928956aa3660b0ea1d026b944fc0886cc0c4b1487debc5911ed69222efd08271cdb364d7925fb6fe4b4e5cd6e15599167885e6a0740f9c67c82543
6
+ metadata.gz: 4c4aaa0b42443f7635d5bbd799fe53170f0ca1aea60025966242a5dfefdc7bbadde4d1e28367344b1c344975e3ec7fad1e2dde8aab14ea22270e4d29e0d090b1
7
+ data.tar.gz: f3486082711ed0e33608fecd9072c3cee367ccd8ec6eac75ddfcaffeae0d17cdd4bf08d4dc70de944c8880e6ccd8e410cca822671a5815d84c399ec8414fa401
data/lib/sfn/execution.rb CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Sfn
4
4
  class Execution
5
- attr_accessor :id, :uuid, :state_machine, :test_case, :arn, :output, :profile
5
+ attr_accessor :id, :start_date, :uuid, :state_machine, :test_case, :arn, :output, :profile
6
6
 
7
7
  def self.call(state_machine, test_case, mock_data, input, dry_run = false)
8
8
  new(state_machine, test_case).exec(mock_data, input, dry_run)
@@ -17,12 +17,14 @@ module Sfn
17
17
 
18
18
  def exec(mock_data, input, dry_run = false)
19
19
  MockData.write_context(state_machine.name, test_case, mock_data)
20
- self.arn = AwsCli.run('stepfunctions', 'start-execution',
20
+ out = AwsCli.run('stepfunctions', 'start-execution',
21
21
  { name: uuid,
22
22
  'state-machine': "#{state_machine.arn}##{test_case}",
23
23
  input: "'#{input.to_json}'"
24
- },
25
- 'executionArn')
24
+ })
25
+ decoded = JSON.parse(out)
26
+ self.arn = decoded["executionArn"]
27
+ self.start_date = decoded["startDate"].gsub("000+00:00", "Z")
26
28
  self.output, self.profile = ExecutionLog.parse(arn, dry_run)
27
29
  self
28
30
  end
@@ -75,10 +75,11 @@ module Sfn
75
75
  local_definition = local_definition.gsub(/"Seconds": [0-9]+,*/, '')
76
76
  local_definition = local_definition.gsub(/"Timestamp": "[0-9\-T:+]+",*/, '')
77
77
  local_definition = local_definition.gsub(/"TimestampPath": "[^\"]+",*/, '')
78
- local_definition = local_definition.gsub(/,[\s\n]+\}/, "\n}")
79
78
  local_definition = local_definition.gsub("ItemProcessor", "Iterator")
80
79
  local_definition = local_definition.gsub("ItemSelector", "Parameters")
81
- local_definition = local_definition.gsub(/"ProcessorConfig":\s+{\n\s+"Mode":\s"[A-Z]+"\n\s+},\n/, "")
80
+ local_definition = local_definition.gsub(/"ProcessorConfig":\s*{[\s"[A-Za-z:,]]+},*/, "")
81
+ local_definition = local_definition.gsub(/"Label": "[A-Za-z]+",*/, "")
82
+ local_definition = local_definition.gsub(/,[\s\n]+\}/, "\n}")
82
83
 
83
84
  File.open(local_definition_path, 'w') { |file| file.puts local_definition }
84
85
  "file://#{local_definition_path}"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-sfn-local
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.23
4
+ version: 0.1.26
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gianni Mazza
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-02-02 00:00:00.000000000 Z
11
+ date: 2023-02-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake-release