Apache DataFusion SQL Query Engine
ARROW-4356: [CI] Add integration (docker) test for turbodbc
Krisztián Szűcs93e60fba0ff8
diff --git a/Makefile.docker b/Makefile.dockerindex 01949fe29a..e6872f56c2 100644--- a/Makefile.docker+++ b/Makefile.docker@@ -28,7 +28,8 @@ TESTS = dask hdfs-integration spark-integration python-nopandasDEPENDS_ON_CPP = build-c_glib build-python build-rDEPENDS_ON_CPP_ALPINE = build-python-alpineDEPENDS_ON_PYTHON = build-lint build-docs build-dask build-hdfs-integration \- build-spark-integration build-python-nopandas+ build-spark-integration build-python-nopandas \+ build-turbodbc-integrationDEPENDS_ON_LINT = build-iwyu build-clang-formatSERVICES = $(LANGUAGES) $(MISC) $(TESTS)diff --git a/dev/tasks/tests.yml b/dev/tasks/tests.ymlindex a316381e75..f94fe6ebdd 100644--- a/dev/tasks/tests.yml+++ b/dev/tasks/tests.yml@@ -43,12 +43,14 @@ groups:- docker-dask-integration- docker-hdfs-integration- docker-spark-integration+ - docker-turbodbc-integrationintegration:- docker-pandas-master- docker-dask-integration- docker-hdfs-integration- docker-spark-integration+ - docker-turbodbc-integrationcpp-python:- docker-cpp@@ -317,6 +319,18 @@ tasks:- docker-compose build spark-integration- docker-compose run spark-integration+ docker-turbodbc-integration:+ platform: linux+ template: docker-tests/travis.linux.yml+ params:+ environment:+ PYTHON_VERSION: 3.6+ commands:+ - docker-compose build cpp+ - docker-compose build python+ - docker-compose build turbodbc-integration+ - docker-compose run turbodbc-integration+docker-pandas-master:platform: linuxtemplate: docker-tests/travis.linux.ymldiff --git a/docker-compose.yml b/docker-compose.ymlindex e9dcd23f4e..361eeb97b1 100644--- a/docker-compose.yml+++ b/docker-compose.yml@@ -477,6 +477,19 @@ services:dockerfile: integration/dask/Dockerfilevolumes: *ubuntu-volumes+ turbodbc-integration:+ # Usage:+ # export PYTHON_VERSION=3.6+ # docker-compose build cpp+ # docker-compose build python+ # docker-compose build turbodbc-integration+ # docker-compose run turbodbc-integration+ image: arrow:turbodbc-integration+ build:+ context: .+ dockerfile: integration/turbodbc/Dockerfile+ volumes: *ubuntu-volumes+spark-integration:# Usage:# export PYTHON_VERSION=3.6diff --git a/integration/turbodbc/Dockerfile b/integration/turbodbc/Dockerfilenew file mode 100644index 0000000000..26df8ad709--- /dev/null+++ b/integration/turbodbc/Dockerfile@@ -0,0 +1,38 @@+# 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.++FROM arrow:python-3.6++RUN export DEBIAN_FRONTEND=noninteractive && \+ apt-get update -y -q && \+ apt-get install -y -q --no-install-recommends \+ odbc-postgresql \+ postgresql \+ sudo \+ && apt-get clean \+ && rm -rf /var/lib/apt/lists/*++# install turbodbc dependencies from conda-forge+RUN conda install -c conda-forge pybind11 pytest pytest-cov mock unixodbc && \+ conda clean --all++ENV TURBODBC_TEST_CONFIGURATION_FILES "query_fixtures_postgresql.json"++# build and test+CMD ["/bin/bash", "-c", "arrow/ci/docker_build_cpp.sh && \+ arrow/ci/docker_build_python.sh && \+ arrow/integration/turbodbc/runtest.sh"]diff --git a/integration/turbodbc/runtest.sh b/integration/turbodbc/runtest.shnew file mode 100755index 0000000000..31f924336f--- /dev/null+++ b/integration/turbodbc/runtest.sh@@ -0,0 +1,46 @@+#!/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++# check that optional pyarrow modules are available+# because pytest would just skip the pyarrow tests+python -c "import pyarrow.orc"+python -c "import pyarrow.parquet"++pushd /tmp+git clone https://github.com/xhochy/turbodbc.git+pushd turbodbc+git checkout arrow-0.13.0-prep+git submodule update --init --recursive++service postgresql start+sudo -u postgres psql -U postgres -c 'CREATE DATABASE test_db;'+sudo -u postgres psql -U postgres -c 'ALTER USER postgres WITH PASSWORD '\''password'\'';'+export ODBCSYSINI="$(pwd)/travis/odbc/"++mkdir build+pushd build+cmake -DCMAKE_INSTALL_PREFIX=./dist -DPYTHON_EXECUTABLE=`which python` -GNinja ..+ninja install++# TODO(ARROW-5074)+export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/opt/conda/lib"++ctest --output-on-failure