#!/bin/bash

set -e

export PARQUET_TEST_DATA=/usr/share/apache/parquet-testing/data
export ARROW_TEST_DATA=/usr/share/apache/arrow-testing

EXTRA_ARGS=""

# i386: SIGSEGV in native code kills the whole pytest session; --forked isolates it.
if [ "$(dpkg --print-architecture)" = "i386" ]; then
    EXTRA_ARGS="--forked"
fi

for py in $(py3versions -d)
do
  cd "$AUTOPKGTEST_TMP"
  echo "Testing with $py:"
  $py -m pytest -v --pyargs pyarrow $EXTRA_ARGS
done
