Skip to content

Commit

Permalink
create make target for integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dikhan committed Sep 9, 2018
1 parent 23cd818 commit 8f941b2
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ TF_CMD?="plan"

TF_INSTALLED_PLUGINS_PATH="$(HOME)/.terraform.d/plugins"

TEST_PACKAGES?=$$(go list ./... | grep -v "/examples\|/vendor")
TEST_PACKAGES?=$$(go list ./... | grep -v "/examples\|/vendor|/integration")
INT_TEST_PACKAGES?=$$(go list ./... | grep "/tests/integration")
GOFMT_FILES?=$$(find . -name '*.go' | grep -v 'examples\|vendor')

TF_PROVIDER_NAMING_CONVENTION="terraform-provider-"
Expand Down Expand Up @@ -45,6 +46,14 @@ test: fmt vet lint
exit 1; \
fi

# make integration-test
integration-test: local-env-down local-env
@echo "[INFO] Testing $(TF_OPENAPI_PROVIDER_PLUGIN_NAME)"
@TF_ACC=true go test -v -cover $(INT_TEST_PACKAGES) ; if [ $$? -eq 1 ]; then \
echo "[ERROR] Test returned with failures. Please go through the different scenarios and fix the tests that are failing"; \
exit 1; \
fi

pre-requirements:
@echo "[INFO] Creating $(TF_INSTALLED_PLUGINS_PATH) if it does not exist"
@[ -d $(TF_INSTALLED_PLUGINS_PATH) ] || mkdir -p $(TF_INSTALLED_PLUGINS_PATH)
Expand Down

0 comments on commit 8f941b2

Please sign in to comment.