Skip to content
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

Don't require test dependencies when building #13

Open
g2p opened this issue Jun 19, 2018 · 7 comments
Open

Don't require test dependencies when building #13

g2p opened this issue Jun 19, 2018 · 7 comments
Labels
forwarded-to-js-devs This report has been forwarded to Jane Street's internal review system.

Comments

@g2p
Copy link

g2p commented Jun 19, 2018

Right now it seems like if a PPX test mentions a module, the dependency providing that module must be installed when building the tested code.
This should be made unnecessary, so that only building with runtest requires extra dependencies.

@ghost
Copy link

ghost commented Jun 19, 2018

Currently the inline tests are always built and always end up in the final executable. Is that the issue here?

@g2p
Copy link
Author

g2p commented Jun 19, 2018

Pretty much. I have some tests that require some extra processing, and the extra dependencies are not acceptable for the library under test.
Since PPX rewriting is involved, could the tests be filtered out depending on build mode?

@ghost
Copy link

ghost commented Jun 19, 2018

ppx_inline_test does have an option to drop the tests: -inline-test-drop. You would still depend on ppx_inline_test but not on the things needed by the tests

@g2p
Copy link
Author

g2p commented Jun 19, 2018

And I suppose this can be made conditional? Sorry for my jbuilder noobness.

@ghost
Copy link

ghost commented Jun 19, 2018

Not currently. We added a notion of build profiles in the master of dune, so this could be use to do something different depending on which profile is selected. However there is still something missing in order to pass flag conditionally.

Since this is a common case, I'm wondering if we can't simply just drop tests when the profile is release, which is the case when compiling from opam.

@g2p
Copy link
Author

g2p commented Jun 19, 2018

I think disabling the tests in release mode would be great.

@ghost
Copy link

ghost commented Jun 19, 2018

Could you open a ticket on ocaml/dune?

@github-iron github-iron added the forwarded-to-js-devs This report has been forwarded to Jane Street's internal review system. label Sep 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
forwarded-to-js-devs This report has been forwarded to Jane Street's internal review system.
Projects
None yet
Development

No branches or pull requests

2 participants