From 6843475067fb5a9d2c379c17aa520516217637fe Mon Sep 17 00:00:00 2001 From: Alexander Bezzubov Date: Tue, 6 Mar 2018 22:43:28 +0100 Subject: [PATCH] Go - add query to CI integration test Signed-off-by: Alexander Bezzubov --- .travis.yml | 2 ++ src/main/go/query.go | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 12f56590..b145f85c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,6 +28,8 @@ matrix: - ./hash src/test/resources/siva || travis_terminate 1 - ./query ./LICENSE - ./report + - go get ./src/main/go/... + - go run ./src/main/go/query.go ./LICENSE before_deploy: - VERSION=$TRAVIS_TAG ./scripts/release.sh deploy: diff --git a/src/main/go/query.go b/src/main/go/query.go index bc5093a7..e2e1d5d0 100644 --- a/src/main/go/query.go +++ b/src/main/go/query.go @@ -53,12 +53,16 @@ func main() { var similarHashes []BlobHash if err := gocqlx.Select(&similarHashes, q.Query); err != nil { - log.Fatal("select:", err) + log.Fatalf("select: %v in %s", err, q.Query) } for _, hash := range similarHashes { fmt.Printf("\t%+v\n", hash) } + + if len(similarHashes) == 0 { + os.Exit(2) + } } // connect to the cluster