Make 'make test' work
This commit is contained in:
parent
df5924f904
commit
ee27153186
4
Makefile
4
Makefile
|
|
@ -39,8 +39,6 @@ HTTPS_PROXY ?=
|
|||
### These variables should not need tweaking.
|
||||
###
|
||||
|
||||
SRC_DIRS := cmd pkg # directories which hold app source (not vendored)
|
||||
|
||||
ALL_PLATFORMS := linux/amd64 linux/arm linux/arm64 linux/ppc64le linux/s390x
|
||||
|
||||
# Used internally. Users should pass GOOS and/or GOARCH.
|
||||
|
|
@ -248,7 +246,7 @@ test: $(BUILD_DIRS)
|
|||
--env HTTPS_PROXY=$(HTTPS_PROXY) \
|
||||
$(BUILD_IMAGE) \
|
||||
/bin/sh -c " \
|
||||
./build/test.sh $(SRC_DIRS) \
|
||||
./build/test.sh ./... \
|
||||
"
|
||||
./test_e2e.sh
|
||||
|
||||
|
|
|
|||
|
|
@ -21,14 +21,12 @@ set -o pipefail
|
|||
export CGO_ENABLED=0
|
||||
export GOFLAGS="-mod=vendor"
|
||||
|
||||
TARGETS=$(for d in "$@"; do echo ./$d/...; done)
|
||||
|
||||
echo "Running tests:"
|
||||
go test -installsuffix "static" ${TARGETS}
|
||||
go test -installsuffix "static" "$@"
|
||||
echo
|
||||
|
||||
echo -n "Checking gofmt: "
|
||||
ERRS=$(find "$@" -type f -name \*.go | xargs gofmt -l 2>&1 || true)
|
||||
ERRS="$(go fmt "$@")"
|
||||
if [ -n "${ERRS}" ]; then
|
||||
echo "FAIL - the following files need to be gofmt'ed:"
|
||||
for e in ${ERRS}; do
|
||||
|
|
@ -41,7 +39,7 @@ echo "PASS"
|
|||
echo
|
||||
|
||||
echo -n "Checking go vet: "
|
||||
ERRS=$(go vet ${TARGETS} 2>&1 || true)
|
||||
ERRS="$(go vet "$@" 2>&1 || true)"
|
||||
if [ -n "${ERRS}" ]; then
|
||||
echo "FAIL"
|
||||
echo "${ERRS}"
|
||||
|
|
|
|||
Loading…
Reference in New Issue