Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions scripts/pytest-utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,16 @@ pytest() {
pytest_extra_args+=(
"--select-from-file=$TRITON_TEST_SELECTFILE"
)
elif [[ -n $TRITON_TEST_SELECT ]]; then
pytest_extra_args+=(
"--select-test=$TRITON_TEST_SELECT"
)
fi

if [[ $TRITON_TEST_DEBUG_FAIL = true ]]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this option? In my opinion our developers usually debug individual test variant and call pytest directly.

Copy link
Contributor Author

@slawblauciak slawblauciak Nov 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was added in the previous PR and is merely meant to be a convenience thing.

pytest_extra_args+=(
"--pdb"
)
fi

if [[ ! -f $TRITON_TEST_SELECTFILE && -v TRITON_TEST_SUITE && -f $TRITON_TEST_SKIPLIST_DIR/$TRITON_TEST_SUITE.txt ]]; then
Expand Down
14 changes: 13 additions & 1 deletion scripts/test-triton.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ OPTION:
--skip-list SKIPLIST
--extra-skip-list-suffixes SEMICOLON-SEPARATED LIST OF SUFFIXES
--select-from-file SELECTFILE
--select NAME
--debug-fail
"

err() {
Expand Down Expand Up @@ -86,6 +88,8 @@ TRITON_TEST_IGNORE_ERRORS=false
SKIP_PIP=false
SKIP_PYTORCH=false
TEST_UNSKIP=false
TRITON_TEST_SELECT=""
TRITON_TEST_DEBUG_FAIL=false

while (( $# != 0 )); do
case "$1" in
Expand Down Expand Up @@ -273,6 +277,14 @@ while (( $# != 0 )); do
TRITON_TEST_SELECTFILE="$(realpath "$2")"
shift 2
;;
--select)
TRITON_TEST_SELECT="$2"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this option work in conjunction with the skiplist?

shift 2
;;
--debug-fail)
TRITON_TEST_DEBUG_FAIL=true
shift
;;
--help)
echo "$HELP"
exit 0
Expand Down Expand Up @@ -342,7 +354,7 @@ run_unit_tests() {
}

run_pytest_command() {
if [[ -n "$TRITON_TEST_SELECTFILE" ]]; then
if [[ -n "$TRITON_TEST_SELECTFILE" ]] || [[ -n "$TRITON_TEST_SELECT" ]]; then
if pytest "$@" --collect-only > /dev/null 2>&1; then
pytest "$@"
fi
Expand Down
Loading