Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add unit test reports to L0_json, L0_metrics, L0_response_cache, L0_backend_python #6823

Merged
merged 8 commits into from
Jan 25, 2024
Merged
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
12 changes: 2 additions & 10 deletions qa/L0_backend_python/argument_validation/test.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# Copyright 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# Copyright 2022-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
Expand Down Expand Up @@ -27,7 +27,6 @@

CLIENT_PY=../python_unittest.py
CLIENT_LOG="./arg_validation_client.log"
EXPECTED_NUM_TESTS="1"
TEST_RESULT_FILE='test_results.txt'
TRITON_DIR=${TRITON_DIR:="/opt/tritonserver"}
SERVER=${TRITON_DIR}/bin/tritonserver
Expand All @@ -49,18 +48,11 @@ fi

set +e
export MODEL_NAME="argument_validation"
python3 $CLIENT_PY > $CLIENT_LOG 2>&1
python3 -m pytest --junitxml="${MODEL_NAME}.report.xml" $CLIENT_PY >> $CLIENT_LOG 2>&1

if [ $? -ne 0 ]; then
echo -e "\n***\n*** python_unittest.py FAILED. \n***"
RET=1
else
check_test_results $TEST_RESULT_FILE $EXPECTED_NUM_TESTS
if [ $? -ne 0 ]; then
cat $CLIENT_LOG
echo -e "\n***\n*** Test Result Verification Failed\n***"
RET=1
fi
fi
set -e

Expand Down
23 changes: 3 additions & 20 deletions qa/L0_backend_python/bls/test.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# Copyright 2021-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# Copyright 2021-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
Expand Down Expand Up @@ -27,7 +27,6 @@

CLIENT_PY=../python_unittest.py
CLIENT_LOG="./bls_client.log"
EXPECTED_NUM_TESTS="1"
TEST_RESULT_FILE='test_results.txt'
source ../../common/util.sh

Expand Down Expand Up @@ -120,20 +119,12 @@ for CUDA_MEMORY_POOL_SIZE_MB in 64 128 ; do
for MODEL_NAME in bls bls_memory bls_memory_async bls_async; do
export MODEL_NAME=${MODEL_NAME}

python3 $CLIENT_PY >> $CLIENT_LOG 2>&1
python3 -m pytest --junitxml="${MODEL_NAME}.${TRIAL}.${CUDA_MEMORY_POOL_SIZE_MB}.report.xml" $CLIENT_PY >> $CLIENT_LOG 2>&1
if [ $? -ne 0 ]; then
echo -e "\n***\n*** ${MODEL_NAME} ${BLS_KIND} test FAILED. \n***"
cat $SERVER_LOG
cat $CLIENT_LOG
RET=1
else
check_test_results $TEST_RESULT_FILE $EXPECTED_NUM_TESTS
if [ $? -ne 0 ]; then
cat $SERVER_LOG
cat $CLIENT_LOG
echo -e "\n***\n*** Test Result Verification Failed for ${MODEL_NAME} ${BLS_KIND}\n***"
RET=1
fi
fi
done

Expand Down Expand Up @@ -254,20 +245,12 @@ else

set +e

python3 $CLIENT_PY >> $CLIENT_LOG 2>&1
python3 -m pytest --junitxml="${MODEL_NAME}.report.xml" $CLIENT_PY >> $CLIENT_LOG 2>&1
if [ $? -ne 0 ]; then
echo -e "\n***\n*** 'bls_model_loading' test FAILED. \n***"
cat $CLIENT_LOG
RET=1
SUB_TEST_RET=1
else
check_test_results $TEST_RESULT_FILE $EXPECTED_NUM_TESTS
if [ $? -ne 0 ]; then
cat $CLIENT_LOG
echo -e "\n***\n*** Test Result Verification Failed\n***"
RET=1
SUB_TEST_RET=1
fi
fi

set -e
Expand Down
12 changes: 2 additions & 10 deletions qa/L0_backend_python/custom_metrics/test.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# Copyright 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# Copyright 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
Expand Down Expand Up @@ -27,7 +27,6 @@

CLIENT_PY=../python_unittest.py
CLIENT_LOG="./custom_metrics_client.log"
EXPECTED_NUM_TESTS="1"
TEST_RESULT_FILE='test_results.txt'
source ../../common/util.sh

Expand All @@ -54,18 +53,11 @@ fi
set +e

