diff --git a/features/steps/steps.rb b/features/steps/steps.rb index d4da81b4..c87c3d5f 100644 --- a/features/steps/steps.rb +++ b/features/steps/steps.rb @@ -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 diff --git a/features/support/env.rb b/features/support/env.rb index 75846822..302ba3d1 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -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 @@ -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|