Repository navigation
Add support for lazy listeners when running with chalice local - #270
Conversation
Codecov Report
@@ Coverage Diff @@
## main #270 +/- ##
==========================================
+ Coverage 91.25% 91.50% +0.24%
==========================================
Files 160 160
Lines 4983 5000 +17
==========================================
+ Hits 4547 4575 +28
+ Misses 436 425 -11
Continue to review full report at Codecov.
|
|
@jlujan-invitae Thanks for taking the time to make this improvement! The changes already look great to me 👍 One thing I wanted to know is the possibility to have some tests for the pattern in https://github.com/slackapi/bolt-python/blob/main/tests/adapter_tests/aws/test_aws_chalice.py . If we can add a basic-level (in other words, normal patterns only) unit test emulating |
|
Sure thing. I will attempt to write tests to cover the additions. Might take me a few days with my current schedule. |
|
@seratch, I think this is in good shape. Might give it a once over. Looks like it improved coverage some. |
|
@jlujan-invitae Thanks! The added test looks great to me 👍 |
* Refactor LocalLambdaClient into seperate file * try/catch import when running from a deployed lambda
* Fix chalice deployment bug introduced in #270 * Refactor LocalLambdaClient into seperate file * try/catch import when running from a deployed lambda * Updates from PR feedback, improve lazy lambda tests * Only import LocalLambdaClient if CLI and client not passed in * Add unittest for default lazy listener * Fix name of mocked lambda client in test_lazy_listeners_non_cli
Addresses the underlying issue in #267.� Add support to
ChaliceSlackRequestHandlerfor lazy listeners when running throughchalice local. The current method uses boto('lambda').invoke to invoke an actual lambda function which does not work when developing or running locally withchalice local. This PR implementsLocalLambdaClientsub-classed fromchalice.test.BaseClientwith overload ofinvoketo matchboto's capitalized function signature.slack_bolt.Appand/or its core componentsslack_bolt.async_app.AsyncAppand/or its core componentsslack_bolt.adapter/docsRequirements (place an
xin each[ ])Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.
./scripts/install_all_and_run_tests.shafter making the changes.