1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
|
#! /bin/bash
# Some of the tests must be excluded for a variety of reasons.
# This script is called from both debian/rules and from the
# autopkgtest suite (both from our hand-crafted test script and from
# autopkgtest-pkg-pybuild), with the first argument being "rules"
# (for build-time and autopkgtest-pkg-pybuild) or "autopkgtest"
# (for our hand-crafted autopkgtest), and the second argument being
# the Python interpreter (eg python3.12) and returns an argument
# string that can then be passed to pytest.
# At present, we do not need to handle different Python versions, but
# this may be needed in future.
source=$1
interpreter=$2
arch=$(dpkg --print-architecture)
case $source in
rules)
if [ -n "$AUTOPKGTEST_TMP" ]
then
mode=autopkgtest-pybuild
arch=$(dpkg --print-architecture)
else
mode=build
arch=$(dpkg-architecture -qDEB_HOST_ARCH)
fi
;;
autopkgtest)
mode=autopkgtest-manual
arch=$(dpkg --print-architecture)
;;
*)
echo "Unexpected mode for debian/get_test_exclusions: $mode" >&2
echo "Giving up" >&2
exit 1
;;
esac
# test_connection fails with an async timeout error in notebook 6.4.12
EXCLUDES=(
services/kernels/tests/test_kernels_api.py::KernelAPITest::test_connections
)
# One test has started failing on riscv64, though the cause is unclear
# (it is probably due to a change in some dependency)
if [ $arch = riscv64 ]
then
EXCLUDES+=(
services/kernels/tests/test_kernels_api.py::KernelCullingTest::test_culling
)
fi
# selenium tests require extra dependencies
IGNORES=(
tests/selenium
)
# Print the list of excluded tests for pytest; during build, this
# requires a "notebook/" prefix on all test names, but for the
# installed version during autopkgtests, it does not.
case $mode in
build)
ignoreprefix="notebook/"
excludeprefix="notebook/"
;;
autopkgtest-manual)
# See https://github.com/pytest-dev/pytest/issues/3287
# The rootdir is $AUTOPKGTEST_TMP
ignoreprefix="/usr/lib/python3/dist-packages/notebook/"
excludeprefix=""
;;
autopkgtest-pybuild)
# The rootdir path has a different depth in the pybuild autopkgtest:
# /tmp/autopkgtest-*/downtmp/autopkgtest_tmp/build
ignoreprefix="/usr/lib/python3/dist-packages/notebook/"
excludeprefix=""
;;
esac
for test in "${IGNORES[@]}"
do
printf "%s" "--ignore=$ignoreprefix$test "
done
for test in "${EXCLUDES[@]}"
do
printf "%s" "--deselect=$excludeprefix$test "
done
|