Skip to content

Commit

Permalink
fixup! fixup! fixup! fixup! [wip] Add tests using AWS' SAM CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
imjoehaines committed Apr 11, 2024
1 parent 8cbddaf commit daa83e1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
8 changes: 0 additions & 8 deletions features/steps/steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,6 @@
# PYTHON_TEST_VERSION is defined in env.rb
PARAMETER_OVERRIDES = "--parameter-overrides ParameterKey=Runtime,ParameterValue=python#{PYTHON_TEST_VERSION}"

def current_ip
return "host.docker.internal" if OS.mac?

ip_addr = `ifconfig | grep -Eo 'inet (addr:)?([0-9]*\\\.){3}[0-9]*' | grep -v '127.0.0.1'`
ip_list = /((?:[0-9]*\.){3}[0-9]*)/.match(ip_addr)
ip_list.captures.first
end

Given("I build the {string} lambda") do |lambda_name|
step(%Q{I run the service "aws-lambda" with the command "sam build #{lambda_name} #{PARAMETER_OVERRIDES}"})
end
Expand Down
12 changes: 10 additions & 2 deletions features/support/env.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

PYTHON_TEST_VERSION = ENV.fetch("PYTHON_TEST_VERSION")

def current_ip
return "host.docker.internal" if OS.mac?

ip_addr = `ifconfig | grep -Eo 'inet (addr:)?([0-9]*\\\.){3}[0-9]*' | grep -v '127.0.0.1'`
ip_list = /((?:[0-9]*\.){3}[0-9]*)/.match(ip_addr)
ip_list.captures.first
end

Maze.hooks.before_all do
# log to console, not the filesystem
Maze.config.file_log = false
Expand Down Expand Up @@ -43,8 +51,8 @@
host = "host.docker.internal"

Maze::Runner.environment["BUGSNAG_API_KEY"] = $api_key
Maze::Runner.environment["BUGSNAG_ERROR_ENDPOINT"] = "http://#{host}:#{Maze.config.port}/notify"
Maze::Runner.environment["BUGSNAG_SESSION_ENDPOINT"] = "http://#{host}:#{Maze.config.port}/sessions"
Maze::Runner.environment["BUGSNAG_ERROR_ENDPOINT"] = "http://#{current_ip}:#{Maze.config.port}/notify"
Maze::Runner.environment["BUGSNAG_SESSION_ENDPOINT"] = "http://#{current_ip}:#{Maze.config.port}/sessions"
end

5.upto(100) do |minor_version|
Expand Down

0 comments on commit daa83e1

Please sign in to comment.