-
Notifications
You must be signed in to change notification settings - Fork 165
[NOTEST][WIP] Adding ReportParser class and miq blame command #9110
base: master
Are you sure you want to change the base?
Conversation
327adfc
to
b2a8536
Compare
If possible rename
Thanks for initialize this... I am facing problem with |
@digitronik I have no issue renaming. @mshriver @jawatts what you guys think? |
b2a8536
to
4a0c8c2
Compare
2c797a3
to
3c7a863
Compare
3c7a863
to
9c262f9
Compare
9c262f9
to
6560fc4
Compare
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.
I cannot test this locally due to no json data, but I have some general comments and suggestions, please take a look
pass | ||
|
||
|
||
@main.command("test-report", help="Returns a Dictionary containing failed test cases per user") |
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.
Thoughts on naming this something else? My concern is that this makes it sound like you're running a test. One thought is that the calling sequence could be miq blame <user>
so that it makes it seem like you're literally blaming the person 😄 The all the other args could be optional. Not sure if it's worth the refactor though, so I'd like to hear your thoughts.
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.
@john-dupuy I'd like to get one more review on this before I refactor. Don't want to refactor only to go back to what it was. I like your idea too. :)
default='') | ||
@click.option("--filter-by", type=click.Choice(['passed', 'failed', 'skipped']), | ||
help="Defaults to 'failed'", default='failed') | ||
def test_results_per_assignee(report_file, email_config_yaml, user, filter_by): |
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.
When I run miq blame test-report
, I get an Unhandled TypeError that doesn't really explain why my command failed, it'd be useful to have it print some required about the required options.
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.
Making --report-file required would make it go away.
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.
I marked that arg as required so it should not give TypeError now.
cfme/scripting/report_parser.py
Outdated
rp = ReportParser(report_file) | ||
test_report_dict = rp.parse_report_per_user(filter_by, user) | ||
# user is required before following routine would execute, else no email is sent | ||
if test_report_dict and email_config_yaml and user: |
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.
Is there anyway to generate the report for all users? Because if so I'd expect the default to do that.
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.
So by default user is ''
so it fetches report for each user. And I am adding a default_to_addr
so that if user is not defined, email would go to default_to_addr
. Currently I derive email from username, but if we want to be explicit that would require more work. I understood the task as we will have our kerberos username in assignee.
cfme/scripting/report_parser.py
Outdated
@click.option("--report-file", help="Path to the file with json data") | ||
@click.option("--email-config-yaml", help="If you decide to use this option,copy yaml file similar" | ||
" to report_parser_email_conf.yaml.template with correct values and pass its path." | ||
" No email would be sent if --user is not set.", |
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.
No email will be sent if --user is not set
-> shouldn't this be under the --user
field?
cfme/scripting/report_parser.py
Outdated
|
||
@main.command("test-report", help="Returns a Dictionary containing failed test cases per user") | ||
@click.option("--report-file", help="Path to the file with json data") | ||
@click.option("--email-config-yaml", help="If you decide to use this option,copy yaml file similar" |
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.
Any default value for this option? I suggest that the help message simply read The path to your email configuration file, e.g. "report_parser_email_conf.yaml"
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.
No default values really. But I updated the message.
cfme/scripting/report_parser.py
Outdated
|
||
|
||
@main.command("test-report", help="Returns a Dictionary containing failed test cases per user") | ||
@click.option("--report-file", help="Path to the file with json data") |
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.
Any default value for this option?
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.
I think I can create something dummy, do we want that in the repo?
6560fc4
to
1a6d558
Compare
Would you mind rebasing this Pull Request against latest master, please? |
Purpose or Intent
Adding miq blame command that will be able to take a Json file as input and return list of test cases per assignee and also provide failed tests report.