Skip to content

Commit

Permalink
Fix integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
marcomagdy committed Nov 16, 2023
1 parent adcbaf5 commit 59f8f6a
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions tests/resources/lambda_function.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,9 @@ int main(int argc, char* argv[])
handlers.emplace("binary_response", binary_response);
handlers.emplace("crash_backtrace", crash_backtrace);

if (argc < 2) {
aws::logging::log_error("lambda_fun", "Missing handler argument. Exiting.");
return -1;
}

auto it = handlers.find(argv[1]);
// Read the handler from the environment variable
const char* handler_name = std::getenv("_HANDLER");
auto it = handlers.find(handler_name == nullptr ? "" : handler_name);
if (it == handlers.end()) {
aws::logging::log_error("lambda_fun", "Handler %s not found. Exiting.", argv[1]);
return -2;
Expand Down

0 comments on commit 59f8f6a

Please sign in to comment.