Open kewudu opened 3 years ago
Make sure the code is available in the same location as when the individual coverage reports were generated.
It would be nice if simplecov warned you about this.
I encounter this problem too. The path you run SimpleCov.collate
must equal to paths in .result.json
of other coverages.
Make sure the code is available in the same location as when the individual coverage reports were generated.
@jviney Is this really the only solution? Isn't there a way to just merge the .resultset.json
files without having to have the entire codebase available?
@ddieulivol did you eventually find a workaround for having the code in the same location?
@ddieulivol did you eventually find a workaround for having the code in the same location?
Sadly no 😢
:wave:
It's likely to be the only solution, yes.
The reasoning is that collate
- if I recall correctly - does also do out of the post processing. The individual files are missing things like ignores and the simplecov configuration - and so it needs access to them for this.
A warning about this may be nice, I agree.
I have my own test framework in my project, when I use simplecov to get coverage in the same machine, I can not merge the coverage result, the merged result is empty!
Operation step: (1) run test1 with simplecov, get the following .resultset.json
(2) run test2 with simplecov, get the following .resultset.json
(3) then I put the these two result in two directory: --coverage1 |-- asserts |-- .last_run.json |-- .resultset.json |-- .resultset.json.locl |-- index.html --coverage2 |-- asserts |--.last_run.json |-- .resultset.json |-- .resultset.json.locl |-- index.html
(4) in ruby run SimpleCov.collate Dir["coverage*/.resultset.json"], it print:
Coverage report generated for pid_34884, pid_35136 to D:/merge/coverage. 0 / 0 LOC (100.0%) covered.
a new coverage directoy created, but the .resultset.json is empty like below:
ruby version: ruby 2.6.3p62 (2019-04-16 revision 67580) [x64-mingw32] simplecov: simplecov (0.21.2) simplecov-html (0.12.3, 0.10.2) simplecov_json_formatter (0.1.2)
So, is anything wrong in my operation? or I am misunderstand the SimpleCov.collate usage?