mirror of
https://github.com/karma-riuk/crab.git
synced 2025-07-05 13:38:12 +02:00
if no 'jacoco.xml' file was found, throwing an error
This commit is contained in:
@ -205,10 +205,17 @@ class MavenHandler(BuildHandler):
|
|||||||
|
|
||||||
def get_jacoco_report_paths(self) -> Iterable[str]:
|
def get_jacoco_report_paths(self) -> Iterable[str]:
|
||||||
# yield os.path.join(self.path, "target/site/jacoco-aggregate/jacoco.xml")
|
# yield os.path.join(self.path, "target/site/jacoco-aggregate/jacoco.xml")
|
||||||
for root, _, files in os.walk(os.path.join(self.path, "target", "site")):
|
found_at_least_one = False
|
||||||
|
for root, _, files in os.walk(os.path.join(self.path)):
|
||||||
|
if "target/site" not in root:
|
||||||
|
continue # to avoid any misleading jacoco.xml randomly lying around
|
||||||
for file in files:
|
for file in files:
|
||||||
if file == "jacoco.xml":
|
if file == "jacoco.xml":
|
||||||
|
found_at_least_one = True
|
||||||
yield os.path.join(root, file)
|
yield os.path.join(root, file)
|
||||||
|
if not found_at_least_one:
|
||||||
|
raise NoCoverageReportFound(f"Couldn't find any 'jacoco.xml' in {self.path}")
|
||||||
|
|
||||||
class GradleHandler(BuildHandler):
|
class GradleHandler(BuildHandler):
|
||||||
def __init__(self, repo_path: str, build_file: str, updates: dict) -> None:
|
def __init__(self, repo_path: str, build_file: str, updates: dict) -> None:
|
||||||
super().__init__(repo_path, build_file, updates)
|
super().__init__(repo_path, build_file, updates)
|
||||||
|
Reference in New Issue
Block a user