Skip to content

Commit

Permalink
fix: tls and simplecov condition number
Browse files Browse the repository at this point in the history
  • Loading branch information
mrexox committed Jun 29, 2023
1 parent a037654 commit a2e96a1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/coverage_reporter/api/jobs.cr
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ module CoverageReporter
api_url,
body: body,
headers: headers,
tls: ENV["COVERALLS_ENDPOINT"]? ? OpenSSL::SSL::Context::Client.insecure : nil
tls: nil
)

Api.handle_response(response)
Expand Down
10 changes: 8 additions & 2 deletions src/coverage_reporter/parsers/simplecov_parser.cr
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,19 @@ module CoverageReporter
coverage = info.lines
info_branches = info.branches
if info_branches
prev_line = 0u64
condition_number = 0u64
info_branches.each do |branch, branch_info|
branch_number = 0u64
line_number = branch.split(", ")[2].to_u64
condition_number = 0u64 if line_number != prev_line
prev_line = line_number
branch_number = 0u64
branch_info.each_value do |hits|
branch_number += 1
branches.push(line_number, 0, branch_number, hits)
branches.push(line_number, condition_number, branch_number, hits)
end
ensure
condition_number += 1
end
end
end
Expand Down

0 comments on commit a2e96a1

Please sign in to comment.