Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(*): fix divide by zero error #52

Merged
merged 1 commit into from Mar 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 6 additions & 2 deletions lib/fastlane/plugin/fueled/helper/fueled_helper.rb
Expand Up @@ -204,8 +204,12 @@ def self.calculate_code_coverage_percentage(
end
end
end

total_code_coverage_percentage = code_coverage_percentage / number_of_files

if number_of_files == 0
UI.important("No files/tests were found, please check if this is intentional")
end

robdeans marked this conversation as resolved.
Show resolved Hide resolved
total_code_coverage_percentage = number_of_files > 0 ? code_coverage_percentage / number_of_files : 100
hadiidbouk marked this conversation as resolved.
Show resolved Hide resolved
file_message = number_of_files > 1 ? "files" : "file"
UI.message("Checked code coverage on #{number_of_files} #{file_message} with total percentage of #{total_code_coverage_percentage}%")

Expand Down