You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by ap...@apache.org on 2018/07/03 12:52:44 UTC

[arrow] branch master updated: ARROW-2780: [Go] Run code coverage analysis

This is an automated email from the ASF dual-hosted git repository.

apitrou pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/master by this push:
     new 42c2101  ARROW-2780: [Go] Run code coverage analysis
42c2101 is described below

commit 42c210117b494c89b90f8fdad39df78e8bd201bb
Author: Sebastien Binet <bi...@cern.ch>
AuthorDate: Tue Jul 3 14:52:30 2018 +0200

    ARROW-2780: [Go] Run code coverage analysis
    
    needs #2193
    
    Author: Sebastien Binet <bi...@cern.ch>
    
    Closes #2203 from sbinet/issue-2780 and squashes the following commits:
    
    59c71bb <Sebastien Binet> ARROW-2780:  Run code coverage analysis
---
 .travis.yml            | 11 +++++++----
 ci/travis_script_go.sh | 39 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 46 insertions(+), 4 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index e0014b4..51253f2 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -222,11 +222,14 @@ matrix:
     os: linux
     go:
     - 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.sh
new file mode 100755
index 0000000..23eb29c
--- /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