Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ matrix:
- ARROW_TRAVIS_PLASMA=1
- ARROW_TRAVIS_ORC=1
- ARROW_TRAVIS_CLANG_FORMAT=1
- ARROW_TRAVIS_COVERAGE=1
- ARROW_TRAVIS_PYTHON_BENCHMARKS=1
- ARROW_TRAVIS_PYTHON_DOCS=1
- ARROW_BUILD_WARNING_LEVEL=CHECKIN
Expand All @@ -68,10 +69,12 @@ matrix:
# If either C++ or Python changed, we must install the C++ libraries
- $TRAVIS_BUILD_DIR/ci/travis_before_script_cpp.sh
script:
- if [ $ARROW_CI_CPP_AFFECTED == "1" ]; then $TRAVIS_BUILD_DIR/ci/travis_script_cpp.sh; fi
# All test steps are required for accurate C++ coverage info
- $TRAVIS_BUILD_DIR/ci/travis_script_cpp.sh
- $TRAVIS_BUILD_DIR/ci/travis_build_parquet_cpp.sh
- $TRAVIS_BUILD_DIR/ci/travis_script_python.sh 2.7
- $TRAVIS_BUILD_DIR/ci/travis_script_python.sh 3.6
- $TRAVIS_BUILD_DIR/ci/travis_upload_cpp_coverage.sh
# [OS X] C++ & Python w/ XCode 6.4
- compiler: clang
language: cpp
Expand Down Expand Up @@ -178,6 +181,7 @@ matrix:
- $TRAVIS_BUILD_DIR/ci/travis_before_script_c_glib.sh
script:
- $TRAVIS_BUILD_DIR/ci/travis_script_c_glib.sh
# Rust
- language: rust
cache: cargo
rust: stable
Expand All @@ -197,7 +201,11 @@ matrix:
- $TRAVIS_BUILD_DIR/ci/travis_script_rust.sh
after_success:
- pushd ${TRAVIS_BUILD_DIR}/rust
- cargo coveralls --verbose
# Run coverage for codecov.io
- RUST_BACKTRACE=1 cargo coverage --verbose
- bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports"
# Run coverage for coveralls.io
#- cargo coveralls --verbose

after_failure:
- COREFILE=$(find . -maxdepth 2 -name "core*" | head -n 1)
Expand Down
5 changes: 4 additions & 1 deletion ci/travis_before_script_cpp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
# specific language governing permissions and limitations
# under the License.


set -ex

source $TRAVIS_BUILD_DIR/ci/travis_env_common.sh
Expand Down Expand Up @@ -83,6 +82,10 @@ if [ $ARROW_TRAVIS_VALGRIND == "1" ]; then
CMAKE_COMMON_FLAGS="$CMAKE_COMMON_FLAGS -DARROW_TEST_MEMCHECK=ON"
fi

if [ $ARROW_TRAVIS_COVERAGE == "1" ]; then
CMAKE_COMMON_FLAGS="$CMAKE_COMMON_FLAGS -DARROW_GENERATE_COVERAGE=ON"
fi

if [ $TRAVIS_OS_NAME == "linux" ]; then
cmake $CMAKE_COMMON_FLAGS \
$CMAKE_LINUX_FLAGS \
Expand Down
4 changes: 4 additions & 0 deletions ci/travis_env_common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ export ARROW_JS_DIR=${TRAVIS_BUILD_DIR}/js
export ARROW_INTEGRATION_DIR=$TRAVIS_BUILD_DIR/integration
export ARROW_RUST_DIR=${TRAVIS_BUILD_DIR}/rust

if [ $ARROW_TRAVIS_COVERAGE == "1" ]; then
export ARROW_CPP_COVERAGE_FILE=${TRAVIS_BUILD_DIR}/coverage.info
fi

export CPP_BUILD_DIR=$TRAVIS_BUILD_DIR/cpp-build

export ARROW_CPP_INSTALL=$TRAVIS_BUILD_DIR/cpp-install
Expand Down
4 changes: 4 additions & 0 deletions ci/travis_install_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,7 @@ sudo apt-get install -y -q \
if [ "$ARROW_TRAVIS_VALGRIND" == "1" ]; then
sudo apt-get install -y -q valgrind
fi

if [ $ARROW_TRAVIS_COVERAGE == "1" ]; then
sudo apt-get install -y -q lcov
fi
2 changes: 1 addition & 1 deletion ci/travis_install_toolchain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ source $TRAVIS_BUILD_DIR/ci/travis_install_conda.sh

if [ ! -e $CPP_TOOLCHAIN ]; then
# Set up C++ toolchain from conda-forge packages for faster builds
conda create -y -q -p $CPP_TOOLCHAIN python=2.7 \
conda create -y -q -p $CPP_TOOLCHAIN python=3.6 \
nomkl \
boost-cpp \
libprotobuf \
Expand Down
7 changes: 7 additions & 0 deletions ci/travis_script_cpp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,10 @@ pushd $CPP_BUILD_DIR
ctest -j2 --output-on-failure -L unittest

