From 2ebf11659c6e337168db7cef7e9de2f32268007f Mon Sep 17 00:00:00 2001 From: Joe Haines Date: Thu, 11 Apr 2024 13:44:42 +0100 Subject: [PATCH] fixup! fixup! fixup! [wip] Add tests using AWS' SAM CLI --- features/aws-lambda/handled.feature | 2 +- features/steps/steps.rb | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/features/aws-lambda/handled.feature b/features/aws-lambda/handled.feature index 5d3bec59..be03655a 100644 --- a/features/aws-lambda/handled.feature +++ b/features/aws-lambda/handled.feature @@ -3,7 +3,7 @@ Feature: Handled exceptions in AWS Lambda # 3.9 is currently the minimum python version with a lambda runtime @not-python-3.5 @not-python-3.6 @not-python-3.7 @not-python-3.8 Scenario: Handled exceptions are delivered in an AWS Lambda app - Given I run the "HelloWorldFunction" lambda + Given I run the "HelloWorldFunction" lambda with the "event.json" event When I wait to receive an error Then the error is valid for the error reporting API version "4.0" for the "Python Bugsnag Notifier" notifier And the event "unhandled" is false diff --git a/features/steps/steps.rb b/features/steps/steps.rb index d2840fc5..26152b13 100644 --- a/features/steps/steps.rb +++ b/features/steps/steps.rb @@ -22,3 +22,10 @@ And I invoke the '#{lambda_name}' lambda ") end + +Given("I run the {string} lambda with the {string} event") do |lambda_name, event| + steps(" + Given I build the '#{lambda_name}' lambda + And I invoke the '#{lambda_name} --event events/#{event}' lambda + ") +end