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 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120
|
#!/bin/bash
set -e
DEB_HOST_ARCH=$(dpkg-architecture -qDEB_HOST_ARCH)
# Do not require an installation of pytest-pyvista, since we do not have a cache
# to test against anyways
cat <<EOF >> tests/plotting/conftest.py
@pytest.fixture()
def verify_image_cache(request, pytestconfig):
return lambda plotter: True
EOF
# Disable which tests to run
declare -a NETWORK_TESTS
# Disable which tests are failing
declare -a DISABLED_TESTS
NETWORK_TESTS=(
test_download
test_dataset_loader
test_examples
)
DISABLED_TESTS=(
test_download_beach
test_download_dataset_texture
test_dataset_loader_source_url_blob
test_download_headsq
test_download_can_crushed_hdf
test_download_biplane
test_hdf_reader
test_xdmf_reader
test_nrrd_reader
)
if [ "${DEB_HOST_ARCH}" != "i386" ] ; then
# HTTP requests to download example data files are refused from i386,
# but ok for other arches
NETWORK_TESTS=("${NETWORK_TESTS[@]}"
test_meshio
test_protein_ribbon # core/test_polydata_filters.py
test_reader
test_composite
)
DISABLED_TESTS=("${DISABLED_TESTS[@]}"
test_user_logo
test_actor_texture
test_import_3ds
test_remove_environment_texture_cubemap
test_import_obj_with_texture
test_import_obj
test_voxelize_volume
test_property_pbr
test_get_background_texture
test_brush
test_logo_widget
)
else
NETWORK_TESTS=("${NETWORK_TESTS[@]}"
test_user_logo
test_actor_texture
test_import_3ds
test_remove_environment_texture_cubemap
test_import_obj_with_texture
test_import_obj
test_voxelize_volume
test_property_pbr
test_get_background_texture
test_brush
test_logo_widget
)
DISABLED_TESTS=("${DISABLED_TESTS[@]}"
test_download_files
test_dataset_loader
)
fi
TESTS_SEPARATOR=" or "
NETWORK_TESTS_STRING=$(printf "${TESTS_SEPARATOR}%s" "${NETWORK_TESTS[@]}")
NETWORK_TESTS_STRING=${NETWORK_TESTS_STRING:${#TESTS_SEPARATOR}}
DISABLED_TESTS=("${DISABLED_TESTS[@]}"
### TESTS/EXAMPLES ###
# tests/examples/test_download_files.py::test_download_meshio_xdmf
# requires vtkmodules.vtkIOXdmf2, which seems not be available with debian's vtk
"test_download_meshio_xdmf"
)
if [ "${DEB_HOST_ARCH}" = "s390x" ] ; then
DISABLED_TESTS=("${DISABLED_TESTS[@]}"
# all gltf tests segfault
test_download_gltf
# bad data reads, is it a bigendian issue?
test_dataset_loader_from_nested_multiblock
test_meshio[mesh_in0]
test_meshio[mesh_in2]
# segfaults
test_exodus_blocks
)
fi
DISABLED_TESTS_STRING=$(printf "${TESTS_SEPARATOR}%s" "${DISABLED_TESTS[@]}")
DISABLED_TESTS_STRING=${DISABLED_TESTS_STRING:${#TESTS_SEPARATOR}}
# Print report about pyvista installation
python3 -c "import pyvista; print(pyvista.Report())"
# Run the network tests through xvfb-run, since plotting tests require a
# virtual frame buffer
for py in `py3versions -sv`; do
xvfb-run -a python$py -P -m pytest \
-k "(${NETWORK_TESTS_STRING}) and not (${DISABLED_TESTS_STRING})" \
--test_downloads `# required by the examples directory` \
-vv --random-order \
tests
done
|