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
Bugout format output #34
Conversation
Locust summaryGit referencesInitial: 77d598eTerminal: 8d02ce1 locust/render.pyChanges:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kompotkot : I suggest adding this at a different place and not making it part of the core Locust data structure (since it's data not directly relevant for static analysis, but to be used in a continuous integration environment with an external service).
locust/render.py
Outdated
|
||
try: | ||
# Parse GitHub Action file event.json | ||
event_file = "/home/runner/work/_temp/_github_workflow/event.json" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kompotkot : I suggest adding this in ci_helpers/github.py
.
Also, you should read this path from environment variable: GITHUB_EVENT_PATH
(reference: https://docs.github.com/en/free-pro-team@latest/actions/reference/environment-variables).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of adding it in the "locust"
object, we can add it at the top-level (same place where we have initial and terminal refs) as a new enricher.
8d02ce1
to
77d598e
Compare
Locust summaryGit referencesInitial: 77d598eTerminal: 472ca0f locust/cli.pyChanges:
|
1 similar comment
Locust summaryGit referencesInitial: 77d598eTerminal: 472ca0f locust/cli.pyChanges:
|
Locust summaryGit referencesInitial: 77d598eTerminal: e33c04d locust/cli.pyChanges:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kompotkot : Requested a change.
locust/cli.py
Outdated
@@ -41,6 +46,9 @@ def main(): | |||
|
|||
results_string = render.run(parse_result, args.format, args.github) | |||
|
|||
if args.metadata and args.format == "json": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should provide a consistent interface across all formats. A better way to do this is to modify locust/render.py
.
-
Add
--metadata
argument inpopulate_argument_parser
. (Give it a type ofjson.loads
and a default value of{}
.) -
Add an
enrich_with_metadata function
which acceptsargs.metadata
and enriches theresults
object (seeenrich_with_refs
for an example of this).
It takes a stringified JSON object and parses it into a Python dictionary, adding it to top level of Locust summary.
Locust summaryGit referencesInitial: 77d598eTerminal: 993bc7d locust/cli.pyChanges:
locust/render.pyChanges:
|
Added additional keys in output json file.