Summary: | [Future EAPI] Add pkg_test() and a FEATURES=run-test | ||
---|---|---|---|
Product: | Gentoo Hosted Projects | Reporter: | Diego Elio Pettenò (RETIRED) <flameeyes> |
Component: | PMS/EAPI | Assignee: | Package Manager Specification <pms> |
Status: | CONFIRMED --- | ||
Severity: | normal | CC: | esigra, flow, kingjon3377, mgorny, sam |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
See Also: | https://bugs.gentoo.org/show_bug.cgi?id=938523 | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 174380 |
Description
Diego Elio Pettenò (RETIRED)
![]() I recently came across a similar feature in EasyBuild called sanity-check: https://docs.easybuild.io/en/latest/Writing_easyconfig_files.html#sanity-check It is especially convenient for packages which provide (unreliable) python extensions: sanity_check_commands = ["python -c 'import pythonextension'"] See also https://public-inbox.gentoo.org/gentoo-dev/87ttftr9ay.fsf@gentoo.org/ regarding installed tests. I wonder if we could trial this with an eclass that users would opt-in to testing for w/ pkg_postinst. preinst may be preferable. That would enable us to abort if tests fail, right? (In reply to Michał Górny from comment #4) > preinst may be preferable. That would enable us to abort if tests fail, > right? I was thinking postinst, in case software really requires to use the installed instance (think DESTDIR vs PREFIX). BUT the two examples I'm thinking of today (the kernel selftests, dtrace) don't have that requirement AFAIK as they support running in the source tree, just are too expensive / ... / to run in sandbox. So, it'd work for me to do the experiment with preinst, I think. (In reply to Michał Górny from comment #4) > preinst may be preferable. That would enable us to abort if tests fail, > right? I've just discovered a regression in our texlive packages where 'tlmgr' doesn't work any more. It would be great if we had a pkg_test() phase where we could rudimentary test for tlmgr's functionality (in this particular case, that the Perl INC paths are correct). However, 'tlmgr' requires the TexLive Package Database (tlpdb) to be initialized, which we dynamically create, for reasons, in pkg_postinst(). Therefore, to be useful for this use-case, pkg_test() should be run *after* pkg_postinst(). |