Skip to content

Simplecov does not cover sub-process entry point #598

Open
@shakedlokits

Description

@shakedlokits

I'm attempting to perform integration coverage for Ruby services on a multi-layer product, for this mean I've initialized coverage at the bottom of /usr/share/rubygems/rubygems.rb using:

require 'simplecov'
SimpleCov.start do
  filters.clear
  root Dir.pwd
  command_name 'subprocess coverage'
  coverage_dir '/coverage'
end

Then I've create 2 files:

  • /application/a.rb
puts "at #{__FILE__}"
require_relative 'b.rb'
  • /application/b.rb
puts "at #{__FILE__}"

Now when I run ruby /application/a.rb, the generated /coverage/.resultset.json file is:

{
  "subprocess coverage": {
    "coverage": {
      "/application/a.rb": [
        null,
        null
      ],
      "/application/b.rb": [
        1
      ]
    },
    "timestamp": 1500283332
  }
}

As you can see, the entry point file is not being covered(Verified with a larger requirement chain).

System Info

# uname -a
Linux 786eab7389d4 4.6.7-200.fc23.x86_64  SMP Wed Aug 17 14:24:53 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
# gem which simplecov
/usr/local/share/gems/gems/simplecov-0.14.1/lib/simplecov.rb
# ruby -e "puts RUBY_DESCRIPTION"
ruby 2.2.5p319 (2016-04-26 revision 54774) [x86_64-linux]

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions