summaryrefslogtreecommitdiff
path: root/doc/invocations-http-server/server.py
diff options
context:
space:
mode:
authorKlaus Aehlig <klaus.aehlig@huawei.com>2025-05-13 14:20:20 +0200
committerKlaus Aehlig <klaus.aehlig@huawei.com>2025-05-13 14:51:08 +0200
commit8f14cdd6cacf3652de77f527eea3d5efca5cca62 (patch)
tree18964cb0c9daa5f97ac16b7c494283b68dcbb4a1 /doc/invocations-http-server/server.py
parent13a4031450c34a087b1998540077b595938d29f0 (diff)
downloadjustbuild-8f14cdd6cacf3652de77f527eea3d5efca5cca62.tar.gz
Invocation server: show actions with console output separately
Normally, actions are supposed to work silently, i.e., without writing to stdout/stderr. So, if an action produces console output, it is definitely worth looking at, even for cached actions. Therefore, add a section after the failed actions showing those actions (if not in the previous action). Also, always show duration (if known) and if an action is cached (which can happen for the ones producing console output).
Diffstat (limited to 'doc/invocations-http-server/server.py')
-rwxr-xr-xdoc/invocations-http-server/server.py18
1 files changed, 16 insertions, 2 deletions
diff --git a/doc/invocations-http-server/server.py b/doc/invocations-http-server/server.py
index 6ff6b668..d1791c16 100755
--- a/doc/invocations-http-server/server.py
+++ b/doc/invocations-http-server/server.py
@@ -391,7 +391,10 @@ class InvocationServer:
def action_data(name, profile_value):
data = { "name_prefix": "",
"name": name,
+ "cached": profile_value.get('cached'),
"exit_code": profile_value.get('exit code', 0)}
+ duration = profile_value.get('duration', 0.0)
+ data["duration"] = '%0.3fs' % (duration,) if duration > 0 else None
desc = graph.get('actions', {}).get(name, {})
data["may_fail"] = desc.get("may_fail")
data["stdout"] = profile_value.get('stdout')
@@ -414,24 +417,35 @@ class InvocationServer:
data["origins"] = origins
return data
+ actions_considered = set()
failed_build_actions = []
failed_test_actions = []
for k, v in profile.get('actions', {}).items():
if v.get('exit code', 0) != 0:
+ actions_considered.add(k)
if graph.get('actions', {}).get(k, {}).get('may_fail') != None:
failed_test_actions.append(action_data(k, v))
else:
failed_build_actions.append(action_data(k, v))
params["failed_actions"] = failed_build_actions + failed_test_actions
- # longest running non-cached non-failed actions
+ # non-failed actions with output
+ output_actions = []
+ for k, v in profile.get('actions', {}).items():
+ if k not in actions_considered:
+ if v.get('stdout') or v.get('stderr'):
+ actions_considered.add(k)
+ output_actions.append(action_data(k,v))
+ params["output_actions"] = output_actions
+
+ # longest running non-cached non-failed actions without output
candidates = []
action_count = 0
action_count_cached = 0
for k, v in profile.get('actions', {}).items():
action_count += 1
if not v.get('cached'):
- if v.get('exit code', 0) == 0:
+ if k not in actions_considered:
candidates.append((v.get('duration', 0.0), k, v))
else:
action_count_cached += 1