gemini-code-assist[bot] commented on code in PR #19947:
URL: https://github.com/apache/tvm/pull/19947#discussion_r3524195093
##########
tests/scripts/task_python_unittest.sh:
##########
@@ -62,7 +61,13 @@ TEST_FILES=(
PYTEST_TARGETS=()
for TEST_FILE in "${TEST_FILES[@]}"; do
- PYTEST_TARGETS+=("tests/python/${TEST_FILE}")
+ TEST_PATH="tests/python/${TEST_FILE}"
+ if [ ! -d "${TEST_PATH}" ]; then
+ echo "Missing pytest target: ${TEST_PATH}" >&2
+ exit 1
+ fi
+ PYTEST_TARGETS+=("${TEST_PATH}")
Review Comment:

Using `[ ! -d ... ]` strictly requires the test target to be a directory.
However, pytest can run on individual test files as well. Changing this check
to `[ ! -e ... ]` (exists) makes the script more robust and allows adding
individual test files to `TEST_FILES` in the future without failing this guard.
```suggestion
if [ ! -e "${TEST_PATH}" ]; then
echo "Missing pytest target: ${TEST_PATH}" >&2
exit 1
fi
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]