Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow running integration tests #47

Merged
merged 1 commit into from
Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ go-test:
go test -v -race ./...

.PHONY: integration-test
integration-test: sam-package
integration-test: sam-package-all
cd integration && terraform init && \
if [ "$(DEBUG)" = "1" ]; then \
CHECK_DEBUG_FILE=debug.sh terraform test -filter=tests/forwarder.tftest.hcl -verbose; \
CHECK_DEBUG_FILE=debug.sh terraform test $(TEST_ARGS); \
else \
terraform test -filter=tests/forwarder.tftest.hcl; \
terraform test $(TEST_ARGS); \
fi

## sam-validate: validate cloudformation templates
Expand All @@ -60,8 +60,8 @@ sam-validate:

## sam-validate-all: validate all cloudformation templates
sam-validate-all:
for dir in $(SUBDIR); do
APP=$$dir $(MAKE) sam-validate || exit 1;
@ for dir in $(SUBDIR); do \
APP=$$dir $(MAKE) sam-validate || exit 1; \
done

.PHONY: sam-build-all
Expand Down Expand Up @@ -92,8 +92,8 @@ sam-publish: sam-package

## sam-package-all: package all cloudformation templates and push assets to S3
sam-package-all:
for dir in $(SUBDIR); do
APP=$$dir $(MAKE) sam-package || exit 1;
@ for dir in $(SUBDIR); do \
APP=$$dir $(MAKE) sam-package || exit 1; \
done

## sam-package: package cloudformation templates and push assets to S3
Expand Down
6 changes: 3 additions & 3 deletions integration/tests/simple.tftest.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ run "check" {
variables {
command = "./scripts/check_bucket_not_empty"
env_vars = {
SOURCE = run.setup.source.bucket
SOURCE = run.setup.access_point.bucket
}
}

assert {
condition = output.exitcode == 0
error_message = "Bucket not empty check failed"
condition = output.exitcode != 0
error_message = "Bucket isn't empty"
}
}
Loading