From 8cf749ee569c3cb9b25eaeb4aacedcfab7dd0f2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9F=D0=B8=D0=B2=D0=BE=D0=B5=D0=B2=20=D0=9D=D0=B8=D0=BA?= =?UTF-8?q?=D0=B8=D1=82=D0=B0?= Date: Tue, 7 Jul 2026 17:54:31 +0300 Subject: [PATCH 1/2] fix: kirk subsystem and metrics in report --- src/imgtests/exec/loaders/kirk.py | 4 +++- src/imgtests/reporting/html_report.py | 3 +++ tests/unit/imgtests/test_adapter.py | 4 +++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/imgtests/exec/loaders/kirk.py b/src/imgtests/exec/loaders/kirk.py index 13aca0eb..7d77346c 100644 --- a/src/imgtests/exec/loaders/kirk.py +++ b/src/imgtests/exec/loaders/kirk.py @@ -283,10 +283,12 @@ def split_result( "duration": test.get("test", {}).get("duration", 0.0), } for test in results + if test.get("test", {}).get("retval", []) != ["32"] ] metrics = {str(i): metric for i, metric in enumerate(metrics)} summary = raw_metrics.get("stats", {}) + test_type = {"type": "general"} time = { "duration_sec": round(summary.get("runtime", 0.0), 2), } @@ -296,7 +298,7 @@ def split_result( return AdapterResult( tool="kirk", - test_type={}, + test_type=test_type, time=time, metrics=metrics, ) diff --git a/src/imgtests/reporting/html_report.py b/src/imgtests/reporting/html_report.py index 3cd9e8d6..704eda9d 100644 --- a/src/imgtests/reporting/html_report.py +++ b/src/imgtests/reporting/html_report.py @@ -97,6 +97,7 @@ class DiagramConfig(NamedTuple): TOOLS_TO_SUBSYSTEMS: dict[str, Subsystem] = { "iperf3": Subsystem.NETWORK, "fio": Subsystem.FILE, + "kirk": Subsystem.SYSTEM, } @@ -324,6 +325,8 @@ def _extract_metrics_from_experiment(self, experiment: ExperimentBase) -> list[M fixed_prefix = [tool, test_type["identifier"]] case "perf": fixed_prefix = [tool, test_type["benchmark"]] + case "kirk": + fixed_prefix = [tool, test_type["type"]] case _: fixed_prefix = [tool] diff --git a/tests/unit/imgtests/test_adapter.py b/tests/unit/imgtests/test_adapter.py index 4ca06ca3..c907cdd0 100644 --- a/tests/unit/imgtests/test_adapter.py +++ b/tests/unit/imgtests/test_adapter.py @@ -1000,7 +1000,9 @@ def test_pts_parse_metrics(raw_metrics: dict[str, Any], expected: dict[str, Any] }, { "tool": "kirk", - "test_type": {}, + "test_type": { + "type": "general", + }, "time": { "duration_sec": 2.30, }, From 619344a421302631c2cf16e7a3192b2c0cb82383 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9F=D0=B8=D0=B2=D0=BE=D0=B5=D0=B2=20=D0=9D=D0=B8=D0=BA?= =?UTF-8?q?=D0=B8=D1=82=D0=B0?= Date: Tue, 7 Jul 2026 17:56:44 +0300 Subject: [PATCH 2/2] refactor: remove hardcoded return code --- src/imgtests/exec/loaders/kirk.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/imgtests/exec/loaders/kirk.py b/src/imgtests/exec/loaders/kirk.py index 7d77346c..953fcf3d 100644 --- a/src/imgtests/exec/loaders/kirk.py +++ b/src/imgtests/exec/loaders/kirk.py @@ -20,6 +20,7 @@ logger = logging.getLogger(__name__) DEFAULT_LTP_RESULTS_DIR = Path("/var/tmp/ltp-results") # noqa: S108 +TEST_SKIPPED_RETURN_CODE = "32" class Kirk(GenericUtil): @@ -283,7 +284,7 @@ def split_result( "duration": test.get("test", {}).get("duration", 0.0), } for test in results - if test.get("test", {}).get("retval", []) != ["32"] + if test.get("test", {}).get("retval", []) != [TEST_SKIPPED_RETURN_CODE] ] metrics = {str(i): metric for i, metric in enumerate(metrics)}