Skip to content

Commit

Permalink
Merge pull request #286 from kbrock/rubocop_warnings
Browse files Browse the repository at this point in the history
Minor rubocop fixes in step_functions
  • Loading branch information
Fryguy authored Oct 8, 2024
2 parents 8299cc4 + 9f019bc commit e71822d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion spec/workflow/states/map_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@
end

context "with all iterations failed" do
before { ctx.state["ItemProcessorContext"].each { |ctx| ctx["State"] = {"Output" => {"Error" => "FAILED!"}}} }
before { ctx.state["ItemProcessorContext"].each { |ctx| ctx["State"] = {"Output" => {"Error" => "FAILED!"}} } }

it "returns false" do
expect(state.success?(ctx)).to be_falsey
Expand Down
14 changes: 7 additions & 7 deletions tools/step_functions
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Optimist.options do
banner "Commands:"
SUB_COMMANDS.each { |k, v| banner " #{k.ljust(14)}#{v}" }
banner ""
banner " For more help with a specific command use #{$0} <command> --help"
banner " For more help with a specific command use #{$PROGRAM_NAME} <command> --help"
banner ""
banner "Global Options:"
stop_on SUB_COMMANDS.keys
Expand All @@ -39,7 +39,7 @@ def aws_stepfunctions(args)
puts output.pretty_inspect.light_black if ENV["DEBUG"]
output
rescue JSON::ParserError => err
$stderr.puts "ERROR: #{err}".light_red if ENV["DEBUG"]
warn "ERROR: #{err}".light_red if ENV["DEBUG"]
{}
end

Expand All @@ -57,7 +57,7 @@ def execute_stepfunction(definition, input)

status, output = aws_stepfunctions("describe-execution --execution-arn #{execution_arn}").values_at("status", "output")
if status == "FAILED"
$stderr.puts "ERROR: Execution failed. See simulator for reason.".light_red
warn "ERROR: Execution failed. See simulator for reason.".light_red
exit 1
end
ensure
Expand Down Expand Up @@ -86,20 +86,20 @@ def intrinsic
banner SUB_COMMANDS["intrinsic"]
banner ""

opt :function, "The intrinsic function or JSONPath to run", :type => :string, :required => :true
opt :function, "The intrinsic function or JSONPath to run", :type => :string, :required => true
opt :input, "Input to the execution", :type => :string
end

require "json"

definition = {
"StartAt" => "ExecState",
"States" => {
"States" => {
"ExecState" => {
"Type" => "Pass",
"Type" => "Pass",
"Parameters" => {"data.$" => opts[:function]},
"OutputPath" => "$.data",
"End" => true
"End" => true
}
}
}.to_json
Expand Down

0 comments on commit e71822d

Please sign in to comment.