From 3afcc68ac7719b75bfb8341b4fd675fafc33a748 Mon Sep 17 00:00:00 2001 From: John Mulligan Date: Mon, 9 Mar 2020 16:13:18 -0400 Subject: [PATCH] entrypoint: enable go vet checking on packages Signed-off-by: John Mulligan --- entrypoint.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index bafa98f..699a1be 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -98,6 +98,12 @@ test_pkg() { if [[ "${TEST_PKG}" && "${TEST_PKG}" != "${pkg}" ]]; then return 0 fi + + # run go vet and capture the result for the package, but still execute the + # test suite anyway + show go vet ${BUILD_TAGS} "./${pkg}" + ret=$? + # disable caching of tests results testargs=("-count=1"\ ${BUILD_TAGS}) @@ -118,7 +124,7 @@ test_pkg() { fi show go test -v "${testargs[@]}" "./${pkg}" - ret=$? + ret=$(($?+${ret})) grep -v "^mode: count" "${pkg}.cover.out" >> "cover.out" return ${ret} } @@ -128,8 +134,6 @@ pre_all_tests() { go get -t -v ${BUILD_TAGS} ./... diff -u <(echo -n) <(gofmt -d -s .) - # TODO: Consider enabling go vet but it currently fails - # Reset whole-module coverage file echo "mode: count" > "cover.out" }