Skip to content

Commit

Permalink
since worker doesn't accept empty reports, or not saving anything in …
Browse files Browse the repository at this point in the history
…the storage url, let the cli raise an exception to the users when no coverage reports found
  • Loading branch information
dana-yaish committed Aug 7, 2023
1 parent 1eb6dd4 commit e622d43
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions codecov_cli/services/upload/upload_collector.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
from collections import namedtuple
from fnmatch import fnmatch

import click

from codecov_cli.services.upload.coverage_file_finder import CoverageFileFinder
from codecov_cli.services.upload.network_finder import NetworkFinder
from codecov_cli.types import (
Expand Down Expand Up @@ -132,6 +134,13 @@ def generate_upload_data(self) -> UploadCollectionResult:
network = self.network_finder.find_files()
coverage_files = self.coverage_file_finder.find_coverage_files()
logger.info(f"Found {len(coverage_files)} coverage files to upload")
if not coverage_files:
raise click.ClickException(
click.style(
"No coverage reports found. Please make sure you're generating reports successfully.",
fg="red",
)
)
for file in coverage_files:
logger.info(f"> {file}")
return UploadCollectionResult(
Expand Down

0 comments on commit e622d43

Please sign in to comment.