summaryrefslogtreecommitdiff
path: root/tools/testing/kunit/kunit_json.py
diff options
context:
space:
mode:
authorDaniel Latypov <dlatypov@google.com>2021-12-14 11:26:12 -0800
committerShuah Khan <skhan@linuxfoundation.org>2021-12-15 11:50:56 -0700
commite0cc8c052a3992b01f51df1d51eaae49e5b2710f (patch)
tree57788e7d607a5f927c120633fc96ae35c22e5aa8 /tools/testing/kunit/kunit_json.py
parentdb1679813f9f86b05bbbc6f05f4cdbe481d59352 (diff)
kunit: tool: delete kunit_parser.TestResult type
The `log` field is unused, and the `status` field is accessible via `test.status`. So it's simpler to just return the main `Test` object directly. And since we're no longer returning a namedtuple, which has no type annotations, this hopefully means typecheckers are better equipped to find any errors. Signed-off-by: Daniel Latypov <dlatypov@google.com> Reviewed-by: Brendan Higgins <brendanhiggins@google.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Diffstat (limited to 'tools/testing/kunit/kunit_json.py')
-rw-r--r--tools/testing/kunit/kunit_json.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/testing/kunit/kunit_json.py b/tools/testing/kunit/kunit_json.py
index b6e66c5d64d1..6862671709bc 100644
--- a/tools/testing/kunit/kunit_json.py
+++ b/tools/testing/kunit/kunit_json.py
@@ -11,7 +11,7 @@ import os
import kunit_parser
-from kunit_parser import Test, TestResult, TestStatus
+from kunit_parser import Test, TestStatus
from typing import Any, Dict, Optional
JsonObj = Dict[str, Any]
@@ -50,9 +50,9 @@ def _get_group_json(test: Test, def_config: str,
}
return test_group
-def get_json_result(test_result: TestResult, def_config: str,
+def get_json_result(test: Test, def_config: str,
build_dir: Optional[str], json_path: str) -> str:
- test_group = _get_group_json(test_result.test, def_config, build_dir)
+ test_group = _get_group_json(test, def_config, build_dir)
test_group["name"] = "KUnit Test Group"
json_obj = json.dumps(test_group, indent=4)
if json_path != 'stdout':