Skip to content
This repository has been archived by the owner on Apr 7, 2022. It is now read-only.

[RFR] Updated bz coverage utility to not update bugs in coverage= marker #10130

Merged
merged 8 commits into from
May 21, 2020
26 changes: 18 additions & 8 deletions cfme/scripting/bz.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,19 @@
BZ_URL = conf.env.bugzilla.url


def get_report(directory):
def get_report(directory, inc_manual=True):
mshriver marked this conversation as resolved.
Show resolved Hide resolved
mshriver marked this conversation as resolved.
Show resolved Hide resolved
click.echo("Generating a BZ report in bz-report.yaml")
pytest.main([
"--use-provider", "complete",
options = ["--use-provider", "complete",
"--long-running",
"--use-template-cache",
"--collect-only",
"--dummy-appliance",
"--include-manual",
"-q",
"--generate-bz-report", directory
])
"--generate-bz-report"
]
if inc_manual:
mshriver marked this conversation as resolved.
Show resolved Hide resolved
options.append("--include-manual")
pytest.main(options.append(directory))
# read the generated yaml
try:
with open("bz-report.yaml") as stream:
Expand Down Expand Up @@ -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",
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

"inc_manual",
mshriver marked this conversation as resolved.
Show resolved Hide resolved
is_flag=True,
help="Include BZs that are marked in coverage test metadata for manual tests",
default=False,
show_default=True
)
@click.option(
"-s",
"--set",
Expand Down Expand Up @@ -263,8 +273,8 @@ def list(directory, bz_status):
show_default=True,
flag_value="closed_bzs"
)
def coverage(directory, set_bzs, bz_status):
info = get_report(directory)
def coverage(directory, inc_manual, set_bzs, bz_status):
mshriver marked this conversation as resolved.
Show resolved Hide resolved
info = get_report(directory, inc_manual=inc_manual)
mshriver marked this conversation as resolved.
Show resolved Hide resolved

# get list of bzs that should have test coverage set
bz_list = get_qe_test_coverage(info, bz_status)
Expand Down