#!/bin/bash

set -uex

MARKER="${1:-}"

pytest_opts=(
    -rfEX
    --timeout 300
    --maxfail 500
    --showlocals
)

if [[ "${MARKER}" != "" ]]; then
    pytest_opts+=(-m "${MARKER}")
fi

python3 -m pip install --user pytest-timeout
python3 -m pip install --user Cython  # used by cudapython
python3 -m pip install --user cudapython.tar.gz
python3 -m pip install --user -v ".[all,test]"

pushd tests
# TODO(kmaehashi): workaround cudapython bug
python3 -c 'import cupy; cupy.arange(1); cupy.show_config()'
python3 -m pytest "${pytest_opts[@]}" .
popd

python3 .pfnci/trim_cupy_kernel_cache.py --max-size $((5*1024*1024*1024)) --rm

#!/bin/bash

set -uex

MARKER="${1:-}"

pytest_opts=(
    -rfEX
    --timeout 300
    --maxfail 500
    --showlocals
)

if [[ "${MARKER}" != "" ]]; then
    pytest_opts+=(-m "${MARKER}")
fi

python3 -m pip install --user pytest-timeout
python3 -m pip install --user Cython  # used by cudapython
python3 -m pip install --user cudapython.tar.gz
python3 -m pip install --user -v ".[all,test]"

pushd tests
python3 -c 'import cupy; cupy.show_config()'
python3 -m pytest "${pytest_opts[@]}" .
popd

python3 .pfnci/trim_cupy_kernel_cache.py --max-size $((5*1024*1024*1024)) --rm

Revert "TO BE REMOVED: workaround cudapython bug"
Revert "TO BE REMOVED: workaround cudapython bug"

This reverts commit 25e2ab2c66ee0794d2dfe78b4fd06ab96b40571a.
No longer needed as cudapython is fixed
