Apache DataFusion SQL Query Engine
ARROW-5054: [Release][Flight] Test Flight in Linux/macOS release verification scripts
Sutou Kouheia756c9b16f53
diff --git a/.dir-locals.el b/.dir-locals.elnew file mode 100644index 0000000000..d0440a7301--- /dev/null+++ b/.dir-locals.el@@ -0,0 +1,20 @@+;;; 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.++((sh-mode . ((indent-tabs-mode . nil)+ (sh-indentation . 2)+ (sh-basic-offset . 2))))diff --git a/dev/release/02-source-test.rb b/dev/release/02-source-test.rbindex 04daeea63e..e777c7561c 100644--- a/dev/release/02-source-test.rb+++ b/dev/release/02-source-test.rb@@ -72,7 +72,9 @@ class SourceTest < Test::Unit::TestCasedef test_csharp_git_commit_informationsourceDir.chdir("#{@tag_name}/csharp") do+ FileUtils.mv("dummy.git", "../.git")sh("dotnet", "pack", "-c", "Release")+ FileUtils.mv("../.git", "dummy.git")Dir.chdir("artifacts/Apache.Arrow/Release") dosh("unzip", "Apache.Arrow.#{@snapshot_version}.nupkg")FileUtils.chmod(0400, "Apache.Arrow.nuspec")diff --git a/dev/release/02-source.sh b/dev/release/02-source.shindex 1a34055f97..edaeec9ebe 100755--- a/dev/release/02-source.sh+++ b/dev/release/02-source.sh@@ -90,11 +90,13 @@ cp -R -L ${tag}.tmp ${tag}rm -rf ${tag}.tmp# Create a dummy .git/ directory to download the source files from GitHub with Source Link in C#.-mkdir ${tag}/.git && cd $_+dummy_git=${tag}/csharp/dummy.git+mkdir ${dummy_git}+pushd ${dummy_git}echo ${release_hash} > HEADecho '[remote "origin"] url = https://github.com/apache/arrow.git' >> configmkdir objects refs-cd -+popd# Create new tarball from modified source directorytar czf ${tarball} ${tag}diff --git a/dev/release/post-06-csharp.sh b/dev/release/post-06-csharp.shindex 59edc02e74..af616163e3 100755--- a/dev/release/post-06-csharp.sh+++ b/dev/release/post-06-csharp.sh@@ -44,7 +44,9 @@ curl \rm -rf ${archive_name}tar xf ${tar_gz}pushd ${archive_name}/csharp+mv dummy.git ../.gitdotnet pack -c Release+mv ../.git dummy.gitfor package in artifacts/Apache.Arrow/Release/*.{nupkg,snupkg}; dodotnet nuget push \${package} \diff --git a/dev/release/verify-release-candidate.sh b/dev/release/verify-release-candidate.shindex f14c99dac6..d016c87ae5 100755--- a/dev/release/verify-release-candidate.sh+++ b/dev/release/verify-release-candidate.sh@@ -23,7 +23,8 @@# - Maven >= 3.3.9# - JDK >=7# - gcc >= 4.8-# - nodejs >= 6.0.0 (best way is to use nvm)+# - Node.js >= 11.12 (best way is to use nvm)+# - Go >= 1.11## If using a non-system Boost, set BOOST_ROOT and add Boost libraries to# LD_LIBRARY_PATH.@@ -49,8 +50,6 @@ set -o pipefailSOURCE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")" && pwd)"-ARROW_DIST_URL='https://dist.apache.org/repos/dist/dev/arrow'-detect_cuda() {if ! (which nvcc && which nvidia-smi) > /dev/null; thenreturn 1@@ -60,10 +59,15 @@ detect_cuda() {return $((${n_gpus} < 1))}+# Build options for the C++ library+if [ -z "${ARROW_CUDA:-}" ] && detect_cuda; thenARROW_CUDA=ONfi: ${ARROW_CUDA:=OFF}+: ${ARROW_FLIGHT:=ON}++ARROW_DIST_URL='https://dist.apache.org/repos/dist/dev/arrow'download_dist_file() {curl \@@ -191,9 +195,14 @@ test_yum() {done}+setup_tempdir() {cleanup() {- rm -fr "$TMPDIR"+ if [ "${TEST_SUCCESS}" = "yes" ]; then+ rm -fr "${TMPDIR}"+ else+ echo "Failed to verify release candidate. See ${TMPDIR} for details."+ fi}trap cleanup EXITTMPDIR=$(mktemp -d -t "$1.XXXXX")@@ -208,7 +217,7 @@ setup_miniconda() {MINICONDA_URL=https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.shfi- MINICONDA=`pwd`/test-miniconda+ MINICONDA=$PWD/test-minicondawget -O miniconda.sh $MINICONDA_URLbash miniconda.sh -b -p $MINICONDA@@ -226,6 +235,17 @@ setup_miniconda() {conda activate arrow-test}+# Build and test Java (Requires newer Maven -- I used 3.3.9)++test_package_java() {+ pushd java++ mvn test+ mvn package++ popd+}+# Build and test C++test_and_install_cpp() {@@ -236,6 +256,7 @@ test_and_install_cpp() {${ARROW_CMAKE_OPTIONS}-DCMAKE_INSTALL_PREFIX=$ARROW_HOME-DCMAKE_INSTALL_LIBDIR=lib+-DARROW_FLIGHT=${ARROW_FLIGHT}-DARROW_PLASMA=ON-DARROW_ORC=ON-DARROW_PYTHON=ON@@ -249,11 +270,11 @@ ${ARROW_CMAKE_OPTIONS}"cmake $ARROW_CMAKE_OPTIONS ..- make -j$NPROC- make install+ make -j$NPROC install- # TODO: ARROW-5036- ctest \+ # TODO: ARROW-5036: plasma-serialization_tests broken+ # TODO: ARROW-5054: libgtest.so link failure in flight-server-test+ LD_LIBRARY_PATH=$PWD/release:$LD_LIBRARY_PATH ctest \--exclude-regex "plasma-serialization_tests" \-j$NPROC \--output-on-failure \@@ -274,6 +295,9 @@ test_python() {if [ "${ARROW_CUDA}" = "ON" ]; thenexport PYARROW_WITH_CUDA=1fi+ if [ "${ARROW_FLIGHT}" = "ON" ]; then+ export PYARROW_WITH_FLIGHT=1+ fipython setup.py build_ext --inplacepy.test pyarrow -v --pdb@@ -281,19 +305,22 @@ test_python() {popd}-test_glib() {pushd c_glibif brew --prefix libffi > /dev/null 2>&1; then- ./configure --prefix=$ARROW_HOME \- PKG_CONFIG_PATH=$(brew --prefix libffi)/lib/pkgconfig:$PKG_CONFIG_PATH- else- ./configure --prefix=$ARROW_HOME+ PKG_CONFIG_PATH=$(brew --prefix libffi)/lib/pkgconfig:$PKG_CONFIG_PATHfi- make -j$NPROC- make install+ if [ -f configure ]; then+ ./configure --prefix=$ARROW_HOME+ make -j$NPROC+ make install+ else+ meson build --prefix=$ARROW_HOME --libdir=lib+ ninja -C build+ ninja -C build install+ fiexport GI_TYPELIB_PATH=$ARROW_HOME/lib/girepository-1.0:$GI_TYPELIB_PATH@@ -343,10 +370,19 @@ test_ruby() {popd}+test_go() {+ pushd go/arrow++ go get -v ./...+ go test ./...++ popd+}+test_rust() {# install rust toolchain in a similar fashion like test-miniconda- export RUSTUP_HOME=`pwd`/test-rustup- export CARGO_HOME=`pwd`/test-rustup+ export RUSTUP_HOME=$PWD/test-rustup+ export CARGO_HOME=$PWD/test-rustupcurl https://sh.rustup.rs -sSf | sh -s -- -y --no-modify-path@@ -370,85 +406,38 @@ test_rust() {popd}-test_go() {- pushd go-- go get -v ./...- go test ./...-- popd-}--# Build and test Java (Requires newer Maven -- I used 3.3.9)--test_package_java() {- pushd java-- mvn test- mvn package-- popd-}-# Run integration teststest_integration() {- JAVA_DIR=`pwd`/java- CPP_BUILD_DIR=`pwd`/cpp/build+ JAVA_DIR=$PWD/java+ CPP_BUILD_DIR=$PWD/cpp/buildexport ARROW_JAVA_INTEGRATION_JAR=$JAVA_DIR/tools/target/arrow-tools-$VERSION-jar-with-dependencies.jarexport ARROW_CPP_EXE_PATH=$CPP_BUILD_DIR/releasepushd integration- python integration_test.py-- popd-}--setup_tempdir "arrow-$VERSION"-echo "Working in sandbox $TMPDIR"-cd $TMPDIR+ INTEGRATION_TEST_ARGS=-export ARROW_HOME=$TMPDIR/install-export PARQUET_HOME=$TMPDIR/install-export LD_LIBRARY_PATH=$ARROW_HOME/lib:$LD_LIBRARY_PATH-export PKG_CONFIG_PATH=$ARROW_HOME/lib/pkgconfig:$PKG_CONFIG_PATH--if [ "$(uname)" == "Darwin" ]; then- NPROC=$(sysctl -n hw.ncpu)-else- NPROC=$(nproc)-fi+ if [ "${ARROW_FLIGHT}" = "ON" ]; then+ INTEGRATION_TEST_ARGS=--run_flight+ fi-import_gpg_keys+ python integration_test.py $INTEGRATION_TEST_ARGS-# By default test all functionalities.-# To deactivate one test, deactivate the test and all of its dependents-# To explicitly select one test, set TEST_DEFAULT=0 TEST_X=1-: ${TEST_DEFAULT:=1}-: ${TEST_JAVA:=${TEST_DEFAULT}}-: ${TEST_CPP:=${TEST_DEFAULT}}-: ${TEST_GLIB:=${TEST_DEFAULT}}-: ${TEST_RUBY:=${TEST_DEFAULT}}-: ${TEST_PYTHON:=${TEST_DEFAULT}}-: ${TEST_JS:=${TEST_DEFAULT}}-: ${TEST_INTEGRATION:=${TEST_DEFAULT}}-: ${TEST_GO:=${TEST_DEFAULT}}-: ${TEST_RUST:=${TEST_DEFAULT}}-: ${TEST_BINARY:=${TEST_DEFAULT}}-: ${TEST_APT:=${TEST_DEFAULT}}-: ${TEST_YUM:=${TEST_DEFAULT}}+ popd+}-# Automatically test if its activated by a dependent-TEST_GLIB=$((${TEST_GLIB} + ${TEST_RUBY}))-TEST_PYTHON=$((${TEST_PYTHON} + ${TEST_INTEGRATION}))-TEST_CPP=$((${TEST_CPP} + ${TEST_GLIB} + ${TEST_PYTHON}))-TEST_JAVA=$((${TEST_JAVA} + ${TEST_INTEGRATION}))-TEST_JS=$((${TEST_JS} + ${TEST_INTEGRATION}))+test_source_distribution() {+ export ARROW_HOME=$TMPDIR/install+ export PARQUET_HOME=$TMPDIR/install+ export LD_LIBRARY_PATH=$ARROW_HOME/lib:$LD_LIBRARY_PATH+ export PKG_CONFIG_PATH=$ARROW_HOME/lib/pkgconfig:$PKG_CONFIG_PATH-if [ "$ARTIFACT" == "source" ]; then- TARBALL=apache-arrow-$1.tar.gz- DIST_NAME="apache-arrow-${VERSION}"+ if [ "$(uname)" == "Darwin" ]; then+ NPROC=$(sysctl -n hw.ncpu)+ else+ NPROC=$(nproc)+ figit clone https://github.com/apache/arrow-testing.gitexport ARROW_TEST_DATA=$PWD/arrow-testing/data@@ -456,10 +445,6 @@ if [ "$ARTIFACT" == "source" ]; thengit clone https://github.com/apache/parquet-testing.gitexport PARQUET_TEST_DATA=$PWD/parquet-testing/data- fetch_archive $DIST_NAME- tar xvzf ${DIST_NAME}.tar.gz- cd ${DIST_NAME}-if [ ${TEST_JAVA} -gt 0 ]; thentest_package_javafi@@ -479,16 +464,18 @@ if [ "$ARTIFACT" == "source" ]; thenif [ ${TEST_JS} -gt 0 ]; thentest_jsfi- if [ ${TEST_INTEGRATION} -gt 0 ]; then- test_integration- fiif [ ${TEST_GO} -gt 0 ]; thentest_gofiif [ ${TEST_RUST} -gt 0 ]; thentest_rustfi-else+ if [ ${TEST_INTEGRATION} -gt 0 ]; then+ test_integration+ fi+}++test_binary_distribution() {: ${BINTRAY_REPOSITORY:=apache/arrow}if [ ${TEST_BINARY} -gt 0 ]; then@@ -500,7 +487,66 @@ elseif [ ${TEST_YUM} -gt 0 ]; thentest_yumfi+}++# By default test all functionalities.+# To deactivate one test, deactivate the test and all of its dependents+# To explicitly select one test, set TEST_DEFAULT=0 TEST_X=1+: ${TEST_DEFAULT:=1}+: ${TEST_SOURCE:=${TEST_DEFAULT}}+: ${TEST_JAVA:=${TEST_DEFAULT}}+: ${TEST_CPP:=${TEST_DEFAULT}}+: ${TEST_GLIB:=${TEST_DEFAULT}}+: ${TEST_RUBY:=${TEST_DEFAULT}}+: ${TEST_PYTHON:=${TEST_DEFAULT}}+: ${TEST_JS:=${TEST_DEFAULT}}+: ${TEST_GO:=${TEST_DEFAULT}}+: ${TEST_RUST:=${TEST_DEFAULT}}+: ${TEST_INTEGRATION:=${TEST_DEFAULT}}+: ${TEST_BINARY:=${TEST_DEFAULT}}+: ${TEST_APT:=${TEST_DEFAULT}}+: ${TEST_YUM:=${TEST_DEFAULT}}++# Automatically test if its activated by a dependent+TEST_GLIB=$((${TEST_GLIB} + ${TEST_RUBY}))+TEST_PYTHON=$((${TEST_PYTHON} + ${TEST_INTEGRATION}))+TEST_CPP=$((${TEST_CPP} + ${TEST_GLIB} + ${TEST_PYTHON}))+TEST_JAVA=$((${TEST_JAVA} + ${TEST_INTEGRATION}))+TEST_JS=$((${TEST_JS} + ${TEST_INTEGRATION}))++: ${TEST_ARCHIVE:=apache-arrow-${VERSION}.tar.gz}+case "${TEST_ARCHIVE}" in+ /*)+ ;;+ *)+ TEST_ARCHIVE=${PWD}/${TEST_ARCHIVE}+ ;;+esac++TEST_SUCCESS=no++setup_tempdir "arrow-${VERSION}"+echo "Working in sandbox ${TMPDIR}"+cd ${TMPDIR}++if [ "${ARTIFACT}" == "source" ]; then+ dist_name="apache-arrow-${VERSION}"+ if [ ${TEST_SOURCE} -gt 0 ]; then+ import_gpg_keys+ fetch_archive ${dist_name}+ tar xf ${dist_name}.tar.gz+ else+ mkdir -p ${dist_name}+ tar xf ${TEST_ARCHIVE} -C ${dist_name} --strip-components=1+ fi+ pushd ${dist_name}+ test_source_distribution+ popd+else+ import_gpg_keys+ test_binary_distributionfi+TEST_SUCCESS=yesecho 'Release candidate looks good!'exit 0