Skip to content

Customizing reporting data of sessions #758

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
cbscsm opened this issue Jan 18, 2024 · 1 comment
Open

Customizing reporting data of sessions #758

cbscsm opened this issue Jan 18, 2024 · 1 comment

Comments

@cbscsm
Copy link

cbscsm commented Jan 18, 2024

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

@felixfontein
Copy link

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!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants