Skip to content

Commit df040e3

Browse files
committed
subtests make use of the subtest_properties hash map
1 parent 2913e30 commit df040e3

File tree

1 file changed

+39
-63
lines changed

1 file changed

+39
-63
lines changed

qa/L0_backend_python/test.sh

Lines changed: 39 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,12 @@ subtest_properties["logging"]=""
186186
subtest_properties["custom_metrics"]=""
187187

188188
# Add tests depending on which environment is being run.
189+
189190
# If not running in igpu mode add these
191+
# Disable env test for Jetson since cloud storage repos are not supported
192+
# Disable ensemble, io and bls tests for Jetson since GPU Tensors are not supported
193+
# Disable variants test for Jetson since already built without GPU Tensor support
194+
# Disable decoupled test because it uses GPU tensors
190195
if [ "$TEST_JETSON" == "0" ]; then
191196
subtest_properties["ensemble"]=""
192197
subtest_properties["bls"]=""
@@ -196,6 +201,11 @@ if [ "$TEST_JETSON" == "0" ]; then
196201
fi
197202

198203
# If not running on windows add these
204+
# [DLIS-6093] Disable variants test for Windows since tests are not executed in docker container (cannot apt update/install)
205+
# [DLIS-5970] Disable io tests for Windows since GPU Tensors are not supported
206+
# [DLIS-6124] Disable restart test for Windows since it requires more investigation
207+
# [DLIS-6122] Disable model_control & request_rescheduling tests for Windows since they require load/unload
208+
# [DLIS-6123] Disable examples test for Windows since it requires updates to the example clients
199209
if [[ ${TEST_WINDOWS} == 0 ]]; then
200210
subtest_properties["variants"]=""
201211
subtest_properties["io"]=""
@@ -206,100 +216,66 @@ if [[ ${TEST_WINDOWS} == 0 ]]; then
206216
subtest_properties["request_rescheduling"]=""
207217
fi
208218

219+
ALL_SUBTESTS=$(echo "${!subtest_properties[@]}")
209220
if [[ -n "${SUBTESTS}" ]]; then
210-
ALL_SUBTESTS=$(echo "${!subtest_properties[@]}")
211221
for subtest in $(echo "${!subtest_properties[@]}"); do
212222
if [[ ! "${SUBTESTS}" =~ "${subtest}" ]]; then
213223
unset "subtest_properties[${subtest}]"
214224
fi
215225
done
216226
fi
227+
ALL_SUBTESTS=$(echo "${!subtest_properties[@]}")
217228

218229
echo "Executing the following subtests: "
219230
for subtest in $(echo "${!subtest_properties[@]}"); do
220231
echo " ${subtest}: ${subtest_properties[${subtest}]}"
221232
done
222233

223234
exit 0
224-
bash -ex test_shared_memory.sh
225-
226-
227235

228-
# Disable env test for Jetson since cloud storage repos are not supported
229-
# Disable ensemble, io and bls tests for Jetson since GPU Tensors are not supported
230-
# Disable variants test for Jetson since already built without GPU Tensor support
231-
# Disable decoupled test because it uses GPU tensors
232-
if [ "$TEST_JETSON" == "0" ]; then
233-
SUBTESTS="ensemble bls decoupled response_sender"
234-
# [DLIS-6093] Disable variants test for Windows since tests are not executed in docker container (cannot apt update/install)
235-
# [DLIS-5970] Disable io tests for Windows since GPU Tensors are not supported
236-
# [DLIS-6122] Disable model_control & request_rescheduling tests for Windows since they require load/unload
237-
if [[ ${TEST_WINDOWS} == 0 ]]; then
238-
SUBTESTS+=" variants io python_based_backends async_execute"
239-
fi
240-
241-
for TEST in ${SUBTESTS}; do
242-
# Run each subtest in a separate virtual environment to avoid conflicts
243-
# between dependencies.
244-
setup_virtualenv
245-
246-
set +e
247-
(cd ${TEST} && bash -ex test.sh)
248-
EXIT_CODE=$?
249-
if [ $EXIT_CODE -ne 0 ]; then
250-
echo "Subtest ${TEST} FAILED"
251-
RET=$EXIT_CODE
252-
253-
# In bls test, it is allowed to fail with a strict memory leak of 480 bytes with exit code '123'.
254-
# Propagate the exit code to make sure it's not overwritten by other tests.
255-
if [[ ${TEST} == "bls" ]] && [[ $EXIT_CODE -ne 1 ]] ; then
256-
BLS_RET=$RET
257-
fi
258-
fi
259-
set -e
260-
261-
deactivate_virtualenv
262-
done
236+
if [[ "${ALL_SUBTETS}" =~ "shared_memory" ]]; then
237+
bash -ex test_shared_memory.sh
238+
fi
263239

264-
# [DLIS-5969]: Incorporate env test for windows
265-
if [[ ${PYTHON_ENV_VERSION} = "12" ]] && [[ ${TEST_WINDOWS} == 0 ]]; then
266-
# In 'env' test we use miniconda for dependency management. No need to run
267-
# the test in a virtual environment.
268-
set +e
269-
(cd env && bash -ex test.sh)
270-
if [ $? -ne 0 ]; then
271-
echo "Subtest env FAILED"
272-
RET=1
273-
fi
274-
set -e
240+
for TEST in ${ALL_SUBTESTS}; do
241+
if [[ "${TEST}" == "env" ]]; then
242+
continue
275243
fi
276-
fi
277244

278-
SUBTESTS="lifecycle argument_validation logging custom_metrics"
279-
# [DLIS-6124] Disable restart test for Windows since it requires more investigation
280-
# [DLIS-6122] Disable model_control & request_rescheduling tests for Windows since they require load/unload
281-
# [DLIS-6123] Disable examples test for Windows since it requires updates to the example clients
282-
if [[ ${TEST_WINDOWS} == 0 ]]; then
283-
# TODO: Reimplement restart on decoupled data pipeline and enable restart.
284-
SUBTESTS+=" model_control examples request_rescheduling"
285-
fi
286-
for TEST in ${SUBTESTS}; do
287245
# Run each subtest in a separate virtual environment to avoid conflicts
288246
# between dependencies.
289247
setup_virtualenv
290248

291249
set +e
292250
(cd ${TEST} && bash -ex test.sh)
293-
294-
if [ $? -ne 0 ]; then
251+
EXIT_CODE=$?
252+
if [ $EXIT_CODE -ne 0 ]; then
295253
echo "Subtest ${TEST} FAILED"
296-
RET=1
254+
RET=$EXIT_CODE
255+
256+
# In bls test, it is allowed to fail with a strict memory leak of 480 bytes with exit code '123'.
257+
# Propagate the exit code to make sure it's not overwritten by other tests.
258+
if [[ ${TEST} == "bls" ]] && [[ $EXIT_CODE -ne 1 ]] ; then
259+
BLS_RET=$RET
260+
fi
297261
fi
298262
set -e
299263

300264
deactivate_virtualenv
301265
done
302266

267+
if [[ ${ALL_SUBTESTS} =~ "env" ]]; then
268+
# In 'env' test we use miniconda for dependency management. No need to run
269+
# the test in a virtual environment.
270+
set +e
271+
(cd env && bash -ex test.sh)
272+
if [ $? -ne 0 ]; then
273+
echo "Subtest env FAILED"
274+
RET=1
275+
fi
276+
set -e
277+
fi
278+
303279
if [ $RET -eq 0 ]; then
304280
echo -e "\n***\n*** Test Passed\n***"
305281
else

0 commit comments

Comments
 (0)