Skip to content

Commit 0dd3e47

Browse files
authored
Merge pull request #207 from padovan/lab-runtime
results: Add runtime field to boot and test JSON output
2 parents 57c2694 + bc5dfa4 commit 0dd3e47

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

kcidev/subcommands/results/parser.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,12 @@ def create_test_json(test, log_path):
9090
config_name = test["config"]
9191
elif "config_name" in test:
9292
config_name = test["config_name"]
93-
return {
93+
94+
runtime = None
95+
if "misc" in test.keys():
96+
runtime = test["misc"].get("runtime")
97+
98+
json_output = {
9499
"test_path": test["path"],
95100
"hardware": test["environment_misc"]["platform"],
96101
"compatibles": test.get("environment_compatible", []),
@@ -103,6 +108,11 @@ def create_test_json(test, log_path):
103108
"dashboard": f"https://dashboard.kernelci.org/build/{test['id']}",
104109
}
105110

111+
if runtime:
112+
json_output["runtime"] = runtime
113+
114+
return json_output
115+
106116

107117
def cmd_summary(data, use_json):
108118
logging.info("Generating results summary")
@@ -427,6 +437,13 @@ def print_test(test, log_path):
427437

428438
kci_msg(f" log: {log_path}")
429439
kci_msg(f" start time: {test['start_time']}")
440+
441+
if "misc" in test.keys():
442+
runtime = test["misc"].get("runtime")
443+
kci_msg_nonl(" runtime: ")
444+
kci_msg_cyan(runtime, nl=False)
445+
kci_msg("")
446+
430447
kci_msg(f" id: {test['id']}")
431448
kci_msg(f" dashboard: https://dashboard.kernelci.org/test/{test['id']}")
432449
kci_msg("")

0 commit comments

Comments
 (0)