export MODEL_NAME='custom_metrics'
python3 $CLIENT_PY >> $CLIENT_LOG 2>&1
python3 -m pytest --junitxml="${MODEL_NAME}.report.xml" $CLIENT_PY >> $CLIENT_LOG 2>&1
if [ $? -ne 0 ]; then
echo -e "\n***\n*** 'Custom Metrics' test FAILED. \n***"
cat $CLIENT_LOG
RET=1
else
check_test_results $TEST_RESULT_FILE $EXPECTED_NUM_TESTS
if [ $? -ne 0 ]; then
cat $CLIENT_LOG
echo -e "\n***\n*** Test Result Verification Failed\n***"
RET=1
fi
fi

set -e
Expand Down
5 changes: 2 additions & 3 deletions qa/L0_backend_python/decoupled/decoupled_test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3

# Copyright 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# Copyright 2022-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
Expand Down Expand Up @@ -37,7 +37,6 @@

import numpy as np
import shm_util
import test_util as tu
import tritonclient.grpc as grpcclient
from tritonclient.utils import *

Expand All @@ -54,7 +53,7 @@ def callback(user_data, result, error):
user_data._completed_requests.put(result)


class DecoupledTest(tu.TestResultCollector):
class DecoupledTest(unittest.TestCase):
def setUp(self):
self._shm_leak_detector = shm_util.ShmLeakDetector()

Expand Down
12 changes: 2 additions & 10 deletions qa/L0_backend_python/decoupled/test.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# Copyright 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# Copyright 2022-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
Expand Down Expand Up @@ -27,7 +27,6 @@

CLIENT_PY=./decoupled_test.py
CLIENT_LOG="./decoupled_client.log"
EXPECTED_NUM_TESTS="7"
TEST_RESULT_FILE='test_results.txt'
TRITON_DIR=${TRITON_DIR:="/opt/tritonserver"}
SERVER=${TRITON_DIR}/bin/tritonserver
Expand Down Expand Up @@ -95,18 +94,11 @@ if [ "$SERVER_PID" == "0" ]; then
fi

set +e
python3 $CLIENT_PY > $CLIENT_LOG 2>&1
python3 -m pytest --junitxml=decoupled.report.xml $CLIENT_PY > $CLIENT_LOG 2>&1

if [ $? -ne 0 ]; then
echo -e "\n***\n*** decoupled test FAILED. \n***"
RET=1
else
check_test_results $TEST_RESULT_FILE $EXPECTED_NUM_TESTS
if [ $? -ne 0 ]; then
cat $CLIENT_LOG
echo -e "\n***\n*** Test Result Verification Failed\n***"
RET=1
fi
fi
set -e

Expand Down
5 changes: 2 additions & 3 deletions qa/L0_backend_python/ensemble/ensemble_test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3

# Copyright 2021-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# Copyright 2021-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
Expand Down Expand Up @@ -34,12 +34,11 @@

import numpy as np
import shm_util
import test_util as tu
import tritonclient.http as httpclient
from tritonclient.utils import *


class EnsembleTest(tu.TestResultCollector):
class EnsembleTest(unittest.TestCase):
def setUp(self):
self._shm_leak_detector = shm_util.ShmLeakDetector()

Expand Down
12 changes: 2 additions & 10 deletions qa/L0_backend_python/ensemble/test.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# Copyright 2021-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# Copyright 2021-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
Expand All @@ -26,7 +26,6 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

CLIENT_LOG="./ensemble_client.log"
EXPECTED_NUM_TESTS="2"
TEST_RESULT_FILE='test_results.txt'
source ../common.sh
source ../../common/util.sh
Expand Down Expand Up @@ -75,18 +74,11 @@ if [ "$SERVER_PID" == "0" ]; then
fi

set +e
python3 ensemble_test.py 2>&1 > $CLIENT_LOG
python3 -m pytest --junitxml=ensemble.report.xml ensemble_test.py 2>&1 > $CLIENT_LOG

if [ $? -ne 0 ]; then
echo -e "\n***\n*** ensemble_test.py FAILED. \n***"
RET=1
else
check_test_results $TEST_RESULT_FILE $EXPECTED_NUM_TESTS
if [ $? -ne 0 ]; then
cat $CLIENT_LOG
echo -e "\n***\n*** Test Result Verification Failed\n***"
RET=1
fi
fi
set -e

Expand Down
5 changes: 2 additions & 3 deletions qa/L0_backend_python/io/io_test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3

# Copyright 2021-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# Copyright 2021-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
Expand Down Expand Up @@ -38,7 +38,6 @@

import numpy as np
import shm_util
import test_util as tu
import tritonclient.grpc as grpcclient
from tritonclient.utils import *

Expand All @@ -57,7 +56,7 @@ def callback(user_data, result, error):
user_data._completed_requests.put(result)


