1
- #! /usr/ bin/env sh
1
+ #! /bin/bash
2
2
3
3
# License: 3-clause BSD
4
4
5
- set -e
5
+ set -xe
6
+
7
+ conda activate testenv
8
+
6
9
which python
7
- python --version
8
- echo ${TOX_ENV}
10
+ python -V
11
+ python -c " import struct; print('platform: %d' % (8 * struct.calcsize('P')))"
12
+ python -c " import loky; print('loky.cpu_count():', loky.cpu_count())"
13
+ python -c " import os; print('os.cpu_count():', os.cpu_count())"
9
14
10
- if [ " $JOBLIB_TESTS " = " true" ]; then
15
+
16
+ if [[ " $JOBLIB_TESTS " == " true" ]]; then
11
17
# Install joblib from pip, patch it to use this version of loky
12
18
# and run the joblib tests with pytest.
13
- python -m venv venv/
14
- source ./venv/bin/activate
15
- which python
19
+ LOKY_PATH=$( pwd)
20
+
16
21
git clone https://github.com/joblib/joblib.git src_joblib
17
22
cd src_joblib
18
23
pip install " pytest<7.0" # Need to update remove occurrences of pytest.warns(None)
19
24
pip install threadpoolctl # required by some joblib tests
20
25
21
26
pip install -e .
22
27
export JOBLIB=` python -c " import joblib; print(joblib.__path__[0])" `
23
- cp " $BUILD_SOURCESDIRECTORY " /continuous_integration/copy_loky.sh $JOBLIB /externals
24
- (cd $JOBLIB /externals && bash copy_loky.sh " $BUILD_SOURCESDIRECTORY " )
28
+ cp " $LOKY_PATH " /continuous_integration/copy_loky.sh $JOBLIB /externals
29
+ (cd $JOBLIB /externals && bash copy_loky.sh " $LOKY_PATH " )
25
30
pytest -vl --ignore $JOBLIB /externals --pyargs joblib
26
31
elif [ " $PYINSTALLER_TESTS " = " true" ]; then
27
32
python -m venv venv/
@@ -44,14 +49,23 @@ elif [ "$PYINSTALLER_TESTS" = "true" ]; then
44
49
else
45
50
# Make sure that we have the python docker image cached locally to avoid
46
51
# a timeout in a test that needs it.
47
- if [ " $( which docker) " != " " ] && [ " $( uname) " = " Linux" ]; then
52
+ if [[ " $( which docker) " != " " ]] && [[ " $( uname) " = " Linux" ] ]; then
48
53
docker pull python:3.10
49
54
fi
50
55
51
- # Run the tests and collect trace coverage data both in the subprocesses
52
- # and its subprocesses.
53
- if [ " $RUN_MEMORY " != " true" ]; then
56
+ # Enable coverage reporting from subprocesses.
57
+ python continuous_integration/install_coverage_subprocess_pth.py
58
+
59
+ PYTEST_ARGS=" -vl --timeout=120 --maxfail=5 --cov=loky --cov-report xml"
60
+
61
+ if [[ " $RUN_MEMORY " != " true" ]]; then
54
62
PYTEST_ARGS=" $PYTEST_ARGS --skip-high-memory"
55
63
fi
56
- tox -v -e " ${TOX_ENV} " -- ${PYTEST_ARGS} --junitxml=" ${JUNITXML} "
64
+
65
+ LOKY_MAX_DEPTH=3
66
+ OMP_NUM_THREADS=4
67
+
68
+ # Run the tests and collect trace coverage data both in the subprocesses
69
+ # and its subprocesses.
70
+ pytest $PYTEST_ARGS .
57
71
fi
0 commit comments