Skip to content

Commit 6488817

Browse files
committed
Update dependencies
1 parent d5b96a6 commit 6488817

File tree

9 files changed

+1725
-1706
lines changed

9 files changed

+1725
-1706
lines changed

README.md

+8-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Testing is crucial in any software project. When shifting to a serverless world, we need to accept and embrace multiple paradigm shifts, which also affect how we can test our applications. By doing so on multiple layers, we can drastically increase our confidence of releasing code and having minimal impact on the service availability and stability of the software we develop.
44

5-
This workshop consists of multiple independent modules which can be done in any order. The modules are
5+
This workshop consists of multiple independent modules which can be done in any order. The modules are:
66

77
- [Unit Tests](#unit-tests)
88
- [Local Testing](#local-testing)
@@ -50,7 +50,10 @@ In Node.js, [Express](https://expressjs.com/) is a popular framework for buildin
5050
1. Read up on [`serverless-http`](https://github.com/dougmoscrop/serverless-http) and understand how it works
5151
1. Check out the example application in [local-testing](./local-testing) and investigate how it uses the serverless-http framework
5252
1. Run the application locally by running `npm install` and then `npm start`
53-
1. Send an HTTP request to the app (e.g. using `curl localhost:8080`)
53+
1. Send an HTTP request to the app
54+
```shell
55+
curl -X GET localhost:8080 -H 'Content-Type:application/json' -d '{"name":"Alice"}'
56+
```
5457
1. Deploy the app to AWS Lambda and hook it up with API Gateway.
5558
1. Research how you could do something similar with the web framework and programming language of your choice
5659

@@ -63,12 +66,12 @@ Integration testing is crucial to being confident that your application behaves
6366
> Requirements: You need to have either [Docker](https://www.docker.com/) (including [docker-compose](https://github.com/docker/compose)) or [Podman](https://podman.io/) (including [podman-compose](https://github.com/containers/podman-compose)) installed.
6467
6568
1. Take a look at the introduction to LocalStack by reading their [overview documentation](https://docs.localstack.cloud/overview/).
66-
1. Investigate the `docker-compose.yml` file in the [`integration-tests`](./integration-tests) directory and understand how it sets up
69+
1. Investigate the `docker-compose.yml` file in the [`integration-tests`](./integration-tests) directory and understand how it's set up
6770
1. Run `docker compose up -d` or (`PODMAN_COMPOSE_PROVIDER=podman-compose podman compose up -d` for Podman) and visit [localhost:4566/\_localstack/health](http://localhost:4566/_localstack/health) to verify all services are available.
6871
1. Run `aws --endpoint-url http://localhost:4566 dynamodb create-table --table-name jokes --attribute-definitions AttributeName=ID,AttributeType=S --key-schema AttributeName=ID,KeyType=HASH --provisioned-throughput ReadCapacityUnits=1,WriteCapacityUnits=1` to create the `jokes` table locally.
6972
1. Run `aws --endpoint-url http://localhost:4566 dynamodb list-tables` to verify it has been created.
7073
1. Run `aws --endpoint-url http://localhost:4566 dynamodb put-item --table-name jokes --item '{"ID":{"S":"1"},"Text":{"S":"Hello funny world"}}'` to insert a joke into the newly created table.
71-
1. Run `aws --endpoint-url http://locahlost:4566 dynamodb scan --table-name jokes` to verify it has been inserted.
74+
1. Run `aws --endpoint-url http://localhost:4566 dynamodb scan --table-name jokes` to verify it has been inserted.
7275

7376
## E2E Tests
7477

@@ -114,7 +117,7 @@ Many FaaS platforms allow performing canary deployments. By doing so, we don't r
114117
1. Change something about the function code and apply again to publish a new version (notice the `publish: true` flag in `function.tf`)
115118
1. Visit the [CodeDeploy UI](https://console.aws.amazon.com/codesuite/codedeploy/applications)
116119
1. Choose your application
117-
1. Click "Create deployment" and choose "Use AppSpec editor" with "YAML"
120+
1. Click "Create deployment" and pick "Use AppSpec editor" with "YAML"
118121
1. Enter the following code into the text field (replacing `RESOURCE_SUFFIX` with the suffix you chose):
119122

120123
```yml

e2e-tests/.terraform.lock.hcl

+27-34
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

integration-tests/index.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import serverless from "serverless-http";
22
import { app } from "./api.js";
33

44
export const handler = serverless(app, {
5-
request(request, event, context) {
5+
request(request, event, _) {
66
if (event.body && event.body.length > 0) {
77
request.body = JSON.parse(event.body); // request coming in via api gateway
88
request.url = "/";

integration-tests/package-lock.json

+89-52
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)