From aad4b1b3280e888aeb8b036c66008bd058ee45d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20H=C3=B6rl?= Date: Tue, 5 Dec 2017 13:23:15 +0000 Subject: [PATCH] Integrate test framework tests properly The test framework can now run properly with `go test` and we can remove - our test wrapper - special handling of tests for the test framewoek --- pre-commit.sh | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/pre-commit.sh b/pre-commit.sh index c88607e48..4ebd8824c 100755 --- a/pre-commit.sh +++ b/pre-commit.sh @@ -1,5 +1,13 @@ #!/bin/bash +# Make sure, we run in the root of the repo and +# therefore run the tests on all packages +base_dir="$( cd "$(dirname "$0")/.." && pwd )" +cd "$base_dir" || { + echo "Cannot cd to '$base_dir'. Aborting." >&2 + exit 1 +} + rc=0 go_dirs() { @@ -18,14 +26,12 @@ echo "Running go vet" go vet -all ./... rc=$((rc || $?)) -echo "Running go test" -go list ./... | grep -vF pkg/framework/test | xargs go test -v +echo "Installing test binaries" +./pkg/framework/test/scripts/download-binaries.sh rc=$((rc || $?)) -echo "Running test framework tests" -go get github.com/onsi/ginkgo/ginkgo \ - && ./pkg/framework/test/scripts/download-binaries.sh \ - && ./pkg/framework/test/scripts/run-tests.sh +echo "Running go test" +go test -v ./... rc=$((rc || $?)) exit $rc