From 622638670cb356fcf75e41cdff593d8c32d9934b Mon Sep 17 00:00:00 2001 From: Krishnan Prashanth Date: Wed, 29 May 2024 17:43:26 -0700 Subject: [PATCH] Removing test_model from and for consistency --- tests/test_cli.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/tests/test_cli.py b/tests/test_cli.py index b348f7d..44b2674 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -197,6 +197,19 @@ def test_triton_metrics(self, model, setup_and_teardown): setup_and_teardown.pid = pid utils.wait_for_server_ready() + output = "" + # Redirect stdout to a buffer to capture the output of the command. + with io.StringIO() as buf, redirect_stdout(buf): + self._metrics() + output = buf.getvalue() + + metrics = json.loads(output) + + # Verifying inference count is 0 before any inference + for loaded_models in metrics["nv_inference_request_success"]["metrics"]: + if loaded_models["labels"]["model"] == model: + assert loaded_models["value"] == 0 + # Inference the Model self._infer(model, prompt=PROMPT) @@ -213,7 +226,7 @@ def test_triton_metrics(self, model, setup_and_teardown): if loaded_models["labels"]["model"] == model: assert loaded_models["value"] == 1 - @pytest.mark.parametrize("model", ["add_sub", "mock_llm"]) + @pytest.mark.parametrize("model", ["mock_llm"]) def test_triton_config(self, model, setup_and_teardown): # Import the Model pid = utils.run_server(repo=MODEL_REPO) @@ -231,7 +244,7 @@ def test_triton_config(self, model, setup_and_teardown): # Checks if correct model is loaded assert config["name"] == model - @pytest.mark.parametrize("model", ["add_sub", "mock_llm"]) + @pytest.mark.parametrize("model", ["mock_llm"]) def test_triton_status(self, model, setup_and_teardown): pid = utils.run_server(repo=MODEL_REPO) # Import the Model setup_and_teardown.pid = pid