Skip to content

Commit 5c62c67

Browse files
committed
test(integration): use AWS LocalStack in local integration tests
1 parent 0bf8070 commit 5c62c67

1 file changed

Lines changed: 20 additions & 2 deletions

File tree

Makefile

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -498,15 +498,23 @@ start-postgres: ## Run the PostgreSQL 16 docker container
498498
@docker run --rm --name postgres -p 5432:5432 -d -e POSTGRES_PASSWORD=password -e POSTGRES_DB=rollupsdb -v $(CURDIR)/test/postgres/init-test-db.sh:/docker-entrypoint-initdb.d/init-test-db.sh postgres:18-alpine
499499
@$(MAKE) migrate
500500

501-
start: start-postgres start-devnet ## Start the anvil devnet and PostgreSQL 16 docker containers
501+
start-aws: ## Run the AWS LocakStack docker container
502+
@echo "Starting AWS localstack"
503+
@docker run --rm --name awslocalstack -p 127.0.0.1:4566:4566 -d -e SERVICES=kms localstack/localstack:4.14.0
504+
@$(MAKE) migrate
505+
506+
start: start-postgres start-devnet start-aws ## Start the anvil devnet, PostgreSQL 16, and AWS LocalStack docker containers
502507

503508
stop-devnet: ## Stop the anvil devnet docker container
504509
@docker stop devnet || true
505510

506511
stop-postgres: ## Stop the PostgreSQL 16 docker container
507512
@docker stop postgres || true
508513

509-
stop: stop-devnet stop-postgres ## Stop all running docker containers
514+
stop-aws: ## Stop the AWS LocalStack docker container
515+
@docker stop awslocalstack || true
516+
517+
stop: stop-devnet stop-postgres stop-aws ## Stop all running docker containers
510518

511519
restart-devnet: ## Restart the anvil devnet docker container
512520
@$(MAKE) stop-devnet
@@ -516,11 +524,17 @@ restart-postgres: ## Restart the PostgreSQL 16 docker container and migrate it
516524
@$(MAKE) stop-postgres
517525
@$(MAKE) start-postgres
518526

527+
restart-aws: ## Restart the AWS LocalStack docker container and migrate it
528+
@$(MAKE) stop-aws
529+
@$(MAKE) start-aws
530+
519531
restart: ## Restart all running docker containers
520532
@$(MAKE) stop-devnet
521533
@$(MAKE) stop-postgres
534+
@$(MAKE) stop-aws
522535
@$(MAKE) start-devnet
523536
@$(MAKE) start-postgres
537+
@$(MAKE) start-aws
524538

525539
shutdown-compose: ## Remove the containers and volumes from previous compose run
526540
@docker compose down -v
@@ -715,6 +729,10 @@ _local-topology-%:
715729
export CARTESI_TEST_REJECT_DAPP_PATH=$(CURDIR)/applications/reject-loop-dapp; \
716730
export CARTESI_TEST_EXCEPTION_DAPP_PATH=$(CURDIR)/applications/exception-loop-dapp; \
717731
export CARTESI_TEST_ERC20_WITHDRAWAL_DAPP_PATH=$(CURDIR)/applications/erc20-withdrawal-dapp; \
732+
export AWS_ACCESS_KEY_ID=test; \
733+
export AWS_SECRET_ACCESS_KEY=test; \
734+
export LOCALSTACK_KMS_ENDPOINT=http://localhost:4566; \
735+
export LOCALSTACK_KMS_REQUIRED="true"; \
718736
NODE_TOPOLOGY='$*' TEST_PATTERN="$$pattern" $(MAKE) integration-test
719737

720738
deploy-load-test-apps: applications/echo-dapp ## Deploy 3 echo-dapp instances for load testing

0 commit comments

Comments
 (0)