Skip to content

Commit f8e7ca4

Browse files
committed
Fix for new simplecov results file
1 parent 0bc53bb commit f8e7ca4

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

lib/coverage_report.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def generate(type, report_path, data)
1515
def simplecov(report_path, data)
1616
report = read_json(report_path)
1717
minumum_percent = data[:min]
18-
covered_percent = report.dig('result', 'covered_percent')
18+
covered_percent = report.dig('result', 'line') || report.dig('result', 'covered_percent')
1919
{ 'lines' => { 'covered_percent' => covered_percent, 'minumum_percent' => minumum_percent } }
2020
end
2121

lib/github_check_run_service.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def run
1717
)['id']
1818
@summary = @report_adapter.summary(@report)
1919
@annotations = @report_adapter.annotations(@report)
20-
@conclusion = @report_adapter.conslusion(@report)
20+
@conclusion = @report_adapter.conclusion(@report)
2121
@percent = @report_adapter.lines_covered_percent(@report)
2222

2323
@client.patch(

lib/report_adapter.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ class << self
66
CONCLUSION_TYPES = { failure: 'failure', success: 'success' }.freeze
77
ANNOTATION_LEVEL = { notice: 'notice', warning: 'warning', failure: 'failure' }.freeze
88

9-
def conslusion(report)
9+
def conclusion(report)
1010
lines_covered_percent(report) >= lines_minimum_percent(report).to_f ? CONCLUSION_TYPES[:success] : CONCLUSION_TYPES[:failure]
1111
end
1212

spec/fixtures/simplecov.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"result": {
3-
"covered_percent": 80.5
3+
"line": 80.5
44
}
55
}

spec/report_adapter_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313

1414
let(:adapter) { ReportAdapter }
1515

16-
it '.conslusion' do
17-
result = adapter.conslusion(report)
16+
it '.conclusion' do
17+
result = adapter.conclusion(report)
1818
expect(result).to eq('success')
1919
end
2020

0 commit comments

Comments
 (0)