build: run end-to-end tests during Travis run

We don't usually run "acceptance tests" during a Travis run, but this
particular suite doesn't require any special credentials since it just
accesses releases.hashicorp.com to download plugins, so therefore it's
safe to run in Travis at the expense of adding a few more seconds to
the runtime.

Running it in Travis can therefore give us some extra confidence for
pull requests that may inadvertently break certain details of the
workflow, as well as ensuring that these tests are kept up-to-date as
the system changes.
This commit is contained in:
Martin Atkins 2017-09-19 12:00:26 -07:00
parent 73d1298572
commit f45aae9b70
2 changed files with 8 additions and 1 deletions

View File

@ -27,6 +27,7 @@ install:
script: script:
- make vendor-status - make vendor-status
- make test - make test
- make e2etest
- make vet - make vet
- GOOS=windows go build - GOOS=windows go build
branches: branches:

View File

@ -42,6 +42,12 @@ testacc: fmtcheck generate
fi fi
TF_ACC=1 go test $(TEST) -v $(TESTARGS) -timeout 120m TF_ACC=1 go test $(TEST) -v $(TESTARGS) -timeout 120m
# e2etest runs the end-to-end tests against a generated Terraform binary
# The TF_ACC here allows network access, but does not require any special
# credentials since the e2etests use local-only providers such as "null".
e2etest: generate
TF_ACC=1 go test -v ./command/e2etest
test-compile: fmtcheck generate test-compile: fmtcheck generate
@if [ "$(TEST)" = "./..." ]; then \ @if [ "$(TEST)" = "./..." ]; then \
echo "ERROR: Set TEST to a specific package. For example,"; \ echo "ERROR: Set TEST to a specific package. For example,"; \
@ -96,4 +102,4 @@ vendor-status:
# under parallel conditions. # under parallel conditions.
.NOTPARALLEL: .NOTPARALLEL:
.PHONY: bin cover default dev fmt fmtcheck generate plugin-dev quickdev test-compile test testacc testrace tools vendor-status vet .PHONY: bin cover default dev e2etest fmt fmtcheck generate plugin-dev quickdev test-compile test testacc testrace tools vendor-status vet