-
-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
coverage is only being applied by running specific .exe test files #432
Comments
Thank you! I haven't tried Bisect_ppx with ppx_inline_test. Will probably have to take a look at the details of how it works. |
I was also struggling to get coverage files to be generated for ppx_inline_test, I found if I rolled back my version of dune to between 2.7 and 3.4 it worked perfectly. |
@midorishibukawa I may have a related issue. Would you mind having a look at #411 and let me know if |
tl; dr: the setup in the fork works pretty much as expected with dune 3.12.1 and bisect_ppx 2.8.3. I downloaded the fork linked by the OP (here), but I could not reproduce the issues with using dune 3.12.1 and bisect_ppx 2.8.3. (Could be that newer versions fixed the issues.) Here are commands I ran to check it.
^ I would expect this to generate coverage files in the main directory, which it does.
^ I would expect this to generate no coverage report, since it is not run with instrumentation, and that is what happens.
^ This generates no coverage, which is correct as it is not being run with instrumentation.
^ generates coverage in the
Now, it also also generates coverage for the
^ This generates coverage report correctly regardless of where the coverage files are. One final note is that I would generally add the instrumentation to the executable file as well, and that way any cram tests or whatever will be picked up and you will get coverage of the executable if you run under instrumentation. (cc @mbarbin) |
Oh and it looks like another reason why this works okay is that it has aliased the runtest to be:
So it appears to not be running in the sandbox. |
See this issue comment for more info. |
Thank you so much, @mooreryan and @mbarbin! After reading @mooreryan's thorough explanation (both here and on the mentioned issue, I was able to verify that my problem was in fact caused by the lack of a Reading everything was very enlightening, and also made me realise that I had misunterstood the usage of the I agree with @mbarbin's suggestion of adding that information to I'll be closing this issue, as the problem has been solved. |
Thank you @midorishibukawa, @mooreryan, @mbarbin, @Blue-Berry! I used ppx_expect with Bisect in Dream without having to use |
hello!
I'm trying to get test coverage for a project of mine using bisect_ppx, but unfortunately I haven't been successful yet.
in order to figure out whether it's a problem with my project/system or with bisect_ppx itself, I followed the dune starter instructions, and managed to make it work by explicitly running the
tester
executable with the following command:however, when I try to run tests by using dune's
runtest
command as provided by the readme, no coverage file is generated. for the sake of completeness, the command I'm trying to run is as follows:on my actual project, I'm using ppx_inline_test, so I tried adding a simple inline test to the starter project to see if that would work, but to no avail. I forked the starter project and added my changes to it in case anyone wants to try to reproduce the problem.
the inline test file is composed of a single line:
and the following lines were added to the dune file:
I wasn't quite sure of whether I should add the
instrumentation
stanza to the testing library or not, but I tried both ways with no apparent changes in behavior.I'm running nixos, and all dependencies are provided by opam-nix, as the nix package manager doesn't really play well with opam, so I suspect that might have something to do with it.
any help would be greatly appreciated!
The text was updated successfully, but these errors were encountered: