Problem/Motivation
If a test class specifies a requirement that is not fulfilled, PHPUnit just returns with success and 'No tests executed!'.
For example, core/tests/Drupal/KernelTests/Core/Cache/ApcuBackendTest.php specifies #[RequiresPhpExtension('apcu')] which is not installed on my locale.
Steps to reproduce
Run
php -d memory_limit=1G core/scripts/run-tests.sh --verbose --sqlite :memory: --color --types PHPUnit-Kernel Cache
on a machine that has no apcu extension installed.
Proposed resolution
For the purpose of run-tests.sh, this is something that need attention, so fail the test as we do for example for deprecations or warnings.
Remaining tasks
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
Comments
Comment #4
mondrakeComment #5
mondrakeComment #6
jonathan1055 commentedAdding to meta parent issue #2626986: [meta] Improvements to run-tests.sh
I've not looked at the MR changes, but is there going to be any conflict with #3536964: run-tests.sh - segregate command line parsing and use Symfony Console classes ? and if so, are we still working primarily on that one? I can try to test here, but won't do that just yet if this is going to be postponed.
Comment #7
mondrakeUnfortunately run-tests.sh related patches drag on for months, so individually sometimes they tend to overlap one on another.
I have not checked on this one specifically - what I can say is that this one is a bug, whereas the command line refactoring is a feature request.
Comment #8
mondrakerebased
Comment #9
smustgrave commentedDumb question what's a good way to test?
php -d memory_limit=1G core/scripts/run-tests.sh --verbose --sqlite :memory: --color --types PHPUnit-Kernel Cache
I get ERROR: Test group not found: Cache with and without the MR.
Comment #10
mondrakeProbably now it should be
The important part is a machine that has no apcu extension installed: that's the situation that happened to me.
Comment #11
smustgrave commentedokay did some googling and believe I correctly got apcu out using
apc.enabled=0and see the issue you reported.I believe this does address it. Going to go on a limb at least.
Comment #12
alexpottCommitted f9b616d and pushed to main and 11.x. Thanks!
I resolved the conflicts on 11.x to backport and ran the test locally.