Open artagnon opened 3 years ago
I'm also experiencing the same issue.
Any updates? I met the same problem :(
I ran into the same issue. The heart of my issue was the Dir.chdir
, simplecov generates the coverage report within that directory so it's never merged into the full coverage report.
The fix was using #root
and #coverage_dir
to point simplecov to back the right spot:
# Within my tests
pwd = Dir.pwd
Dir.chdir "somedir" do
Open3.capture3({ "SIMPLECOV_ROOT" => pwd }, "bin/my-command")
end
# .simplecov
SimpleCov.start do
root ENV["SIMPLECOV_ROOT"] || Dir.pwd
coverage_dir File.join(root, "coverage")
end
I'm using simplecov with minitest to generate coverage reports. I have the following code I want subprocess coverage for:
Unfortunately, even with
enable_for_subprocess
andat_fork
configured as follows in my.simplecov
:I don't get subprocess coverage. Is this because I'm killing the subprocess instead of waiting for it to finish (it never finishes)? Is there a way around this?
EDIT: It's not because of Process.kill. It doesn't seem to work for a fork-wait either: