Skip to content

Test-driven FaaS with Docker & Serverless framework

Notifications You must be signed in to change notification settings

naighes/test-driven-faas

 
 

Repository files navigation

GraphQL Offline

Test your service locally, without having to deploy it first.

Deploy

npm install
node_modules/.bin/sls deploy
node_modules/.bin/sls deploy function -f graphql

Quick Smoke Test

# via sls invoke
node_modules/.bin/sls invoke -f graphql --data '{ "queryStringParameters" : { "query" : "{value(key:\"Username\")}"  }  }'
node_modules/.bin/sls invoke -f graphql --data '{ "queryStringParameters" : { "query" : "mutation {value(key:\"Username\", value: \"Luca\")}"  }  }'

Serverless Plugins

Docker

Run ./build.sh rebuild to build docker images and running all required containers. For further details, run ./build.sh --help.

Testing Offline

These kind of tests run locally, so we can check components logic (Unit) and the integration between dynamodb and graphql lambda api both offline.

1 - Unit Tests

Run ./run_tests.sh unit.

2 - Integration Tests against Docker

Run ./run_tests.sh docker.

Testing Online (AWS)

1 - Integration Tests

These kind of tests run online in a isolated CF Stack, so we can verify user roles, policies and permissions and of course the integration between dynamodb and graphql lambda api both online.

Run ./run_tests.sh integration --stage testingstage.

About

Test-driven FaaS with Docker & Serverless framework

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 57.5%
  • Shell 42.5%