#!/bin/sh
set -efu

# Skip tests on problematic architectures
ARCH="$(dpkg-architecture -qDEB_BUILD_ARCH)"

if [ "${ARCH}" = "armel" -o "${ARCH}" = "armhf" -o "${ARCH}" = "i386" ]
then
  echo "Skipping tests on problematic architectures"
  exit 77
fi

PYS=${PYS:-"$(py3versions -s 2>/dev/null)"}
TESTPKG=${TESTPKG:-flox}
TESTDIR=${PWD}/tests
cd "$AUTOPKGTEST_TMP"

for py in $PYS; do
    echo "=== $py ==="
    $py -m pytest -k "not test_xarray_resample \
and not test_xarray_reduce_single_grouper \
and not test_func_is_aggregation \
and not test_groupby_bins_indexed_coordinate \
and not test_multi_index_groupby_sum" \
${TESTDIR} 2>&1
done
