-
Notifications
You must be signed in to change notification settings - Fork 165
[RFR] Updated bz coverage utility to not update bugs in coverage= marker #10130
Conversation
…= and replaced log msg with exception when no bz creds
These updates were made quickly with getting the utility working so we could update bugs being the priority. I wanted to get it out for review comments. I am trying to determine where we want to catch the Exceptions thrown if we have no bz creds, and what specifically to do when caught. Thinking we want to write something to store.terminalreporter and end the test, but from where? And I want to make sure, when I removed the coverage= code , I didn't create an issue with something else using the code I updated. Seems unlikely, but I have no idea. |
cfme/fixtures/bzs.py
Outdated
if "automates" not in item._metadata and "coverage" not in item._metadata: | ||
continue |
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.
@prichard77 rather than removing the handling of the coverage
/manual cases altogether, I think we should make it an option (--include-manual
) that defaults to False
.
Something like
group.addoption(
'--include-manual',
action='store_true',
default=False,
dest='include_manual',
help='Include manual coverage in the report'
)
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.
Then the miq bz
command can also have an --include-manual
flag that can trickle into the pytest.main
call in get_report
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.
Sounds like a great idea. working on it...
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.
Looking at where this is called from, there already is a --include-manual
option being used in get_report(), line 55. I am assuming we want to default to not using this option and add the ability to use it as needed from the CL.
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.
OH that's right, we should just use that! So we can just add an --include-manual
flag in miq bz coverage
and then include it in the pytest.main
call based on 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.
That way no changes are required to cfme.fixtures.bzs.py
I removed my initial changes. Now only scripting.py has been updated (still have to work on checking for creds). I added an option to coverage. I have done a little testing on this, but it's tough to test thoroughly as we have already updated all of the Bugs to reflect the correct/current state. There is no work to be done by the utility now. |
cfme/scripting/bz.py
Outdated
@@ -224,6 +225,15 @@ def list(directory, bz_status): | |||
|
|||
@main.command(help="Set QE test coverage flag based on automates/coverage metadata") | |||
@click.argument("directory", default="cfme/tests") | |||
@click.option( | |||
"-m", | |||
"--inc_man", |
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.
@prichard77 for consistency with the pytest
arg, I suggest we just call this --include-manual
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.
Done
I was going to make sure I added --inc_manual to all of the functions where it was applicable, but it looks like all the others are fine like they are. All others are specifically looking for 'coverage' so turning it off would make no sense. Please let me know if I missed one for which the option should apply. |
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.
LGTM, just one suggestion, but I'd consider it optional
Updating arg to include_manual Co-authored-by: john-dupuy <[email protected]>
missed one of the include_manual changes
Purpose or Intent
PRT Run
Suggestions on what to use here?