Built tag-ify sealtesting
This commit is contained in:
parent
a50e29f086
commit
1027b51d17
7
Makefile
7
Makefile
|
@ -2,6 +2,7 @@ TEST?=$$(go list ./... | grep -v /vendor/)
|
||||||
VETARGS?=-asmdecl -atomic -bool -buildtags -copylocks -methods -nilfunc -printf -rangeloops -shift -structtags -unsafeptr
|
VETARGS?=-asmdecl -atomic -bool -buildtags -copylocks -methods -nilfunc -printf -rangeloops -shift -structtags -unsafeptr
|
||||||
EXTERNAL_TOOLS=\
|
EXTERNAL_TOOLS=\
|
||||||
github.com/mitchellh/gox
|
github.com/mitchellh/gox
|
||||||
|
BUILD_TAGS?=vault
|
||||||
|
|
||||||
default: test
|
default: test
|
||||||
|
|
||||||
|
@ -16,7 +17,7 @@ dev: generate
|
||||||
|
|
||||||
# test runs the unit tests and vets the code
|
# test runs the unit tests and vets the code
|
||||||
test: generate
|
test: generate
|
||||||
VAULT_TOKEN= VAULT_ACC= go test $(TEST) $(TESTARGS) -timeout=120s -parallel=4
|
VAULT_TOKEN= VAULT_ACC= go test -tags='$(BUILD_TAGS)' $(TEST) $(TESTARGS) -timeout=120s -parallel=4
|
||||||
|
|
||||||
# testacc runs acceptance tests
|
# testacc runs acceptance tests
|
||||||
testacc: generate
|
testacc: generate
|
||||||
|
@ -24,11 +25,11 @@ testacc: generate
|
||||||
echo "ERROR: Set TEST to a specific package"; \
|
echo "ERROR: Set TEST to a specific package"; \
|
||||||
exit 1; \
|
exit 1; \
|
||||||
fi
|
fi
|
||||||
VAULT_ACC=1 go test $(TEST) -v $(TESTARGS) -timeout 45m
|
VAULT_ACC=1 go test -tags='$(BUILD_TAGS)' $(TEST) -v $(TESTARGS) -timeout 45m
|
||||||
|
|
||||||
# testrace runs the race checker
|
# testrace runs the race checker
|
||||||
testrace: generate
|
testrace: generate
|
||||||
CGO_ENABLED=1 VAULT_TOKEN= VAULT_ACC= go test -race $(TEST) $(TESTARGS)
|
CGO_ENABLED=1 VAULT_TOKEN= VAULT_ACC= go test -tags='$(BUILD_TAGS)' -race $(TEST) $(TESTARGS)
|
||||||
|
|
||||||
cover:
|
cover:
|
||||||
./scripts/coverage.sh --html
|
./scripts/coverage.sh --html
|
||||||
|
|
|
@ -11,6 +11,9 @@ DIR="$( cd -P "$( dirname "$SOURCE" )/.." && pwd )"
|
||||||
# Change into that directory
|
# Change into that directory
|
||||||
cd "$DIR"
|
cd "$DIR"
|
||||||
|
|
||||||
|
# Set build tags
|
||||||
|
BUILD_TAGS="${VAULT_BUILD_TAGS:-"vault"}"
|
||||||
|
|
||||||
# Get the git commit
|
# Get the git commit
|
||||||
GIT_COMMIT="$(git rev-parse HEAD)"
|
GIT_COMMIT="$(git rev-parse HEAD)"
|
||||||
GIT_DIRTY="$(test -n "`git status --porcelain`" && echo "+CHANGES" || true)"
|
GIT_DIRTY="$(test -n "`git status --porcelain`" && echo "+CHANGES" || true)"
|
||||||
|
@ -45,6 +48,7 @@ gox \
|
||||||
-arch="${XC_ARCH}" \
|
-arch="${XC_ARCH}" \
|
||||||
-ldflags "-X github.com/hashicorp/vault/version.GitCommit='${GIT_COMMIT}${GIT_DIRTY}'" \
|
-ldflags "-X github.com/hashicorp/vault/version.GitCommit='${GIT_COMMIT}${GIT_DIRTY}'" \
|
||||||
-output "pkg/{{.OS}}_{{.Arch}}/vault" \
|
-output "pkg/{{.OS}}_{{.Arch}}/vault" \
|
||||||
|
-tags="${BUILD_TAGS}" \
|
||||||
.
|
.
|
||||||
|
|
||||||
# Move all the compiled things to the $GOPATH/bin
|
# Move all the compiled things to the $GOPATH/bin
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
// +build vault
|
||||||
|
|
||||||
package vault
|
package vault
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|
Loading…
Reference in a new issue