Skip to content

Commit

Permalink
[#554] Add formatter for codecov
Browse files Browse the repository at this point in the history
  • Loading branch information
pnatashap committed Jan 30, 2024
1 parent 693177d commit 9e2356a
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 3 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ jobs:
ruby-version: '2.7'
- run: bundle update
- run: bundle exec rake
- uses: codecov/codecov-action@v4.0.0-beta.3
- uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: coverage/.resultset.json
fail_ci_if_error: true
6 changes: 5 additions & 1 deletion .simplecov
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ end

SimpleCov.start do
add_filter '/test/'
add_filter '/test-assets/'
add_filter '/features/'
# minimum_coverage 30
add_filter '/assets/'
add_filter '/dynamodb-local/'
add_filter '/public/'
minimum_coverage 30
end
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ gem 'ruby-fann', '1.4.1'
gem 'sass', '3.7.4'
gem 'sentry-raven', '3.1.2'
gem 'simplecov', '0.22.0'
gem 'simplecov-cobertura', '~> 2.1'
gem 'sinatra', '3.0.6'
gem 'sinatra-contrib', '3.0.6'
gem 'sprockets', '4.2.1'
Expand Down
4 changes: 4 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@ GEM
docile (~> 1.1)
simplecov-html (~> 0.11)
simplecov_json_formatter (~> 0.1)
simplecov-cobertura (2.1.0)
rexml
simplecov (~> 0.19)
simplecov-html (0.12.3)
simplecov_json_formatter (0.1.4)
sinatra (3.0.6)
Expand Down Expand Up @@ -239,6 +242,7 @@ DEPENDENCIES
sass (= 3.7.4)
sentry-raven (= 3.1.2)
simplecov (= 0.22.0)
simplecov-cobertura (~> 2.1)
sinatra (= 3.0.6)
sinatra-contrib (= 3.0.6)
sprockets (= 4.2.1)
Expand Down
3 changes: 3 additions & 0 deletions test/test__helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
require 'simplecov'
SimpleCov.start

require 'simplecov-cobertura'
SimpleCov.formatter = SimpleCov::Formatter::CoberturaFormatter

def object(hash)
json = hash.to_json
JSON.parse(json, object_class: OpenStruct)
Expand Down

0 comments on commit 9e2356a

Please sign in to comment.