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

Installable tests #664

Open
Ovid opened this issue Aug 19, 2023 · 2 comments
Open

Installable tests #664

Ovid opened this issue Aug 19, 2023 · 2 comments

Comments

@Ovid
Copy link

Ovid commented Aug 19, 2023

This is very speculative, but it would be nice to have an "opt-in" feature to allow tests to be installed. For a module like Foo::Bar::Baz, we could install tests under foo-bar-baz (lc and then s/::/-/g), though it's less clear what path they would be installed under.

With that, when I install a new version of a module, having a feature that would allow me to run installed tests for regressions would be lovely.

Of course, that means cpanminus would have to track what it installed (maybe it does and I don't know about that?) and which modules have "installable" tests. In the meta spec, having an extra key like x-install-tests would trigger the behavior (it would need to be "opt-in" instead of "opt-out" because not all tests can be easily installed and run).

However, while installing tests seems desirable, running installed tests seems outside the scope of cpanminus.

@miyagawa
Copy link
Owner

miyagawa commented Aug 19, 2023

My first instinct is that this doesn't belong to cpanminus, or any other installer. Installer software only sets some environment variables and command line options and runs perl Makefile.PL; make; make install or perl Build.PL; perl ./Build; perl ./Build install. It has no knowledge about which subdirectories to copy files to, and which files actually need to be installed. It's all controlled by ExtUtils::Install and other build tools.

I suggest you to take a look at Module::Build::Tiny if you want to implement the behavior using the Build spec.

cpanminus would have to track what it installed (maybe it does and I don't know about that?)

perllocal.pod has the list of installed modules (not just cpanminus), and for each install, there's install.json under arch specific subdirectories.

@Ovid
Copy link
Author

Ovid commented Aug 21, 2023

Thank you for that very helpful reply, @miyagawa !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants