Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
693af60
add some todos
tycooon Aug 22, 2020
2521b5c
add method coverage criterion
tycooon Aug 22, 2020
d68a977
add some temp stuff
tycooon Aug 22, 2020
1f40180
add basic method coverage support
tycooon Aug 22, 2020
d609d16
fix serialization
tycooon Aug 22, 2020
f00fdf2
some fixes and fix all specs
tycooon Sep 2, 2020
31b95e7
add methods combiner
tycooon Sep 2, 2020
fa3902a
update ci config
tycooon Sep 2, 2020
b929673
Merge remote-tracking branch 'upstream/main' into add-method-coverage…
tycooon Sep 2, 2020
a78b5ed
add some backwards compability to result serialization
tycooon Sep 3, 2020
b16b6e5
add some methods for html report
tycooon Sep 3, 2020
3ae4b18
Merge remote-tracking branch 'upstream/main' into add-method-coverage…
tycooon Sep 22, 2020
66e6e0b
revert simplecov-html version
tycooon Sep 22, 2020
d79cb80
fix rubocop issues
tycooon Sep 22, 2020
4904192
fix flacky specs
tycooon Sep 22, 2020
03d1180
Merge remote-tracking branch 'upstream/main' into add-method-coverage…
tycooon Oct 27, 2020
3eff8b7
minor refactor
tycooon Apr 23, 2021
efb3e20
Merge remote-tracking branch 'upstream/main' into add-method-coverage…
tycooon Apr 23, 2021
9fafd3c
fix results collation
tycooon Apr 23, 2021
6420688
update test app gemfile
tycooon Apr 23, 2021
ddccb3c
add specs
tycooon Apr 23, 2021
15c03b2
optimize result merger
tycooon Apr 24, 2021
9a8b324
add specs for method cov merging
tycooon Apr 24, 2021
dc754e4
add feature specs for method coverage
tycooon Apr 30, 2021
b5c29b4
fix indentation in features
tycooon Apr 30, 2021
bb5aad1
skip method coverage features if not supported
tycooon Apr 30, 2021
0501b73
fix build
tycooon Apr 30, 2021
ed40a9d
add SimpleCov::Utils
tycooon Nov 16, 2021
a9978b0
update bundler
tycooon Nov 16, 2021
5cdbe21
update nokogiri
tycooon Jan 7, 2023
b5fc6e9
Merge remote-tracking branch 'upstream/main' into add-method-coverage…
tycooon Jan 7, 2023
a07dd23
update gemfiles
tycooon Jan 7, 2023
bb0fd38
fix gh workflow
tycooon Jan 7, 2023
ed4fb86
fix spec
tycooon Jan 7, 2023
15ab790
add some todos
tycooon Jan 9, 2023
7dca89d
Merge remote-tracking branch 'upstream/main' into add-method-coverage…
tycooon Dec 25, 2023
c13f0b1
fix rubocop issue
tycooon Dec 25, 2023
037a493
revert bundler version
tycooon Dec 25, 2023
8ede952
update simplecov-html
tycooon Dec 25, 2023
2811cc1
update branch
tycooon Nov 4, 2025
c59387a
Merge remote-tracking branch 'upstream/main' into add-method-coverage…
tycooon Nov 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ jobs:
env:
BUNDLE_WITHOUT: "benchmark"
JRUBY_OPTS: "--debug"
SIMPLECOV_HTML_MODE: "methods" # TODO: remove after simplecov-html release
strategy:
fail-fast: false

Expand Down
22 changes: 16 additions & 6 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,25 @@

source "https://rubygems.org"

# Uncomment this to use local copy of simplecov-html in development when checked out
# gem "simplecov-html", path: File.join(__dir__, "../simplecov-html")

# Uncomment this to use development version of html formatter from github
# gem "simplecov-html", github: "simplecov-ruby/simplecov-html"
case ENV.fetch("SIMPLECOV_HTML_MODE", nil)
when "local"
# Use local copy of simplecov-html in development when checked out
gem "simplecov-html", path: File.join(__dir__, "../simplecov-html")
when "github"
# Use development version of html formatter from github
gem "simplecov-html", git: "https://github.com/simplecov-ruby/simplecov-html.git"
when "methods" # TODO: remove after simplecov-html release
gem "simplecov-html", git: "https://github.com/umbrellio/simplecov-html.git", branch: "add-method-coverage-support"
end

