-
Notifications
You must be signed in to change notification settings - Fork 325
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
Allow setting marker for grouping output #2361
Comments
I have a first draft over at my fork: septatrix#1, CI run: https://github.com/septatrix/mkosi/actions/runs/8178215540/job/22361691351?pr=1 Currently the pre-/postamble is hardcoded in the source as that was simpler than preserving the environment variable across the pytest invocation. Furthermore I hardcoded the |
Partially fixes: systemd#2361
Partially fixes: systemd#2361
Partially fixes: systemd#2361
Partially fixes: systemd#2361
Partially fixes: systemd#2361
Partially fixes: systemd#2361
Partially fixes: systemd#2361
Partially fixes: systemd#2361
As said in the PR this issue it's about people using mkosi inside their CI, not the selftests of mkosi in this repo. Could you please reopen this issue? |
Problem
mkosi can generate a lot of output, especially when installing packages and within the build script. Github Actions, Gitlab Jobs and Azure Devops all support means to group log lines into collapsible sections. I think it would be great if
complete_step
would use these mechanisms to make the output easier to browse.Possible solution
This could be implemented either natively by detecting if mkosi is run in one of those environment and using the corresponding log lines or by introducing a new setting (maybe using environment variables) where one can define an line to be printed before and after a step. The latter would be easier to expand to other CI solutions (e.g. I did not lookup Jenkins, Travis etc. though I guess they have similar mechanisms). A problem with the latter, however, would be that the log lines sometimes require some templating. For Github and Azure this is only the title for the log line but Gitlab also wants a timestamp as well as a section name (which is not equal to the title/header) though this could be solved with f-formatted string and us passing a bunch of stuff into them which the user may then reference.
Alternative solution
Add silent or quit flags which would result in capturing all output and only print it in case of failure. This, however, is a very drastic approach.
References
PS: I think this would also be great for the CI. Sadly pytest does not support it out of the box so we would have to roll our own solution.
The text was updated successfully, but these errors were encountered: