-
Notifications
You must be signed in to change notification settings - Fork 371
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
Post-install integration tests [with default install] #4099
Comments
it is already possible to express it. You can add in the |
I see, thank you. This didn't work for me in earlier builds, but perhaps for unrelated reasons. My current install script in OPAM now looks like:
Is there a better option for that first line? NB that |
It must not be the preferred way---I'm getting a failure in my tests. Any advice? |
I've also tried installing using ocamlfind, which also failed (it didn't install symlinks, which are necessary for the shared libraries). I've tried having my library depend on I'd really appreciate some guidance here. Is there some utterance I can give in the |
No, its the default in case there is no instructions in the For your package, to have something working for the moment, you can add [moved in the accurate issue opam-format comment] |
I see. I haven't had success with using In any case, I'm more or less content with the current setup and need to pay attention to other things. I'd of course prefer to run integration tests after the install, so I'll update things when I can. My current setup is to do that in the same Docker container that tests the package itself. Longer term, I think it'd be great to (a) add an action in the |
You can use For tracking, it is not the sandbox that does this work, but ad directory tracking is done before and after install. The install file is also kept, so removal operations are taken from the install file if present, and also from directory tracking result. If you have the script on |
I'm confident that I can generate a correct I'm not sure I follow you in the beginning. Is there any documentation for the Finally, I just noticed post-install-commands, which almost works for me (except I wouldn't want to run those commands when installation had failed). One possibility might be:
If that seems reasonable, I'll try it. |
Yes, changes occurring at install action are all tracked, to be sure to clean everything (in the limit that the install is in the opam switch directory, sandbox ensures that. On the The |
Oh: that Would it be helpful if I proposed extensions to handle the "default actions + extra" case? |
It would help for sure, all contributions are welcome :) First we need to discuss about it, because it have several implications. We can't always install the install file even if there is install instructions. I see two ways to do it:
|
I quite like the latter approach, since it's far more flexible. The only downside I can see to the syntax you proposed is that it's confusingly similar to scripts that might use the BSD install tool, i.e.,
Maybe change it to |
yes, it can be |
I've recently run into two separate issues with OPAM packages (my own libdash as well as the ever-popular z3) which would have been avoided if OPAM supported integration tests.
The issue is that OPAM's test targets seem to be run before installation happens. Not only does this present a challenging linking problem for libraries that make use of C code (since now you must accommodate two different linking scenarios---in
.opam
and also in the build directory), it also means that it's hard to verify that the installed library will link correctly with clients.The feature could be quite simple: add a
post-install-test
(or some similar name) top-level build field that contains scripts in the same style asbuild
,install
,run-test
. These scripts would only be run when--with-test
was used a flag; they would be run only after a successful install. If the tests failed, I can imagine either (a) simply reporting the failure to the user, or (b) uninstalling the software.The text was updated successfully, but these errors were encountered: