Skip to content
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

Merged
merged 3 commits into from Nov 3, 2020
Merged

Conversation

kompotkot
Copy link
Contributor

Added additional keys in output json file.

@github-actions
Copy link

github-actions bot commented Nov 3, 2020

Locust summary

Git references

Initial: 77d598e
Terminal: 8d02ce1

locust/render.py
Changes:

Copy link
Member

@zomglings zomglings left a 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"
Copy link
Member

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

Copy link
Member

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.

@github-actions
Copy link

github-actions bot commented Nov 3, 2020

Locust summary

Git references

Initial: 77d598e
Terminal: 77d598e

@kompotkot kompotkot reopened this Nov 3, 2020
@github-actions
Copy link

github-actions bot commented Nov 3, 2020

Locust summary

Git references

Initial: 77d598e
Terminal: 472ca0f

locust/cli.py
Changes:

1 similar comment
@github-actions
Copy link

github-actions bot commented Nov 3, 2020

Locust summary

Git references

Initial: 77d598e
Terminal: 472ca0f

locust/cli.py
Changes:

@github-actions
Copy link

github-actions bot commented Nov 3, 2020

Locust summary

Git references

Initial: 77d598e
Terminal: e33c04d

locust/cli.py
Changes:

Copy link
Member

@zomglings zomglings left a 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":
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kompotkot,

We should provide a consistent interface across all formats. A better way to do this is to modify locust/render.py.

  1. Add --metadata argument in populate_argument_parser. (Give it a type of json.loads and a default value of {}.)

  2. Add an enrich_with_metadata function which accepts args.metadata and enriches the results object (see enrich_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.
@github-actions
Copy link

github-actions bot commented Nov 3, 2020

Locust summary

Git references

Initial: 77d598e
Terminal: 993bc7d

locust/cli.py
Changes:
  • Name: main
    Type: function
    Changed lines: 1
    Total lines: 15
    locust/render.py
    Changes:

    @zomglings zomglings merged commit 358af63 into bugout-dev:main Nov 3, 2020
    @kompotkot kompotkot deleted the bugout-format-output branch February 23, 2021 09:13
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    None yet
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    None yet

    2 participants