Skip to content
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
13 changes: 5 additions & 8 deletions python/cuopt_server/cuopt_server/tests/test_bill_logging.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# SPDX-FileCopyrightText: Copyright (c) 2023-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

import json
import os
import platform
import shutil
import signal
Expand Down Expand Up @@ -29,16 +30,12 @@ def test_time_limit_logs():
)
dataset = json.load(open(dataset_path))
client = RequestClient(port=5010)
env = {
"CUOPT_SERVER_IP": "127.0.0.1",
"CUOPT_SERVER_PORT": "5010",
"CUOPT_SERVER_LOG_LEVEL": "debug",
"CUOPT_MAX_SOLVE_TIME_LIMIT": "5",
}
env = os.environ.copy()
env["CUOPT_MAX_SOLVE_TIME_LIMIT"] = "5"

url = "/cuopt/"

cmd = python_path + " " + server_script
cmd = python_path + " " + server_script + " -i 127.0.0.1 -p 5010 -l debug"
process = pexpect.spawn(cmd, env=env)

try:
Expand Down
16 changes: 10 additions & 6 deletions python/cuopt_server/cuopt_server/tests/test_server_health.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# SPDX-FileCopyrightText: Copyright (c) 2023-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

import os
import shutil

import pexpect
Expand All @@ -18,11 +19,14 @@
def test_server_health(args):
env = None
if args == "env":
env = {
"CUOPT_SERVER_IP": "127.0.0.1",
"CUOPT_SERVER_PORT": "5001",
"CUOPT_SERVER_LOG_LEVEL": "error",
}
env = os.environ.copy()
env.update(
{
"CUOPT_SERVER_IP": "127.0.0.1",
"CUOPT_SERVER_PORT": "5001",
"CUOPT_SERVER_LOG_LEVEL": "error",
}
)
url = (
"http://"
+ env["CUOPT_SERVER_IP"]
Expand Down
21 changes: 14 additions & 7 deletions python/cuopt_server/cuopt_server/tests/utils/utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: Copyright (c) 2022-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

import os
Expand Down Expand Up @@ -315,12 +315,19 @@ def spinup_wait():
@pytest.fixture(scope="session")
def cuoptproc(request):
global cuoptmain
env = {
"CUOPT_SERVER_IP": "0.0.0.0",
"CUOPT_SERVER_PORT": "5555",
"CUOPT_SERVER_LOG_LEVEL": "debug",
}
cuoptmain = Popen([python_path, server_script, server_module], env=env)
cuoptmain = Popen(
[
python_path,
server_script,
server_module,
"-i",
"0.0.0.0",
"-p",
"5555",
"-l",
"debug",
]
)
spinup_wait()

def shutdown():
Expand Down