@@ -21,79 +21,111 @@ else
21
21
exit 1
22
22
fi
23
23
24
- TEST_SCRIPT=" $TRAVIS_BUILD_DIR /python/ray/tests/test_microbenchmarks.py"
24
+ TEST_DIR=" $TRAVIS_BUILD_DIR /python/ray/tests"
25
+ TEST_SCRIPTS=(" $TEST_DIR /test_microbenchmarks.py" " $TEST_DIR /test_basic.py" )
25
26
UI_TEST_SCRIPT=" $TRAVIS_BUILD_DIR /python/ray/tests/test_webui.py"
26
27
27
- if [[ " $platform " == " linux" ]]; then
28
- # Now test Python 3.6.
28
+ function retry {
29
+ local n=1
30
+ local max=3
31
+
32
+ while true ; do
33
+ " $@ " && break || {
34
+ if [[ $n -lt $max ]]; then
35
+ (( n++ ))
36
+ echo " Command failed. Attempt $n /$max :"
37
+ else
38
+ echo " The command has failed after $n attempts."
39
+ exit 1
40
+ fi
41
+ }
42
+ done
43
+ }
29
44
45
+ if [[ " $platform " == " linux" ]]; then
30
46
# Install miniconda.
31
- wget --quiet https://repo.continuum.io/miniconda/Miniconda3-4.5.4-Linux-x86_64.sh -O miniconda3.sh
47
+ PY_WHEEL_VERSIONS=(" 36" " 37" " 38" )
48
+ PY_MMS=(" 3.6.9"
49
+ " 3.7.6"
50
+ " 3.8.2" )
51
+ wget --quiet " https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh" -O miniconda3.sh
32
52
bash miniconda3.sh -b -p " $HOME /miniconda3"
53
+ export PATH=" $HOME /miniconda3/bin:$PATH "
54
+
55
+ for (( i= 0 ; i< ${# PY_MMS[@]} ; ++ i)) ; do
56
+ PY_MM=" ${PY_MMS[i]} "
57
+ PY_WHEEL_VERSION=" ${PY_WHEEL_VERSIONS[i]} "
58
+
59
+ conda install -y python=" ${PY_MM} "
60
+
61
+ PYTHON_EXE=" $HOME /miniconda3/bin/python"
62
+ PIP_CMD=" $HOME /miniconda3/bin/pip"
33
63
34
- PYTHON_EXE= $HOME /miniconda3/bin/python
35
- PIP_CMD= $HOME /miniconda3/bin/pip
64
+ # Find the right wheel by grepping for the Python version.
65
+ PYTHON_WHEEL= $( find " $ROOT_DIR /../../.whl " -type f -maxdepth 1 -print | grep -m1 " $PY_WHEEL_VERSION " )
36
66
37
- # Find the right wheel by grepping for the Python version .
38
- PYTHON_WHEEL= $( find " $ROOT_DIR /../../.whl " -type f -maxdepth 1 -print | grep -m1 ' 36 ' )
67
+ # Install the wheel .
68
+ " $PIP_CMD " install -q " $PYTHON_WHEEL "
39
69
40
- # Install the wheel .
41
- $PIP_CMD install -q " $PYTHON_WHEEL "
70
+ # Check that ray.__commit__ was set properly .
71
+ " $PYTHON_EXE " -u -c " import ray; print(ray.__commit__) " | grep " $TRAVIS_COMMIT " || (echo " ray.__commit__ not set properly! " && exit 1)
42
72
43
- # Check that ray.__commit__ was set properly .
44
- $PYTHON_EXE -u -c " import ray; print(ray.__commit__) " | grep $TRAVIS_COMMIT || (echo " ray.__commit__ not set properly! " && exit 1)
73
+ # Install the dependencies to run the tests .
74
+ " $PIP_CMD " install -q aiohttp google grpcio pytest requests
45
75
46
- # Install the dependencies to run the tests .
47
- $PIP_CMD install -q aiohttp google grpcio pytest requests
76
+ # Run a simple test script to make sure that the wheel works .
77
+ INSTALLED_RAY_DIRECTORY= $( dirname " $( $PYTHON_EXE -u -c " import ray; print(ray.__file__) " | tail -n1 ) " )
48
78
49
- # Run a simple test script to make sure that the wheel works.
50
- INSTALLED_RAY_DIRECTORY= $( dirname " $( $PYTHON_EXE -u -c " import ray; print(ray.__file__) " | tail -n1 ) " )
51
- $PYTHON_EXE " $TEST_SCRIPT "
79
+ for SCRIPT in " ${TEST_SCRIPTS[@]} " ; do
80
+ retry " $PYTHON_EXE " " $SCRIPT "
81
+ done
52
82
53
- # Run the UI test to make sure that the packaged UI works.
54
- $PYTHON_EXE " $UI_TEST_SCRIPT "
83
+ # Run the UI test to make sure that the packaged UI works.
84
+ retry " $PYTHON_EXE " " $UI_TEST_SCRIPT "
85
+ done
55
86
56
87
# Check that the other wheels are present.
57
88
NUMBER_OF_WHEELS=$( ls -1q " $ROOT_DIR " /../../.whl/* .whl | wc -l)
58
- if [[ " $NUMBER_OF_WHEELS " != " 3 " ]]; then
89
+ if [[ " $NUMBER_OF_WHEELS " != " 4 " ]]; then
59
90
echo " Wrong number of wheels found."
60
91
ls -l " $ROOT_DIR /../.whl/"
61
92
exit 2
62
93
fi
63
94
64
95
elif [[ " $platform " == " macosx" ]]; then
65
96
MACPYTHON_PY_PREFIX=/Library/Frameworks/Python.framework/Versions
97
+ PY_WHEEL_VERSIONS=(" 35" " 36" " 37" " 38" )
66
98
PY_MMS=(" 3.5"
67
99
" 3.6"
68
- " 3.7" )
69
- # This array is just used to find the right wheel.
70
- PY_WHEEL_VERSIONS=(" 35"
71
- " 36"
72
- " 37" )
100
+ " 3.7"
101
+ " 3.8" )
73
102
74
103
for (( i= 0 ; i< ${# PY_MMS[@]} ; ++ i)) ; do
75
- PY_MM=${PY_MMS[i]}
76
- PY_WHEEL_VERSION=${PY_WHEEL_VERSIONS[i]}
104
+ PY_MM=" ${PY_MMS[i]} "
105
+
106
+ PY_WHEEL_VERSION=" ${PY_WHEEL_VERSIONS[i]} "
77
107
78
- PYTHON_EXE=$MACPYTHON_PY_PREFIX /$PY_MM /bin/python$PY_MM
108
+ PYTHON_EXE=" $MACPYTHON_PY_PREFIX /$PY_MM /bin/python$PY_MM "
79
109
PIP_CMD=" $( dirname " $PYTHON_EXE " ) /pip$PY_MM "
80
110
81
111
# Find the appropriate wheel by grepping for the Python version.
82
112
PYTHON_WHEEL=$( find " $ROOT_DIR /../../.whl" -type f -maxdepth 1 -print | grep -m1 " $PY_WHEEL_VERSION " )
83
113
84
114
# Install the wheel.
85
- $PIP_CMD install -q " $PYTHON_WHEEL "
115
+ " $PIP_CMD " install -q " $PYTHON_WHEEL "
86
116
87
117
# Install the dependencies to run the tests.
88
- $PIP_CMD install -q aiohttp google grpcio pytest requests
118
+ " $PIP_CMD " install -q aiohttp google grpcio pytest requests
89
119
90
120
# Run a simple test script to make sure that the wheel works.
91
121
INSTALLED_RAY_DIRECTORY=$( dirname " $( $PYTHON_EXE -u -c " import ray; print(ray.__file__)" | tail -n1) " )
92
- $PYTHON_EXE " $TEST_SCRIPT "
122
+ for SCRIPT in " ${TEST_SCRIPTS[@]} " ; do
123
+ retry " $PYTHON_EXE " " $SCRIPT "
124
+ done
93
125
94
126
if (( $(echo "$PY_MM >= 3 .0 " | bc) )) ; then
95
127
# Run the UI test to make sure that the packaged UI works.
96
- $PYTHON_EXE " $UI_TEST_SCRIPT "
128
+ retry " $PYTHON_EXE " " $UI_TEST_SCRIPT "
97
129
fi
98
130
99
131
done
0 commit comments