Apache DataFusion SQL Query Engine
ARROW-42: Add Python tests to Travis CI build
Wes McKinney325dbf63971d
diff --git a/.travis.yml b/.travis.ymlindex cb2d5cb1ba..9e858d7d98 100644--- a/.travis.yml+++ b/.travis.yml@@ -8,7 +8,9 @@ addons:packages:- gcc-4.9 # Needed for C++11- g++-4.9 # Needed for C++11+ - gdb- gcov+ - ccache- cmake- valgrind@@ -17,11 +19,32 @@ matrix:- compiler: gcclanguage: cppos: linux+ before_script:+ - $TRAVIS_BUILD_DIR/ci/travis_before_script_cpp.shscript:+ - export CC="gcc-4.9"+ - export CXX="g++-4.9"- $TRAVIS_BUILD_DIR/ci/travis_script_cpp.sh+ - $TRAVIS_BUILD_DIR/ci/travis_script_python.sh- compiler: clanglanguage: cppos: osxaddons:+ before_script:+ - $TRAVIS_BUILD_DIR/ci/travis_before_script_cpp.shscript:- $TRAVIS_BUILD_DIR/ci/travis_script_cpp.sh+ - $TRAVIS_BUILD_DIR/ci/travis_script_python.sh++before_install:+- ulimit -c unlimited -S+- export CPP_BUILD_DIR=$TRAVIS_BUILD_DIR/cpp-build+- export ARROW_CPP_INSTALL=$TRAVIS_BUILD_DIR/cpp-install+- export LD_LIBRARY_PATH=$ARROW_CPP_INSTALL/lib:$LD_LIBRARY_PATH++after_script:+- rm -rf $CPP_BUILD_DIR++after_failure:+- COREFILE=$(find . -maxdepth 2 -name "core*" | head -n 1)+- if [[ -f "$COREFILE" ]]; then gdb -c "$COREFILE" example -ex "thread apply all bt" -ex "set pagination 0" -batch; fidiff --git a/ci/travis_before_script_cpp.sh b/ci/travis_before_script_cpp.shnew file mode 100755index 0000000000..4d5bef8bbd--- /dev/null+++ b/ci/travis_before_script_cpp.sh@@ -0,0 +1,26 @@+#!/usr/bin/env bash++set -e++: ${CPP_BUILD_DIR=$TRAVIS_BUILD_DIR/cpp-build}++mkdir $CPP_BUILD_DIR+pushd $CPP_BUILD_DIR++CPP_DIR=$TRAVIS_BUILD_DIR/cpp++# Build an isolated thirdparty+cp -r $CPP_DIR/thirdparty .+cp $CPP_DIR/setup_build_env.sh .++source setup_build_env.sh++echo $GTEST_HOME++: ${ARROW_CPP_INSTALL=$TRAVIS_BUILD_DIR/cpp-install}++cmake -DCMAKE_INSTALL_PREFIX=$ARROW_CPP_INSTALL -DCMAKE_CXX_FLAGS="-Werror" $CPP_DIR+make -j4+make install++popddiff --git a/ci/travis_script_cpp.sh b/ci/travis_script_cpp.shindex 28f16cc021..3e843dd759 100755--- a/ci/travis_script_cpp.sh+++ b/ci/travis_script_cpp.sh@@ -2,28 +2,11 @@set -e-mkdir $TRAVIS_BUILD_DIR/cpp-build-pushd $TRAVIS_BUILD_DIR/cpp-build+: ${CPP_BUILD_DIR=$TRAVIS_BUILD_DIR/cpp-build}-CPP_DIR=$TRAVIS_BUILD_DIR/cpp+pushd $CPP_BUILD_DIR-# Build an isolated thirdparty-cp -r $CPP_DIR/thirdparty .-cp $CPP_DIR/setup_build_env.sh .--if [ $TRAVIS_OS_NAME == "linux" ]; then- # Use a C++11 compiler on Linux- export CC="gcc-4.9"- export CXX="g++-4.9"-fi--source setup_build_env.sh--echo $GTEST_HOME--cmake -DCMAKE_CXX_FLAGS="-Werror" $CPP_DIRmake lint-make -j4if [ $TRAVIS_OS_NAME == "linux" ]; thenvalgrind --tool=memcheck --leak-check=yes --error-exitcode=1 ctest@@ -32,4 +15,3 @@ elsefipopd-rm -rf cpp-builddiff --git a/ci/travis_script_python.sh b/ci/travis_script_python.shnew file mode 100755index 0000000000..9b0bd4f54c--- /dev/null+++ b/ci/travis_script_python.sh@@ -0,0 +1,59 @@+#!/usr/bin/env bash++set -e++PYTHON_DIR=$TRAVIS_BUILD_DIR/python++# Share environment with C+++pushd $CPP_BUILD_DIR+source setup_build_env.sh+popd++pushd $PYTHON_DIR++# Bootstrap a Conda Python environment++if [ $TRAVIS_OS_NAME == "linux" ]; then+ MINICONDA_URL="https://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh"+else+ MINICONDA_URL="https://repo.continuum.io/miniconda/Miniconda-latest-MacOSX-x86_64.sh"+fi++curl $MINICONDA_URL > miniconda.sh+MINICONDA=$TRAVIS_BUILD_DIR/miniconda+bash miniconda.sh -b -p $MINICONDA+export PATH="$MINICONDA/bin:$PATH"+conda update -y -q conda+conda info -a++PYTHON_VERSION=3.5+CONDA_ENV_NAME=pyarrow-test++conda create -y -q -n $CONDA_ENV_NAME python=$PYTHON_VERSION+source activate $CONDA_ENV_NAME++python --version+which python++# faster builds, please+conda install -y nomkl++# Expensive dependencies install from Continuum package repo+conda install -y pip numpy pandas cython++# Other stuff pip install+pip install -r requirements.txt++export ARROW_HOME=$ARROW_CPP_INSTALL++python setup.py build_ext --inplace++py.test -vv -r sxX arrow++# if [ $TRAVIS_OS_NAME == "linux" ]; then+# valgrind --tool=memcheck py.test -vv -r sxX arrow+# else+# py.test -vv -r sxX arrow+# fi++popd