gem "base64"
gem "bigdecimal"
gem "matrix"
gem "mutex_m"
gem "ostruct"

group :development do
gem "apparition", github: "twalpole/apparition"
gem "apparition", git: "https://github.com/twalpole/apparition.git"
gem "activesupport", "~> 6.1"
gem "aruba"
gem "capybara"
Expand All @@ -28,6 +37,7 @@ group :development do
gem "rubocop", "~> 1.70.0" if RUBY_VERSION > "3.2"
gem "test-unit"
gem "logger"
gem "power_assert", "~> 2.0" if RUBY_VERSION < "3.0"
# Explicitly add webrick because it has been removed from stdlib in Ruby 3.0
gem "webrick"
end
Expand Down
178 changes: 103 additions & 75 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ GIT
capybara (~> 3.13, < 4)
websocket-driver (>= 0.6.5)

GIT
remote: https://github.com/umbrellio/simplecov-html.git
revision: d85b595f3911564723fdf1fcb83c0bca7f9bddf9
branch: add-method-coverage-support
specs:
simplecov-html (0.13.2)

PATH
remote: .
specs:
Expand All @@ -25,17 +32,16 @@ GEM
zeitwerk (~> 2.3)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
aruba (2.3.0)
aruba (2.3.2)
bundler (>= 1.17, < 3.0)
contracts (>= 0.16.0, < 0.18.0)
cucumber (>= 8.0, < 10.0)
rspec-expectations (~> 3.4)
cucumber (>= 8.0, < 11.0)
rspec-expectations (>= 3.4, < 5.0)
thor (~> 1.0)
ast (2.4.2)
base64 (0.2.0)
ast (2.4.3)
base64 (0.3.0)
benchmark-ips (2.14.0)
bigdecimal (3.1.9)
bigdecimal (3.1.9-java)
bigdecimal (3.3.1)
builder (3.3.0)
capybara (3.40.0)
addressable
Expand All @@ -47,88 +53,104 @@ GEM
regexp_parser (>= 1.5, < 3.0)
xpath (~> 3.2)
coderay (1.1.3)
concurrent-ruby (1.3.4)
concurrent-ruby (1.3.5)
contracts (0.17.2)
cucumber (9.2.1)
cucumber (10.1.1)
base64 (~> 0.2)
builder (~> 3.2)
cucumber-ci-environment (> 9, < 11)
cucumber-core (> 13, < 14)
cucumber-cucumber-expressions (~> 17.0)
cucumber-gherkin (> 24, < 28)
cucumber-core (> 15, < 17)
cucumber-cucumber-expressions (> 17, < 19)
cucumber-html-formatter (> 20.3, < 22)
cucumber-messages (> 19, < 25)
diff-lcs (~> 1.5)
logger (~> 1.6)
mini_mime (~> 1.1)
multi_test (~> 1.1)
sys-uname (~> 1.2)
sys-uname (~> 1.3)
cucumber-ci-environment (10.0.1)
cucumber-core (13.0.3)
cucumber-gherkin (>= 27, < 28)
cucumber-messages (>= 20, < 23)
cucumber-tag-expressions (> 5, < 7)
cucumber-cucumber-expressions (17.1.0)
cucumber-core (15.3.0)
cucumber-gherkin (> 27, < 35)
cucumber-messages (> 26, < 30)
cucumber-tag-expressions (> 5, < 9)
cucumber-cucumber-expressions (18.0.1)
bigdecimal
cucumber-gherkin (27.0.0)
cucumber-messages (>= 19.1.4, < 23)
cucumber-html-formatter (21.7.0)
cucumber-messages (> 19, < 27)
cucumber-messages (22.0.0)
cucumber-tag-expressions (6.1.1)
diff-lcs (1.5.1)
cucumber-gherkin (34.0.0)
cucumber-messages (> 25, < 29)
cucumber-html-formatter (21.15.1)
cucumber-messages (> 19, < 28)
cucumber-messages (27.2.0)
cucumber-tag-expressions (8.0.0)
diff-lcs (1.6.2)
docile (1.4.1)
ffi (1.17.1)
ffi (1.17.1-java)
i18n (1.14.6)
ffi (1.17.2-aarch64-linux-gnu)
ffi (1.17.2-aarch64-linux-musl)
ffi (1.17.2-arm-linux-gnu)
ffi (1.17.2-arm-linux-musl)
ffi (1.17.2-arm64-darwin)
ffi (1.17.2-x86_64-darwin)
ffi (1.17.2-x86_64-linux-gnu)
ffi (1.17.2-x86_64-linux-musl)
i18n (1.14.7)
concurrent-ruby (~> 1.0)
json (2.9.1)
json (2.9.1-java)
language_server-protocol (3.17.0.3)
json (2.15.2)
language_server-protocol (3.17.0.5)
logger (1.7.0)
matrix (0.4.2)
matrix (0.4.3)
memoist3 (1.0.0)
method_source (1.1.0)
mini_mime (1.1.5)
mini_portile2 (2.8.8)
minitest (5.25.4)
minitest (5.26.0)
multi_test (1.1.0)
nokogiri (1.18.1)
mini_portile2 (~> 2.8.2)
mutex_m (0.3.0)
nokogiri (1.18.10-aarch64-linux-gnu)
racc (~> 1.4)
nokogiri (1.18.10-aarch64-linux-musl)
racc (~> 1.4)
nokogiri (1.18.10-arm-linux-gnu)
racc (~> 1.4)
nokogiri (1.18.10-arm-linux-musl)
racc (~> 1.4)
nokogiri (1.18.10-arm64-darwin)
racc (~> 1.4)
parallel (1.26.3)
parser (3.3.6.0)
nokogiri (1.18.10-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.18.10-x86_64-linux-gnu)
racc (~> 1.4)
nokogiri (1.18.10-x86_64-linux-musl)
racc (~> 1.4)
ostruct (0.6.3)
parallel (1.27.0)
parser (3.3.10.0)
ast (~> 2.4.1)
racc
power_assert (2.0.5)
power_assert (3.0.0)
prism (1.6.0)
pry (0.15.2)
coderay (~> 1.1)
method_source (~> 1.0)
pry (0.15.2-java)
coderay (~> 1.1)
method_source (~> 1.0)
spoon (~> 0.0)
public_suffix (6.0.1)
public_suffix (6.0.2)
racc (1.8.1)
racc (1.8.1-java)
rack (3.1.8)
rack (3.2.4)
rack-test (2.2.0)
rack (>= 1.3)
rackup (2.2.1)
rack (>= 3)
rainbow (3.1.1)
rake (13.2.1)
regexp_parser (2.10.0)
rspec (3.13.0)
rake (13.3.1)
regexp_parser (2.11.3)
rspec (3.13.2)
rspec-core (~> 3.13.0)
rspec-expectations (~> 3.13.0)
rspec-mocks (~> 3.13.0)
rspec-core (3.13.2)
rspec-core (3.13.6)
rspec-support (~> 3.13.0)
rspec-expectations (3.13.3)
rspec-expectations (3.13.5)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-mocks (3.13.2)
rspec-mocks (3.13.7)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-support (3.13.2)
rspec-support (3.13.6)
rubocop (1.70.0)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
Expand All @@ -139,58 +161,64 @@ GEM
rubocop-ast (>= 1.36.2, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.37.0)
parser (>= 3.3.1.0)
rubocop-ast (1.47.1)
parser (>= 3.3.7.2)
prism (~> 1.4)
ruby-progressbar (1.13.0)
simplecov-html (0.13.1)
simplecov_json_formatter (0.1.4)
spoon (0.0.6)
ffi
sys-uname (1.3.1)
sys-uname (1.4.1)
ffi (~> 1.1)
test-unit (3.6.7)
memoist3 (~> 1.0.0)
test-unit (3.7.1)
power_assert
thor (1.3.2)
thor (1.4.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (3.1.4)
unicode-emoji (~> 4.0, >= 4.0.4)
unicode-emoji (4.0.4)
unicode-display_width (3.2.0)
unicode-emoji (~> 4.1)
unicode-emoji (4.1.0)
webrick (1.9.1)
websocket-driver (0.7.7)
base64
websocket-extensions (>= 0.1.0)
websocket-driver (0.7.7-java)
websocket-driver (0.8.0)
base64
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
xpath (3.2.0)
nokogiri (~> 1.8)
zeitwerk (2.7.1)
zeitwerk (2.7.3)

PLATFORMS
java
ruby
universal-java-1.8
universal-java-11
aarch64-linux-gnu
aarch64-linux-musl
arm-linux-gnu
arm-linux-musl
arm64-darwin
x86_64-darwin
x86_64-linux-gnu
x86_64-linux-musl

DEPENDENCIES
activesupport (~> 6.1)
apparition!
aruba
base64
benchmark-ips
bigdecimal
capybara
cucumber
logger
matrix
minitest
mutex_m
ostruct
pry
rackup
rake
rspec
rubocop (~> 1.70.0)
simplecov!
simplecov-html!
test-unit
webrick

BUNDLED WITH
2.7.0.dev
2.7.2
2 changes: 1 addition & 1 deletion features/branch_coverage.feature
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Feature:
And I should see a line coverage summary of 56/61
And I should see a branch coverage summary of 2/4
And I should see the source files:
| name | coverage | branch coverage |
| name | coverage | branch coverage |
| lib/faked_project.rb | 100.00 % | 100.00 % |
| lib/faked_project/some_class.rb | 80.00 % | 50.00 % |
| lib/faked_project/framework_specific.rb | 75.00 % | 100.00 % |
Expand Down
1 change: 0 additions & 1 deletion features/maximum_coverage_drop.feature
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,6 @@ Feature:

When I run `bundle exec rake test`
Then the exit status should not be 0
And the output should not contain "Line coverage"
And the output should contain "Branch coverage has dropped by 50.00% since the last time (maximum allowed: 0.00%)."
And the output should contain "SimpleCov failed with exit 3"

Expand Down
40 changes: 40 additions & 0 deletions features/method_coverage.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
@rspec @method_coverage
Feature:

Simply executing method coverage gives ok results.

Background:
Given I'm working on the project "faked_project"

Scenario:
Given SimpleCov for RSpec is configured with:
"""
require 'simplecov'

SimpleCov.start do
enable_coverage :method
end
"""
When I open the coverage report generated with `bundle exec rspec spec`
Then I should see the groups:
| name | coverage | files |
| All Files | 91.8% | 7 |
And I should see a line coverage summary of 56/61
And I should see a method coverage summary of 10/13
And I should see the source files:
| name | coverage | method coverage |
| lib/faked_project.rb | 100.00 % | 100.00 % |
| lib/faked_project/some_class.rb | 80.00 % | 75.00 % |
| lib/faked_project/framework_specific.rb | 75.00 % | 33.33 % |
| lib/faked_project/meta_magic.rb | 100.00 % | 100.00 % |
| spec/forking_spec.rb | 100.00 % | 100.00 % |
| spec/meta_magic_spec.rb | 100.00 % | 100.00 % |
| spec/some_class_spec.rb | 100.00 % | 100.00 % |

When I open the detailed view for "lib/faked_project/framework_specific.rb"
Then I should see a line coverage summary of 6/8 for the file
And I should see a method coverage summary of 1/3 for the file
And I should see missed methods list:
| name |
| #<Class:FrameworkSpecific>#test_unit |
| #<Class:FrameworkSpecific>#cucumber |
1 change: 0 additions & 1 deletion features/minimum_coverage.feature
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,4 @@ Feature:
When I run `bundle exec rake test`
Then the exit status should not be 0
And the output should contain "Branch coverage (50.00%) is below the expected minimum coverage (80.00%)."
And the output should not contain "Line coverage"
And the output should contain "SimpleCov failed with exit 2"
1 change: 0 additions & 1 deletion features/minimum_coverage_by_file.feature
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,4 @@ Feature:
When I run `bundle exec rake test`
Then the exit status should not be 0
And the output should contain "Branch coverage by file (50.00%) is below the expected minimum coverage (70.00%)."
And the output should not contain "Line coverage"
And the output should contain "SimpleCov failed with exit 2"
Loading