Skip to content

Commit 741400e

Browse files
Copilotkwerle
andauthored
Add coverage target using rcov (#115)
* Initial plan * Add coverage target with rcov support Co-authored-by: kwerle <23320+kwerle@users.noreply.github.com> * Add include paths to rcov command for proper test execution Co-authored-by: kwerle <23320+kwerle@users.noreply.github.com> * Remove redundant gem install from coverage target Co-authored-by: kwerle <23320+kwerle@users.noreply.github.com> * Remove -it flags from coverage target Co-authored-by: kwerle <23320+kwerle@users.noreply.github.com> * Use simplecov instead of rcov --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: kwerle <23320+kwerle@users.noreply.github.com> Co-authored-by: Kurt Werle <kurt@CircleW.org>
1 parent 699cc79 commit 741400e

5 files changed

Lines changed: 25 additions & 0 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
*.gem
33
.Trash*
44
*.log
5+
coverage

Gemfile.lock

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ GEM
4949
debug (1.11.1)
5050
irb (~> 1.10)
5151
reline (>= 0.3.8)
52+
docile (1.4.1)
5253
drb (2.2.3)
5354
erb (6.0.1)
5455
etc (1.4.6)
@@ -165,6 +166,12 @@ GEM
165166
ruby-progressbar (1.13.0)
166167
securerandom (0.4.1)
167168
shellany (0.0.1)
169+
simplecov (0.22.0)
170+
docile (~> 1.1)
171+
simplecov-html (~> 0.11)
172+
simplecov_json_formatter (~> 0.1)
173+
simplecov-html (0.13.2)
174+
simplecov_json_formatter (0.1.4)
168175
sqlite3 (2.9.0-aarch64-linux-musl)
169176
stringio (3.2.0)
170177
sync (0.5.0)
@@ -202,6 +209,7 @@ DEPENDENCIES
202209
rubocop-rake
203210
rubocop-rspec
204211
ruby_language_server!
212+
simplecov
205213

206214
CHECKSUMS
207215
activemodel (8.1.1)
@@ -218,6 +226,7 @@ CHECKSUMS
218226
connection_pool (3.0.2)
219227
date (3.5.1)
220228
debug (1.11.1)
229+
docile (1.4.1)
221230
drb (2.2.3)
222231
erb (6.0.1)
223232
etc (1.4.6)
@@ -271,6 +280,9 @@ CHECKSUMS
271280
ruby_language_server (0.4.2)
272281
securerandom (0.4.1)
273282
shellany (0.0.1)
283+
simplecov (0.22.0)
284+
simplecov-html (0.13.2)
285+
simplecov_json_formatter (0.1.4)
274286
sqlite3 (2.9.0-aarch64-linux-musl)
275287
stringio (3.2.0)
276288
sync (0.5.0)

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ console: image
2929
test: image
3030
./bin/run_in_shell "bundle exec rake test && bundle exec rubocop"
3131

32+
coverage: image
33+
./bin/run_in_shell "COVERAGE=true bundle exec rake test"
34+
3235
shell: image
3336
./bin/run_in_shell sh
3437

ruby_language_server.gemspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,5 +59,6 @@ Gem::Specification.new do |spec|
5959
spec.add_development_dependency 'rubocop-performance' # Linter - no longer needed - use additional gems?
6060
spec.add_development_dependency 'rubocop-rake'
6161
spec.add_development_dependency 'rubocop-rspec' # Linter - no longer needed - use additional gems?
62+
spec.add_development_dependency 'simplecov'
6263
spec.metadata['rubygems_mfa_required'] = 'true'
6364
end

spec/test_helper.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# frozen_string_literal: true
22

3+
if ENV['COVERAGE']
4+
require 'simplecov'
5+
SimpleCov.start do
6+
add_filter '/spec/'
7+
add_filter '/vendor/'
8+
end
9+
end
10+
311
require 'debug'
412
require 'ostruct'
513
require_relative '../lib/ruby_language_server'

0 commit comments

Comments
 (0)