Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion codecov_cli/services/upload/legacy_upload_sender.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,16 @@ def _generate_network_section(self, upload_data: UploadCollectionResult) -> byte
return network_files_section.encode() + b"<<<<<< network\n"

def _generate_coverage_files_section(self, upload_data: UploadCollectionResult):
return b"".join(self._format_coverage_file(file) for file in upload_data.files)
sections = []
for file in upload_data.files:
try:
sections.append(self._format_coverage_file(file))
except FileNotFoundError:
logger.warning(
"Coverage file not found, skipping: %s",
file.get_filename(),
)
return b"".join(sections)

def _format_coverage_file(self, file: UploadCollectionResultFile) -> bytes:
header = b"# path=" + file.get_filename().encode() + b"\n"
Expand Down
11 changes: 10 additions & 1 deletion codecov_cli/services/upload/upload_sender.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,16 @@ def _get_file_fixers(
return file_fixers

def _get_files(self, upload_data: UploadCollectionResult):
return [self._format_file(file) for file in upload_data.files]
files = []
for file in upload_data.files:
try:
files.append(self._format_file(file))
except FileNotFoundError:
logger.warning(
"Coverage file not found, skipping: %s",
file.get_filename(),
)
return files

def _format_file(self, file: UploadCollectionResultFile):
format, formatted_content = self._get_format_info(file)
Expand Down
Loading