-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.test
33 lines (25 loc) · 1.05 KB
/
Makefile.test
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
PWD := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
GEMS_HOME ?= $(PWD)/vendor/bundle
default: test
all: init test
.PHONY: init
# Initialize project.
init: install-test-deps
.PHONY: test
## Run blueprint integration tests.
test: install-test-deps
# Remove any previously created Terraform test artefacts.
for dir in .terraform terraform.tfstate.d; do \
find test/fixtures -name $$dir -print0 | xargs -0 rm -rf; \
sync; \
done \
# See https://github.com/hashicorp/terraform/issues/17655 for TF_WARN_OUTPUT_ERRORS=1.
# See https://github.com/test-kitchen/test-kitchen/issues/1436 for why `bundle exec kitchen test` is currently not an option.
TF_WARN_OUTPUT_ERRORS=1 bundle exec kitchen verify; TF_WARN_OUTPUT_ERRORS=1 bundle exec kitchen destroy
.PHONY: install-ruby-gems
# Install Ruby gems specified in Gemfile.
install-ruby-gems:
BUNDLE_SILENCE_ROOT_WARNING=true bundle install --path $(GEMS_HOME) --jobs=8
.PHONY: install-test-deps
# Install testing dependencies.
install-test-deps: install-ruby-gems