summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDario Maiocchi <dmaiocchi@suse.com>2017-11-11 13:06:31 +0100
committerDario Maiocchi <dmaiocchi@suse.com>2017-11-13 17:53:19 +0100
commitc03e255db5dadbcb63573e2015fff4aa57152e8e (patch)
treea6b2e32992e70b8d9217aa20171b1baae69c177e
parent11dca1e8e977948bdb432f87046de9048cacccb1 (diff)
downloadterraform-provider-libvirt-c03e255db5dadbcb63573e2015fff4aa57152e8e.tar
terraform-provider-libvirt-c03e255db5dadbcb63573e2015fff4aa57152e8e.tar.gz
ligthen process with makefile
-rw-r--r--.gitignore1
-rw-r--r--GNUmakefile20
-rw-r--r--doc/CONTRIBUTING.md6
-rwxr-xr-xtests/run_acceptance_test.sh8
4 files changed, 30 insertions, 5 deletions
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