From fc8f6e6779a366b8b454f64de5c6020f6d3a972d Mon Sep 17 00:00:00 2001 From: Dinis Cruz Date: Mon, 14 Oct 2024 13:41:24 +0100 Subject: [PATCH] handing case when update_status is "Pending" --- .github/actions/run-tests/action.yml | 4 ++-- .../testing/test_TestCase__Local_Stack__Temp_Lambda.py | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/actions/run-tests/action.yml b/.github/actions/run-tests/action.yml index c6ab4dd..adbf657 100644 --- a/.github/actions/run-tests/action.yml +++ b/.github/actions/run-tests/action.yml @@ -5,8 +5,8 @@ runs: using: "composite" steps: - name: Start Local Stack - #uses: owasp-sbot/OSBot-GitHub-Actions/.github/actions/docker__local-stack@dev - uses: ./.github/actions/docker__local-stack + uses: owasp-sbot/OSBot-GitHub-Actions/.github/actions/docker__local-stack@dev + #uses: ./.github/actions/docker__local-stack with: LOCAL_STACK_SERVICES: 's3,lambda,iam,cloudwatch,dynamodb,logs,sts' diff --git a/tests/integration/testing/test_TestCase__Local_Stack__Temp_Lambda.py b/tests/integration/testing/test_TestCase__Local_Stack__Temp_Lambda.py index 8f47702..ddf97be 100644 --- a/tests/integration/testing/test_TestCase__Local_Stack__Temp_Lambda.py +++ b/tests/integration/testing/test_TestCase__Local_Stack__Temp_Lambda.py @@ -57,8 +57,14 @@ def test_create__temp_lambda(self): # # pprint(f"got result: {result}") # # package_update_result = deploy_lambda.package.update() # # pprint(package_update_result) - - assert deploy_lambda.update() == 'Successful' + update_status = deploy_lambda.update() + if update_status == "Pending": + print("*********************************************") + print("Waiting for update to complete") + update_status = deploy_lambda.lambda_function().wait_for_function_update_to_complete(wait_time=0.5) + print("*********************************************") + pprint("update_status", update_status) + assert update_status == 'Successful' with Lambda() as _: assert 'osbot_local_stack_aws_lambdas_dev_hello_world' in _.functions_names()