Apache DataFusion SQL Query Engine
ARROW-2780: [Go] Run code coverage analysis
Sebastien Binetb900bceb8259
diff --git a/.travis.yml b/.travis.ymlindex e0014b4d0f..51253f28c5 100644--- a/.travis.yml+++ b/.travis.yml@@ -222,11 +222,14 @@ matrix:os: linuxgo:- 1.10.x- script:+ before_script:- if [ $ARROW_CI_GO_AFFECTED != "1" ]; then exit; fi- - go get -d -t -v ./go/arrow/...- - go install -v ./go/arrow/...- - go test -v ./go/arrow/...+ script:+ - $TRAVIS_BUILD_DIR/ci/travis_script_go.sh+ after_success:+ - pushd ${TRAVIS_BUILD_DIR}/go/arrow+ - bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports"+after_failure:- COREFILE=$(find . -maxdepth 2 -name "core*" | head -n 1)diff --git a/ci/travis_script_go.sh b/ci/travis_script_go.shnew file mode 100755index 0000000000..23eb29ca44--- /dev/null+++ b/ci/travis_script_go.sh@@ -0,0 +1,39 @@+#!/usr/bin/env bash++# Licensed to the Apache Software Foundation (ASF) under one+# or more contributor license agreements. See the NOTICE file+# distributed with this work for additional information+# regarding copyright ownership. The ASF licenses this file+# to you under the Apache License, Version 2.0 (the+# "License"); you may not use this file except in compliance+# with the License. You may obtain a copy of the License at+#+# http://www.apache.org/licenses/LICENSE-2.0+#+# Unless required by applicable law or agreed to in writing,+# software distributed under the License is distributed on an+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY+# KIND, either express or implied. See the License for the+# specific language governing permissions and limitations+# under the License.++set -e++GO_DIR=${TRAVIS_BUILD_DIR}/go/arrow++pushd $GO_DIR++go get -d -t -v ./...+go install -v ./...++echo "" > coverage.txt++for d in $(go list ./... | grep -v vendor); do+ go test -race -coverprofile=profile.out -covermode=atomic $d+ if [ -f profile.out ]; then+ cat profile.out >> coverage.txt+ rm profile.out+ fi+done++popd