-
Integration testing a locally hosted serverless project
2020-05-10
Strategy There are many choices for running integration/functional/e2e tests with a serverless project. There are two main modes of operation for integration testing. The first is cloud-hosted infrastructure in which a temporary copy of the stack is deployed and the intregration tests are pointed at the resources. This has the benefit of increasing the scope of the integration tests to include permissions and configuration. The door is also open for security or load testing, as the target environment is almost identical to what production will be. The downside of testing against cloud hosted infrastructure is that you introduce a network dependency into your stack. Your internet connection must be reliable, and your cloud host must be operational for your tests to succeed. Furthermore, the overhead in creating and tearing down stacks can be wearisom in an otherwise fast-paced development feedback loop. …
-
Serverless package done right
2019-04-01
Problem The Severless Framework package command claims to be useful in CI/CD workflows. The command results in the production of AWS Cloud Formation stack json files (or alternative cloud provider equivalent) on disk. These files can be bundled and considered the ‘deployment artifact’ at the end of the pipeline. The artifact can be provided to the serverless deploy command that could be run at a later date. This two-step package/deploy process is very familiar, so I was lured into using the serverless package command. However, there is a major flaw in the design! …