Skip to content

Commit 8d7b996

Browse files
committed
update spelling + fixes
1 parent e8a6f22 commit 8d7b996

18 files changed

Lines changed: 52 additions & 42 deletions

File tree

tests/functional/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ def get_uses_mapping():
243243
save_image_to_artifacts = get_bool("TT_SAVE_IMAGE_TO_ARTIFACTS", False)
244244

245245
"""TT_SET_NO_PROXY"""
246-
set_no_proxy = os.environ.get("TT_SET_NO_PROXY", True)
246+
set_no_proxy = get_bool("TT_SET_NO_PROXY", True)
247247
no_proxy = os.environ.get("no_proxy", "")
248248
if set_no_proxy:
249249
os.environ["NO_PROXY"] = no_proxy

tests/functional/constants/ovms_messages.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ class OvmsMessages:
256256
ERROR_EXCEPTION_CATCH = "Exception catch:"
257257

258258
CPU_EXTENSION_LOADING_CUSTOM_CPU_EXT = "Loading custom CPU extension from {}"
259-
CPU_EXTENSION_LOADED = "Custom CPU extention loaded. Adding it."
259+
CPU_EXTENSION_LOADED = "Custom CPU extension loaded. Adding it."
260260
CPU_EXTENSION_ADDED = "Extension added."
261261

262262
ERROR_CPU_EXTENSION_WILL_NOW_TERMINATE = "- will now terminate."

tests/functional/constants/paths.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def get_target_device_lock_file(target_device, i):
6868
if isinstance(target_device, str):
6969
assert not all(x in target_device for x in [TargetDevice.GPU, TargetDevice.NPU])
7070

71-
# generalize HETERO/AUTO/MUTLI:X => `X`
71+
# generalize HETERO/AUTO/MULTI:X => `X`
7272
if TargetDevice.GPU in target_device:
7373
return os.path.join(config.ovms_file_locks_dir, f"target_device_{TargetDevice.GPU}_{i}.lock")
7474
if TargetDevice.NPU in target_device:

tests/functional/data/ovms_capi_wrapper/ovms_autopxd.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,5 +73,5 @@ def translate(self, code):
7373
input_file_path = Path(args.input_file)
7474
output_file_path = Path(args.output_file)
7575

76-
with open(output_file_path, "w") as fo:
77-
fo.write(OvmsAutoPxd(input_file_path.name).translate(input_file_path.read_text()))
76+
with open(output_file_path, "w") as file_object:
77+
file_object.write(OvmsAutoPxd(input_file_path.name).translate(input_file_path.read_text()))

tests/functional/object_model/custom_node.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,9 @@ def __post_init__(self):
140140
@dataclass
141141
class OvmsTestDevCustomNode(DevCustomNode):
142142
def __post_init__(self):
143-
self.src_dir = os.path.join(ovms_test_repo_path, "data", "ovms_testing_image", Paths.CUSTOM_NODE_PATH_NAME)
143+
self.src_dir = os.path.join(
144+
ovms_c_repo_path, "tests", "functional", "utils", "ovms_testing_image", Paths.CUSTOM_NODE_PATH_NAME
145+
)
144146
self.src_file_path = os.path.join(self.src_dir, self.name, f"{self.name}.{self.src_type}")
145147
super().__post_init__()
146148

tests/functional/object_model/ovms_docker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,7 @@ def __init__(self, docker_id, name, container_folder, rest_port, grpc_port, targ
643643
)
644644

645645
def fetch_and_store_ovms_pid(self, timeout=60):
646-
self._dmesg_log.ovms_pid = None # Not implemetned yet
646+
self._dmesg_log.ovms_pid = None # Not implemented yet
647647

648648
def _create_logger(self):
649649
return OvmsCmdLineDockerLogMonitor(self.docker_id)

tests/functional/object_model/python_custom_nodes/python_custom_nodes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@ def get_expected_output(self, input_data: dict, client_type: str = None):
137137
# For REST API and BYTES type, every batch is always preceding by the 4 bytes, that contains its size
138138
# [42, 0, 0, 0] is constant value for "Lorem ipsum dolor sit amet"
139139
# https://github.com/openvinotoolkit/model_server/blob/main/docs/model_server_rest_api_kfs.md
140-
splitted = np.array_split(np.array(char_array, dtype=np.object_), multiply_value)
141-
extended_with_length = [np.insert(elem, 0, [42, 0, 0, 0]) for elem in splitted]
140+
elements = np.array_split(np.array(char_array, dtype=np.object_), multiply_value)
141+
extended_with_length = [np.insert(elem, 0, [42, 0, 0, 0]) for elem in elements]
142142
output_data[self.output_names[i]] = np.concatenate(extended_with_length, dtype=np.object_)
143143

144144
return output_data

tests/functional/object_model/resource_monitor.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ class DockerResourceMonitor(ResourceMonitor):
6666
# "CPU_USAGE": lambda x:
6767
# [cpu / x['cpu_stats']['cpu_usage']['total_usage'] for cpu in x['cpu_stats']['cpu_usage']['percpu_usage']],
6868
}
69+
# Optional callback invoked after save_data with (log_path).
70+
on_data_saved = None
6971

7072
def __init__(self, container):
7173
super().__init__()
@@ -96,6 +98,8 @@ def save_data(self):
9698
writer = csv.DictWriter(csvfile, fieldnames=DockerResourceMonitor.FIELDS)
9799
writer.writeheader()
98100
writer.writerows(self.rows)
101+
if DockerResourceMonitor.on_data_saved:
102+
DockerResourceMonitor.on_data_saved(log_path)
99103
return log_path
100104

101105
def plot_fo_file(self, x, y, field, filename):

tests/functional/object_model/test_environment.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ def update_model_files(model, models_dir):
3737
if hasattr(model, "max_position_embeddings") and model.max_position_embeddings is not None:
3838
config_file_path = os.path.join(models_dir[0], model.name, "config.json")
3939
if os.path.exists(config_file_path):
40-
with open(config_file_path, "r") as fo:
41-
config_data = json.load(fo)
40+
with open(config_file_path, "r") as file_object:
41+
config_data = json.load(file_object)
4242
config_data["max_position_embeddings"] = model.max_position_embeddings
43-
with open(config_file_path, "w") as fo:
44-
json.dump(config_data, fo)
43+
with open(config_file_path, "w") as file_object:
44+
json.dump(config_data, file_object)
4545
logger.info(
4646
f"max_position_embeddings value was updated to {model.max_position_embeddings} "
4747
f"in model's config file: {config_file_path}."

tests/functional/utils/docker.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ class DockerContainer(metaclass=ABCMeta):
107107
NOT_ON_LIST_RETRY = {"tries": 10, "delay": 2}
108108
GETTING_LOGS_RETRY = COMMON_RETRY
109109
GETTING_STATUS_RETRY = COMMON_RETRY
110+
# Optional callback invoked before log check with (container_name).
111+
on_log_check = None
110112

111113
def __init__(
112114
self,
@@ -289,6 +291,8 @@ def check_non_empty_logs(self, specific_str: str, acceptable_logs_length_trigger
289291
def ensure_logs_contain_specific_str(
290292
self, specific_str: str, acceptable_logs_length_trigger: int = 0, retry_kwargs: dict = None, **kwargs
291293
):
294+
if DockerContainer.on_log_check:
295+
DockerContainer.on_log_check(self.name)
292296
args = [specific_str, acceptable_logs_length_trigger]
293297
getting_logs_retry = self.GETTING_LOGS_RETRY.copy()
294298
if retry_kwargs:

0 commit comments

Comments
 (0)