popd

# Capture C++ coverage info (we wipe the build dir in travis_script_python.sh)
if [ $ARROW_TRAVIS_COVERAGE == "1" ]; then
pushd $TRAVIS_BUILD_DIR
lcov --quiet --directory . --capture --no-external --output-file $ARROW_CPP_COVERAGE_FILE
popd
fi
26 changes: 24 additions & 2 deletions ci/travis_script_python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,23 @@ conda install -y -q pip \
# conda install -y -q pytorch torchvision -c soumith
# fi

# Build C++ libraries
# Re-build C++ libraries with the right Python setup
mkdir -p $ARROW_CPP_BUILD_DIR
pushd $ARROW_CPP_BUILD_DIR

# Clear out prior build files
rm -rf *

# XXX Can we simply reuse CMAKE_COMMON_FLAGS from travis_before_script_cpp.sh?
CMAKE_COMMON_FLAGS="-DARROW_EXTRA_ERROR_CONTEXT=ON"

if [ $ARROW_TRAVIS_COVERAGE == "1" ]; then
CMAKE_COMMON_FLAGS="$CMAKE_COMMON_FLAGS -DARROW_GENERATE_COVERAGE=ON"
fi

cmake -GNinja \
-DARROW_BUILD_TESTS=off \
$CMAKE_COMMON_FLAGS \
-DARROW_BUILD_TESTS=on \
-DARROW_BUILD_UTILITIES=off \
-DARROW_PLASMA=on \
-DARROW_PYTHON=on \
Expand All @@ -74,6 +82,9 @@ ninja install

popd

# python-test isn't run by travis_script_cpp.sh, exercise it here
$ARROW_CPP_BUILD_DIR/$ARROW_BUILD_TYPE/python-test

# Other stuff pip install
pushd $ARROW_PYTHON_DIR

Expand Down Expand Up @@ -107,6 +118,17 @@ fi
PYARROW_PATH=$CONDA_PREFIX/lib/python$PYTHON_VERSION/site-packages/pyarrow
python -m pytest -r sxX --durations=15 $PYARROW_PATH --parquet

# Capture C++ coverage info and combine with previous coverage file
if [ $ARROW_TRAVIS_COVERAGE == "1" ]; then
pushd $TRAVIS_BUILD_DIR
lcov --quiet --directory . --capture --no-external --output-file coverage-python-tests.info
lcov --add-tracefile coverage-python-tests.info \
--add-tracefile $ARROW_CPP_COVERAGE_FILE \
--output-file $ARROW_CPP_COVERAGE_FILE
rm coverage-python-tests.info
popd
fi

if [ "$ARROW_TRAVIS_PYTHON_DOCS" == "1" ] && [ "$PYTHON_VERSION" == "3.6" ]; then
# Build documentation once
conda install -y -q \
Expand Down
31 changes: 31 additions & 0 deletions ci/travis_upload_cpp_coverage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/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

source $TRAVIS_BUILD_DIR/ci/travis_env_common.sh

pushd $TRAVIS_BUILD_DIR

# Display summary
lcov --list $ARROW_CPP_COVERAGE_FILE
# Upload report to CodeCov
bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports"

popd
10 changes: 9 additions & 1 deletion cpp/src/plasma/test/client_tests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
#include <sys/types.h>
#include <unistd.h>

#include <chrono>
#include <random>
#include <thread>

#include "arrow/test-util.h"

Expand Down Expand Up @@ -67,7 +69,13 @@ class TestPlasmaStore : public ::testing::Test {
ARROW_CHECK_OK(client2_.Disconnect());
// Kill all plasma_store processes
// TODO should only kill the processes we launched
system("killall -9 plasma_store");
#ifdef COVERAGE_BUILD
// Ask plasma_store to exit gracefully and give it time to write out
// coverage files
system("killall -TERM plasma_store");
std::this_thread::sleep_for(std::chrono::milliseconds(200));
#endif
system("killall -KILL plasma_store");
}

void CreateObject(PlasmaClient& client, const ObjectID& object_id,
Expand Down
11 changes: 7 additions & 4 deletions python/pyarrow/tests/test_plasma.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import random
import shutil
import signal
import sys
import subprocess
import tempfile
import time
Expand Down Expand Up @@ -196,11 +197,13 @@ def teardown_method(self, test_method):
try:
# Check that the Plasma store is still alive.
assert self.p.poll() is None
# Ensure Valgrind detected no issues
if USE_VALGRIND:
self.p.send_signal(signal.SIGTERM)
# Ensure Valgrind and/or coverage have a clean exit
self.p.send_signal(signal.SIGTERM)
if sys.version_info >= (3, 3):
self.p.wait(timeout=5)
else:
self.p.wait()
assert self.p.returncode == 0
assert self.p.returncode == 0
finally:
self.plasma_store_ctx.__exit__(None, None, None)

Expand Down