Debian Codegraph @

debian/tests/test-dolfin-python-unittest

raw
1 #!/bin/bash
2 set -e
3
4 # MPI tests are set up to run on 3 processes.
5 N_MPI=3
6 export PRTE_MCA_plm_ssh_agent=/bin/false
7 export PRTE_MCA_rmaps_default_mapping_policy=:oversubscribe
8 export OMPI_MCA_btl_base_warn_component_unused=0
9
10 DEB_HOST_ARCH=$( dpkg-architecture -qDEB_HOST_ARCH )
11
12 # test default python only to reduce test burden
13 PYVER=$(py3versions -dv)
14
15 # mesh iterators are broken in python3.13, see Bug#1088865
16 PY313_SKIP="not (test_geometric_quantities or test_ghost_connectivities or test_rescale_2d or test_rescale_3d or test_convert_triangle or test_collision_robustness_slow)"
17
18 # store tests to be skipped in this array variable
19 declare -a SKIP_TEST_LIST
20
21 case " arm64 armhf i386 ppc64el riscv64 s390x " in
22 *\ ${DEB_HOST_ARCH}\ *) SKIP_TEST_LIST=(${SKIP_TEST_LIST[@]} test_compute_entity_collisions_2d test_compute_entity_collisions_3d \
23 test_meshes_on_diagonal test_meshes_with_boundary_edge_overlap_2d test_volume_2d)
24 esac
25
26 case " armel armhf i386 s390x " in
27 *\ ${DEB_HOST_ARCH}\ *) SKIP_TEST_LIST=(${SKIP_TEST_LIST[@]} test_mixed_assembly_rank0);;
28 esac
29
30 # armhf debci started running out of disk space compiling some forms
31 case " armhf " in
32 *\ ${DEB_HOST_ARCH}\ *) SKIP_TEST_LIST=(${SKIP_TEST_LIST[@]} test_form \
33 test_evaluate_dofs_manifolds_affine test_butcher_schemes_vector[ForwardEuler-True]);;
34 esac
35
36 # ppc64el fails some H(div) tests with openblas (Bug#1121177)
37 case " ppc64el " in
38 *\ ${DEB_HOST_ARCH}\ *) SKIP_TEST_LIST=(${SKIP_TEST_LIST[@]} RT-2 N1curl test_krylov_samg_solver_elasticity);;
39 esac
40
41 # riscv64 debci fails due to time out: remove the slowest tests
42 case " riscv64 " in
43 *\ ${DEB_HOST_ARCH}\ *) SKIP_TEST_LIST=(${SKIP_TEST_LIST[@]} \
44 test_assembler \
45 test_assembly_derivatives \
46 test_coordinate_derivative \
47 test_dirichlet_bc \
48 test_dofmap.py \
49 test_function_assigner \
50 test_manifolds \
51 test_mixedassembler \
52 test_multimesh \
53 test_nullspace \
54 test_point_source \
55 test_RK_solver \
56 test_solve_result_against_reference \
57 test_symbolic_geometry_assembly \
58 test_XDMF.py \
59 test_matrix \
60 test_tensor_layout \
61 test_vector \
62 test_mesh);;
63 esac
64
65 case " loong64 " in
66 *\ ${DEB_HOST_ARCH}\ *) SKIP_TEST_LIST=(${SKIP_TEST_LIST[@]} test_compute_entity_collisions_2d test_meshes_on_diagonal test_meshes_with_boundary_edge_overlap_2d test_volume_2d_six_meshes);;
67 esac
68
69 # TAO segfaults since PETSc 3.25 (probably since PR 9029).
70 # The affected file is python/test/unit/nls/test_PETScTAOSolver.py, even though
71 # the actual test function is named incorrectly, probably due to a copy-paste
72 # from the the similar file python/test/unit/nls/test_TAO_linear_bound_solver.py
73 SKIP_TEST_LIST=(${SKIP_TEST_LIST[@]} test_tao_linear_bound_solver )
74
75 SKIP_TESTS=""
76 list_initialised=0
77 for t in ${SKIP_TEST_LIST[@]}; do
78 if [ ${list_initialised} = 0 ]; then
79 SKIP_TESTS=$t
80 list_initialised=1
81 else
82 SKIP_TESTS="${SKIP_TESTS} or $t"
83 fi
84 done
85 if [ "x${SKIP_TESTS}" != "x" ]; then
86 SKIP_TESTS="not ( ${SKIP_TESTS} )"
87 fi
88
89 if [ "x${SKIP_TESTS}" != "x" ]; then
90 echo "skipping tests with SKIP_TESTS=${SKIP_TESTS}"
91 fi
92
93 for pyver in $PYVER; do
94 # mesh iterators are broken in python3.13, see Bug#1088865
95 if dpkg --compare-versions $pyver ge 3.13; then
96 if [ "x${SKIP_TESTS}" = "x" ]; then
97 SKIP_TESTS="${PY313_SKIP}"
98 else
99 SKIP_TESTS="${SKIP_TESTS} and ${PY313_SKIP}"
100 fi
101 fi
102
103 echo "=== python $pyver unit test (serial) ==="
104 python$pyver -m pytest --durations=20 -k "${SKIP_TESTS}" python/test/unit/
105 done
106
107
108 declare -a MPI_SKIP_TEST_LIST
109
110 # test_shared_entities has become flaky in python3.13, with the number of entities system dependent
111 MPI_SKIP_TEST_LIST=(${SKIP_TEST_LIST[@]} test_shared_entities[shared_vertex-mesh_factory8])
112
113 MPI_SKIP_TEST_LIST=(${MPI_SKIP_TEST_LIST[@]} test_function.py test_function_assigner.py test_shared_entities[shared_vertex-mesh_factory8])
114
115 MPI_SKIP_TESTS=""
116 list_initialised=0
117 for t in ${MPI_SKIP_TEST_LIST[@]}; do
118 if [ ${list_initialised} = 0 ]; then
119 MPI_SKIP_TESTS=$t
120 list_initialised=1
121 else
122 MPI_SKIP_TESTS="${MPI_SKIP_TESTS} or $t"
123 fi
124 done
125 if [ "x${MPI_SKIP_TESTS}" != "x" ]; then
126 MPI_SKIP_TESTS="not ( ${MPI_SKIP_TESTS} )"
127 fi
128
129 if [ "x${MPI_SKIP_TESTS}" != "x" ]; then
130 echo "skipping MPI tests with MPI_SKIP_TESTS=${MPI_SKIP_TESTS}"
131 fi
132
133 for pyver in $PYVER; do
134 # mesh iterators are broken in python3.13, see Bug#1088865
135 if dpkg --compare-versions $pyver ge 3.13; then
136 if [ "x${SKIP_TESTS}" = "x" ]; then
137 MPI_SKIP_TESTS="${PY313_SKIP}"
138 else
139 MPI_SKIP_TESTS="${MPI_SKIP_TESTS} and ${PY313_SKIP}"
140 fi
141 fi
142
143 echo "=== python $pyver unit test (MPI) ==="
144 OMP_NUM_THREADS=1 mpirun -n ${N_MPI} python$pyver -m pytest --durations=20 -k "${MPI_SKIP_TESTS}" python/test/unit/ --color=no
145 done