class IOTest(tu.TestResultCollector):
class IOTest(unittest.TestCase):
def setUp(self):
self._shm_leak_detector = shm_util.ShmLeakDetector()
self._client = grpcclient.InferenceServerClient("localhost:8001")
Expand Down
47 changes: 15 additions & 32 deletions qa/L0_backend_python/io/test.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# Copyright 2021-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# Copyright 2021-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
Expand Down Expand Up @@ -27,7 +27,6 @@

UNITTEST_PY=./io_test.py
CLIENT_LOG="./io_client.log"
EXPECTED_NUM_TESTS="1"
TEST_RESULT_FILE='test_results.txt'
source ../common.sh
source ../../common/util.sh
Expand Down Expand Up @@ -83,18 +82,12 @@ for trial in $TRIALS; do
fi

set +e
python3 $UNITTEST_PY IOTest.test_ensemble_io > $CLIENT_LOG.test_ensemble_io
SUBTEST="test_ensemble_io"
python3 -m pytest --junitxml=${SUBTEST}.${TRIAL}.report.xml ${UNITTEST_PY}::IOTest::${SUBTEST} >> ${CLIENT_LOG}.${SUBTEST}
if [ $? -ne 0 ]; then
echo -e "\n***\n*** IOTest.test_ensemble_io FAILED. \n***"
cat $CLIENT_LOG.test_ensemble_io
echo -e "\n***\n*** IOTest.${SUBTEST} FAILED. \n***"
cat $CLIENT_LOG.${SUBTEST}
RET=1
else
check_test_results $TEST_RESULT_FILE $EXPECTED_NUM_TESTS
if [ $? -ne 0 ]; then
cat $CLIENT_LOG.test_ensemble_io
echo -e "\n***\n*** Test Result Verification Failed\n***"
RET=1
fi
fi
set -e

Expand All @@ -116,18 +109,13 @@ if [ "$SERVER_PID" == "0" ]; then
fi

set +e
python3 $UNITTEST_PY IOTest.test_empty_gpu_output > $CLIENT_LOG.test_empty_gpu_output
SUBTEST="test_empty_gpu_output"
python3 -m pytest --junitxml=${SUBTEST}.${TRIAL}.report.xml ${UNITTEST_PY}::IOTest::${SUBTEST} > ${CLIENT_LOG}.${SUBTEST}

if [ $? -ne 0 ]; then
echo -e "\n***\n*** IOTest.test_empty_gpu_output FAILED. \n***"
cat $CLIENT_LOG.test_empty_gpu_output
echo -e "\n***\n*** IOTest.${SUBTEST} FAILED. \n***"
cat $CLIENT_LOG.${SUBTEST}
RET=1
else
check_test_results $TEST_RESULT_FILE $EXPECTED_NUM_TESTS
if [ $? -ne 0 ]; then
cat $CLIENT_LOG.test_empty_gpu_output
echo -e "\n***\n*** Test Result Verification Failed\n***"
RET=1
fi
fi
set -e

Expand All @@ -148,18 +136,13 @@ if [ "$SERVER_PID" == "0" ]; then
fi

set +e
python3 $UNITTEST_PY IOTest.test_variable_gpu_output > $CLIENT_LOG.test_variable_gpu_output
SUBTEST="test_variable_gpu_output"
python3 -m pytest --junitxml=${SUBTEST}.${TRIAL}.report.xml ${UNITTEST_PY}::IOTest::${SUBTEST} > ${CLIENT_LOG}.${SUBTEST}

if [ $? -ne 0 ]; then
echo -e "\n***\n*** IOTest.variable_gpu_output FAILED. \n***"
cat $CLIENT_LOG.test_variable_gpu_output
echo -e "\n***\n*** IOTest.${SUBTEST} FAILED. \n***"
cat $CLIENT_LOG.${SUBTEST}
RET=1
else
check_test_results $TEST_RESULT_FILE $EXPECTED_NUM_TESTS
if [ $? -ne 0 ]; then
cat $CLIENT_LOG.test_variable_gpu_output
echo -e "\n***\n*** Test Result Verification Failed\n***"
RET=1
fi
fi
set -e

Expand Down
5 changes: 2 additions & 3 deletions qa/L0_backend_python/lifecycle/lifecycle_test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3

# Copyright 2019-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# Copyright 2019-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
Expand Down Expand Up @@ -37,7 +37,6 @@

import numpy as np
import shm_util
import test_util as tu
import tritonclient.grpc as grpcclient
import tritonclient.http as httpclient
from tritonclient.utils import *
Expand All @@ -55,7 +54,7 @@ def callback(user_data, result, error):
user_data._completed_requests.put(result)


class LifecycleTest(tu.TestResultCollector):
class LifecycleTest(unittest.TestCase):
def setUp(self):
self._shm_leak_detector = shm_util.ShmLeakDetector()

Expand Down
Loading
Loading