[Proposal] Add a new opam test
subcommand and change the behaviour of the run-test
field
#4594
Labels
KIND: FEATURE WISH
KIND: PLUGIN CANDIDATE
Feature requests that might best be implemented as plugins to opam
The issues with the current design
Testing packages in opam isn't really a separate step of action and this can cause issues for some packages.
For instance, for some packages (key packages mainly), their tests do not get defined in opam-repository because they require packages that require the package being tested (cyclic dependency). e.g.
base
,odoc
, …Some packages also do not define their tests for other reasons but opam cannot distinguish between "has test" and "does not have test" and thus users using
opam install --with-test <pkg>
won't know if<pkg>
has really been tested.The proposal
To help with those issues my proposal would be to add a new
test
subcommand such asopam test <pkg>
would:<pkg>
is already installed and{with-test}
is used inside thebuild
step:<pkg>
without reinstalling it<pkg>
is not installed, install it withwith-test = true
post
dependencies)run-test
phase (wasn't used in any previous step)The new
run-test
step is a change of behaviour from previous versions of opam where therun-test
phase was ran after thebuild
phase and before theinstall
phase. Now with this proposal, this phase is never ran throughopam install
but only through the newopam test
command.The text was updated successfully, but these errors were encountered: