Skip to content

add_group() sees files in 0.17.0 but does not in 0.18.1 #860

Open
@JonJagger

Description

@JonJagger

I'm running some Ruby tests inside a docker container (Alpine 3.11)
The version of ruby inside the container is 2.6.5p114
My code is in a dir called /app (inside the image).
My tests are in a dir called /test (volume-mounted).
Note: the tests are not underneath the /app dir (and that is how I prefer it).

I get coverage of both the code (in /app) and the tests (in /test).
My coverage is setup like this..

require 'simplecov'

SimpleCov.start do
  filters.clear
  #add_group('debug') {|src| puts src.filename; false; }
  add_group('app') { |src| src.filename =~ %r"^/app/" }
  add_group('test') { |src| src.filename =~ %r"^/test/.*_test\.rb$" }
end
SimpleCov.root('/app')
SimpleCov.coverage_dir(ENV['COVERAGE_ROOT'])

My Gemfile.lock shows

simplecov (0.17.0)

All works fine.
I get coverage of the code.
I also get coverage of the tests (easy to keep this at 100%!)
:-)

When I move to simplecov 0.18.1 and leave everything else the same I am no longer getting any coverage of my tests (in /test). Uncommenting the line

  #add_group('debug') {|src| puts src.filename; false; }

shows that no /test/files are being seen at all.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions