From c03e255db5dadbcb63573e2015fff4aa57152e8e Mon Sep 17 00:00:00 2001 From: Dario Maiocchi Date: Sat, 11 Nov 2017 13:06:31 +0100 Subject: ligthen process with makefile --- .gitignore | 1 + GNUmakefile | 20 ++++++++++++++++++++ doc/CONTRIBUTING.md | 6 +----- tests/run_acceptance_test.sh | 8 ++++++++ 4 files changed, 30 insertions(+), 5 deletions(-) create mode 100644 GNUmakefile create mode 100755 tests/run_acceptance_test.sh diff --git a/.gitignore b/.gitignore index 59d2af02..c3879151 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ *.tfstate *.tfstate.backup *.test +*.cov diff --git a/GNUmakefile b/GNUmakefile new file mode 100644 index 00000000..ca8c718f --- /dev/null +++ b/GNUmakefile @@ -0,0 +1,20 @@ +default: build + +build: gofmtcheck + go install + +testacc: build + bash tests/run_acceptance_test.sh +vet: + @echo "go vet ." + @go vet $$(go list ./... | grep -v vendor/) ; if [ $$? -eq 1 ]; then \ + echo ""; \ + echo "Vet found suspicious constructs. Please check the reported constructs"; \ + echo "and fix them if necessary before submitting the code for review."; \ + exit 1; \ + fi + +gofmtcheck: + bash travis/gofmtcheck.sh + +.PHONY: build testacc vet fmt diff --git a/doc/CONTRIBUTING.md b/doc/CONTRIBUTING.md index ddde4637..bbdfe7af 100644 --- a/doc/CONTRIBUTING.md +++ b/doc/CONTRIBUTING.md @@ -18,10 +18,6 @@ https://github.com/hashicorp/terraform/blob/master/.github/CONTRIBUTING.md#runni ## Running acceptance tests -You need to define the ```LIBVIRT_DEFAULT_URI``` and ```TF_ACC``` variables. - ```console -export LIBVIRT_DEFAULT_URI=qemu:///system -export TF_ACC=1 -go test ./... +make testacc ``` diff --git a/tests/run_acceptance_test.sh b/tests/run_acceptance_test.sh new file mode 100755 index 00000000..5010505a --- /dev/null +++ b/tests/run_acceptance_test.sh @@ -0,0 +1,8 @@ +#!/bin/bash +set -x + +unset http_proxy +export TERRAFORM_LIBVIRT_TEST_DOMAIN_TYPE=qemu +export LIBVIRT_DEFAULT_URI="qemu:///system" +export TF_ACC=true +go test -v -covermode=count -coverprofile=profile.cov -timeout=1200s ./libvirt -- cgit v1.2.3