Skip to content

Commit 8fd3396

Browse files
authored
test: Add tests for the Triton log callback (#8858)
1 parent 5b27afc commit 8fd3396

3 files changed

Lines changed: 23 additions & 2 deletions

File tree

Dockerfile.QA

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ RUN mkdir -p qa/common && \
144144
cp bin/response_cache_test qa/L0_response_cache/. && \
145145
cp bin/request_cancellation_test qa/L0_request_cancellation/. && \
146146
cp bin/triton_json_test qa/L0_json/. && \
147+
cp bin/logging_test qa/L0_logging/. && \
147148
cp bin/backend_output_detail_test qa/L0_backend_output_detail/. && \
148149
cp -r deploy/mlflow-triton-plugin qa/L0_mlflow/. && \
149150
cp bin/input_byte_size_test qa/L0_input_validation/.

qa/L0_logging/test.sh

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# Copyright 2022-2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
# Copyright 2022-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
33
#
44
# Redistribution and use in source and binary forms, with or without
55
# modification, are permitted provided that the following conditions
@@ -654,6 +654,17 @@ fi
654654
unset $SERVER_ERROR_LOG
655655
set -e
656656

657+
# Triton common log-callback test.
658+
set +e
659+
UNIT_TEST_LOG="./log_callback_test.log"
660+
./logging_test --gtest_output=xml:logging.report.xml >> $UNIT_TEST_LOG 2>&1
661+
if [ $? -ne 0 ]; then
662+
cat $UNIT_TEST_LOG
663+
echo -e "\n***\n*** Logging Callback Unit Test Failed\n***"
664+
RET=1
665+
fi
666+
set -e
667+
657668
if [ $RET -eq 0 ]; then
658669
echo -e "\n***\n*** Test Passed\n***"
659670
else

qa/L0_python_api/test.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# Copyright 2023-2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
# Copyright 2023-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
33
#
44
# Redistribution and use in source and binary forms, with or without
55
# modification, are permitted provided that the following conditions
@@ -58,6 +58,15 @@ if [ $? -ne 0 ]; then
5858
RET=1
5959
fi
6060

61+
LOG_CALLBACK_TEST_LOG="./python_logging_callback.log"
62+
rm -f $LOG_CALLBACK_TEST_LOG
63+
python -m pytest --junitxml=test_logging_callback_report.xml test_logging_callback.py > $LOG_CALLBACK_TEST_LOG 2>&1
64+
if [ $? -ne 0 ]; then
65+
cat $LOG_CALLBACK_TEST_LOG
66+
echo -e "\n***\n*** Test Failed\n***"
67+
RET=1
68+
fi
69+
6170
set -e
6271

6372
if [ $RET -eq 0 ]; then

0 commit comments

Comments
 (0)