nox icon indicating copy to clipboard operation
nox copied to clipboard

Customizing reporting data of sessions

Open cbscsm opened this issue 2 years ago • 1 comments

How would this feature be useful?

  • AFAIK, reports of nox have fixed data format: args, name, result, result_code, signatures. If I can add some custom data into it, it will be helpful.
  • For example:
    • Elapsed time which is checked from custom logic for each session.
    • Parsed result of some command or status.
    • Summary of session result.

Describe the solution you'd like

  • Allowing to add data for reporting via session object. It might be like session.report.set("elapsed_time", elapsed_time), session.report.elapsed_time("elapsed_time"), or session.report.add(elapsed_time="elapsed_time").

Describe alternatives you've considered

  • Currently, logs can contain structured data. However, comparing with data files like JSON, logs are relatively hard to be parsed or aggregated in automations like CI pipeline.
  • Or I can write my own new file. But it will be nice to integrated with built-in report file. It already has useful information.

Anything else?

No response

cbscsm avatar Jan 18 '24 08:01 cbscsm

Having more output in the log would be really great. This would allow showing especially failures in a more structured way in CI.

Something that would be especially useful is the output of programs that ran, especially the ones that failed. (That's usually the interesting bits that you want to show to users.) Having

[...]
    {
      "args": {},
      "name": "license-check",
      "result": "failed",
      "result_code": 0,
      "signatures": [
        "license-check"
      ]
    }
[...]

is not really helpful, but having the (failed, or also successful?) command run and its output (stdout and stderr) in there would be useful, so I can see what broke by only looking at the report.

(And yeah, that would require some tee like functionality for stdout and stderr, or just for stderr if silent=True is used, so it's not entirely trivial to implement. But it would be really cool to have!)

felixfontein avatar Apr 21 '25 11:04 felixfontein