-
Notifications
You must be signed in to change notification settings - Fork 414
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
It should be possible to run tests from a specific module with runtest #870
Comments
Is there another way to do this? Aside from deleting all the other tests, there's a lot of iteration time wasted in having to run a whole directory of tests vs. just one file. |
@KevinHock that seems like a separate problem. I would expect the tests for a module to re-run only when its cmo/cmx changes. @diml would it be possible to make that work? Btw, another useful thing would be to run the tests in bytecode mode. I find that that for tests, the compilation vs. runtime is skewed heavily towards compilation for library tests. It would be nice to have this option. |
Oh 💡 💡 💡 that's why I always get |
You have to take into account not only the cmo/cmx of the module, but also the ones of the dependent modules recursively. Additionally, this won't work well when some modules are linked only for their side effects. However, we could run the tests for the various modules in parallel. ppx_inline_test supports running a subset of the tests, so we could just wire that in dune. Technically, it just means that we have to create intermediate aliases for each module. |
I'd like to have this — for now I have to resort to running tests via
when I need to "focus" tests to some module/test case inside the module. This, as I understand, uses knowledge about implementation details of inline tests. I don't think having aliases for running tests in specific modules is enough, I think inline tests allows also to select a specific test case by line number which is also very useful. |
No activity on this for months. We have closed it as unplanned. Feel free to reopen if you think this is important. |
No activity for years in fact. I do think this one is important though, judging by the number of user votes. |
I have some unfinished work on this. I haven't been able to polish it up yet due to other obligations. |
X-link #11109 |
I think it is useful to be able to run tests defined in a specific module with
jbuilder runtest
command, right now it seems the only invocation which is possible is to specify a directory:jbuilder runtest ./dir
.Also it would be useful to make
jbuilder runtest
to try its best efforts to run tests even if not all code from the specified package/dir can be compiled.From a discussion with @rgrinberg on OCaml Discord:
The text was updated successfully, but these errors were encountered: