Context: serverless framework, lambda, nodejs, dynamodb-local, serverless-mocha-plugin.
I want to launch the local tests in one command. In order to achieve that, I thought about making a run-tests shell script. But I guess I am not doing it the right way.
When manually launching the tests, in 2 consoles I launch dynamodb local:
sls dynamodb start
then, when ready, in the other console, I run the test:
sls invoke test -f loadDepartmentsOfFrance
Given that sls dynamodb start is asynchronous and it may take more or less time, is it possible to group these commands in one shell scripts?
I was trying
sls dynamodb start &
sls invoke test -f loadDepartmentsOfFrance
but the second command has not wait for the first to properly launch. Without the &, the second command is never reached.
Even if I didn't got there, how may I stop dynamodb local in the same script? There is no sls dynamodb stop command.
Feel free to suggest other approaches for local testing of lambdas using dynamodb, S3, endpoints and sqs services.
via Costin
No comments:
Post a Comment