Closed dkudlek closed 1 year ago
This may be fixed in the develop branch if you don't mind giving it a test (hopefully by fixing your other issue earlier in the week)
I checked out develop (16bbf71ac1a2ba57b010045eaea3330f6bef4bd5), but this issue still persists. I ran the the same actions as in the opening post and got the same results. But thanks already for the hard work on the UNC issue!
I am having the same issue.
The dev branch is indeed not working for me either, @dkudlek's workaround perhaps works for his use case but the issue is not lcov
specific.
What I did instead is set output_dir
to the root by default. I have no idea if this breaks something else that I did not consider but the output is correct for me now.
Edit: Ok 2 things;
output_dir
logs are wrong as they seem to be relative to the directory that would've been chosen prior to this "fix"Second edit: It seems that many tests are actually failing even on the last dev commit so definitely not all of them are caused by my change, that said you probably will have an easier time figuring out what's happening đ
Hopefully this helps in some way
So this branch may fix it fix/report-dirs-windows
(PR: https://github.com/xd009642/tarpaulin/pull/1190). I'll need to boot my windows laptop up some point today to find out but if you test it first that also works :ok_hand:
This is the same as what I did in the referenced commit above so yes it should work. The only "catch" was some prints that seemed to still be using current dir although I'm not sure if that got fixed elsewhere.
I'll be home in a few minutes and I can try it then
Oh doh I missed that commit! I'll probably check it in an hour or 2
Yes so it is essentially the same as with my commit, the output directory is correct but the info log is wrong.
Running in this project outputs the following:
Jan 21 15:40:23.919 INFO cargo_tarpaulin::report: Coverage Results:
|| Tested/Total Lines:
|| ..\cli\src\error.rs: 0/8 +0.00%
|| ..\cli\src\main.rs: 0/25 +0.00%
|| ..\common\src\lib.rs: 7/7 +0.00%
|| ..\common\src\logos.rs: 9/13 -30.77%
|| ..\lib\src\error.rs: 3/11 +0.00%
|| ..\lib\src\lib.rs: 87/87 +0.00%
|| src\endpoints.rs: 21/21 +0.00%
|| src\error.rs: 11/11 +0.00%
|| src\main.rs: 0/2 +0.00%
||
74.59% coverage, 138/185 lines covered, -8.84% change in coverage
Notice how the prints seem to be made inside of one of the project's crates (the server
in my case which is likely the last one to run seeing as how that's where the report would be dropped prior to this fix).
The prints seem to happen in this function but the issue is likely with how some iteration happens.
I've realised what the printing is, it's related to me getting the paths from the llvm coverage files, hopefully a quick fix now I know where it's coming from. Then I'll aim to add this in, then fix globs for windows and cut a new release
And I've found it, once CI passes I'll merge meanwhile onward to globs!
And it's merged, just gonna close this now - and there should be a new tarpaulin version before weekend is over :smile:
I checked out 959c8bea76c5752b5a7aa4ebde28d974cc230190 and 1f40d9a84b7626f6205e63da61be2f7022738d03 on develop
. My first two test cases work. This would work for me. âď¸
Action: Run cargo tarpaulin --ignore-tests --out Lcov --all
root/lcov.info
root/lcov.info
:heavy_check_mark:Action: Run cargo tarpaulin --ignore-tests --out Lcov --all --root .
root/lcov.info
root/lcov.info
:heavy_check_mark:For the sake of completeness, the last use case still fails. Trying to change the output directory.
Action: Run cargo tarpaulin --ignore-tests --out Lcov --all --output-dir target\tarpaulin
root/target/tarpaulin/lcov.info
root/find_unique_interval/target/tarpaulin/lcov.info
âď¸Action: Run cargo tarpaulin --ignore-tests --out Lcov --all --root . --output-dir target\tarpaulin
root/target/tarpaulin/lcov.info
root/find_unique_interval/target/tarpaulin/lcov.info
âď¸ I think I see it - this should fix it https://github.com/xd009642/tarpaulin/pull/1193 @dkudlek
I can try tomorrow on my windows machine it's just getting late here so I won't test it out tonight
Looks good to me!
cargo tarpaulin --ignore-tests --out Lcov --all
root/lcov.info
root/lcov.info
âď¸ cargo tarpaulin --ignore-tests --out Lcov --all --root .
expect: root/lcov.info
get: root/lcov.info
âď¸
cargo tarpaulin --ignore-tests --out Lcov --all --output-dir target\tarpaulin
root/target/tarpaulin/lcov.info
root/target/tarpaulin/lcov.info
âď¸ cargo tarpaulin --ignore-tests --out Lcov --all --root . --output-dir target\tarpaulin
root/target/tarpaulin/lcov.info
root/target/tarpaulin/lcov.info
âď¸
Describe the bug
When tarpaulin writes lcov.info it gets the wrong current directory. It writes the file into an subfolder instead of the root folder. Specifying
--root
or--output-dir
did not help.To Reproduce
Project structure: challenge-rust
Action: Run
cargo tarpaulin --ignore-tests --out Lcov --all
root/lcov.info
root/find_unique_interval/lcov.info
Action: Run
cargo tarpaulin --ignore-tests --out Lcov --all --root .
root/lcov.info
root/find_unique_interval/lcov.info
Action: Run
cargo tarpaulin --ignore-tests --out Lcov --all --output-dir target\tarpaulin
root/target/tarpaulin/lcov.info
root/find_unique_interval/target/tarpaulin/lcov.info
Workaround :link:
lcov.rs
for a relative pathoutput_dir
--output-dir target\tarpaulin
to aovid an empty out_dir because it will try to get the current directory if emptycargo tarpaulin --ignore-tests --out Lcov --all --output-dir target\tarpaulin
cargo tarpaulin --ignore-tests --out Lcov --all
root/lcov.info
root/find_unique_interval//lcov.info
Software versions