Chalice: Testing pure lambda functions locally

Created on 7 Mar 2018  路  13Comments  路  Source: aws/chalice

HI, I'm not sure how you guys are testing pure lambda functions locally? I think Chalice could integrate nicely with SAM local or something.

feature-request

Most helpful comment

Dont know if this helps but here are example of integration and unit testing of lambdas https://github.com/nplutt/chalice-test-examples#unit-tests

All 13 comments

I don't believe there is anything built into chalice for handling this use case now, so I'm going to mark this as a feature request for providing some way to test pure lambda functions locally, whether that is via integration with something else, or something native to chalice (or possibly just documenting how to assemble existing pieces to do this).

Dont know if this helps but here are example of integration and unit testing of lambdas https://github.com/nplutt/chalice-test-examples#unit-tests

It looks like #900 is the deployed lambda version of this request. Not sure if there was anything related to the local version though.

Any update on this?

Any update?

Hey, would love this feature. I use a separate @app.lambda_function() to seed my database used by my @app.route()s. It's annoying to test at this point.

I would like to test async lambda invocations locally too. I have separate functions triggered by an incoming webhook request handler and being able to run that locally would be awesome.

Any update on this?

please consider this another request for this functionality

Would people prefer integration with SAM local/docker (which gives a more accurate representation of the lambda runtime) or just some way to call the python lambda function locally that's "close enough"? The tradeoff would be accuracy vs. ease of setup.

Would people prefer integration with SAM local/docker (which gives a more accurate representation of the lambda runtime) or just some way to call the python lambda function locally that's "close enough"? The tradeoff would be accuracy vs. ease of setup.

I think either is acceptable. When I tested locally I have done it both ways. The SAM setup has a much higher startup cost, but like you said it is more accurate.

Having the 'close enough' / 'just get my curl to the function" would be handy to have first.

Ok, let's start with the "close-enough" approach initially.

Was this page helpful?
0 / 5 - 0 ratings