-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
/
test_python.sh
executable file
·81 lines (72 loc) · 1.59 KB
/
test_python.sh
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
#!/bin/bash
set -e
set -x
if [ "$#" -lt 1 ]
then
suite=''
args=''
else
suite=$1
shift 1
args="$@"
fi
# Install XGBoost Python package
function install_xgboost {
wheel_found=0
pip install --upgrade pip --user
for file in python-package/dist/*.whl
do
if [ -e "${file}" ]
then
pip install --user "${file}"
wheel_found=1
break # need just one
fi
done
if [ "$wheel_found" -eq 0 ]
then
pushd .
cd python-package
python setup.py install --user
popd
fi
}
function uninstall_xgboost {
pip uninstall -y xgboost
}
# Run specified test suite
case "$suite" in
gpu)
source activate gpu_test
install_xgboost
pytest -v -s -rxXs --fulltrace --durations=0 -m "not mgpu" ${args} tests/python-gpu
uninstall_xgboost
;;
mgpu)
source activate gpu_test
install_xgboost
pytest -v -s -rxXs --fulltrace --durations=0 -m "mgpu" ${args} tests/python-gpu
cd tests/distributed
./runtests-gpu.sh
uninstall_xgboost
;;
cpu)
source activate cpu_test
install_xgboost
export RAY_OBJECT_STORE_ALLOW_SLOW_STORAGE=1
pytest -v -s -rxXs --fulltrace --durations=0 ${args} tests/python
cd tests/distributed
./runtests.sh
uninstall_xgboost
;;
cpu-arm64)
source activate aarch64_test
install_xgboost
pytest -v -s -rxXs --fulltrace --durations=0 ${args} tests/python/test_basic.py tests/python/test_basic_models.py tests/python/test_model_compatibility.py
uninstall_xgboost
;;
*)
echo "Usage: $0 {gpu|mgpu|cpu|cpu-arm64} [extra args to pass to pytest]"
exit 1
;;
esac