Conversation
Locust summaryGit referencesInitial: 77d598eTerminal: 8d02ce1 locust/render.pyChanges:
|
zomglings
left a comment
There was a problem hiding this comment.
@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.
@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.
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:
|
zomglings
left a comment
There was a problem hiding this comment.
@kompotkot : Requested a change.
locust/cli.py
Outdated
|
|
||
| results_string = render.run(parse_result, args.format, args.github) | ||
|
|
||
| if args.metadata and args.format == "json": |
There was a problem hiding this comment.
We should provide a consistent interface across all formats. A better way to do this is to modify locust/render.py.
-
Add
--metadataargument inpopulate_argument_parser. (Give it a type ofjson.loadsand a default value of{}.) -
Add an
enrich_with_metadata functionwhich acceptsargs.metadataand enriches theresultsobject (seeenrich_with_refsfor 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.