- Issue created by @mondrake
- 🇬🇧United Kingdom longwave UK
Some thoughts from Slack summarised here:
We introduced this three years ago as a generic solution but in fact we only use it four times, each to check that Composer is available.
I suggest moving the check into ComposerBuildTestBase and making ComposerValidateTest extend that, or perhaps adding the check to ComposerIntegrationTrait.
The more generic solution that follows PHPUnit would be to introduce a
#[RequiresExternalCommand]
attribute similar to https://docs.phpunit.de/en/10.0/attributes.html#skipping-tests but given we haven't needed this for anything else I suspect this is overkill and ExternalCommandRequirementsTrait can be removed. - Assigned to mondrake
- 🇮🇹Italy mondrake 🇮🇹
Thanks! I'm working on a solution based on a simple requirements check method.
31:12 14:04 Running- @mondrake opened merge request.
- 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
To add to #3: it seems nothing in contrib uses this: http://grep.xnddx.ru/search?text=%40requires+externalCommand&filename=*T...
- last update
over 1 year ago Custom Commands Failed - Issue was unassigned.
- Status changed to Needs review
over 1 year ago 5:35pm 23 May 2023 - last update
over 1 year ago Custom Commands Failed - last update
over 1 year ago 29,390 pass - Status changed to Needs work
over 1 year ago 3:11pm 29 May 2023 - 🇮🇹Italy mondrake 🇮🇹
The ExternalCommandRequirementTest ones no, because they serve the purpose of checking the deprecation. But the ComponentsTaggedReleaseTest probably yes - although it looks like the check was never done for that test...
- last update
over 1 year ago 29,402 pass - Status changed to Needs review
over 1 year ago 8:17am 1 June 2023 - Status changed to RTBC
over 1 year ago 1:36pm 1 June 2023 - last update
over 1 year ago 29,411 pass - last update
over 1 year ago 29,416 pass - last update
over 1 year ago 29,420 pass - last update
over 1 year ago 29,436 pass - last update
over 1 year ago 29,437 pass 59:13 57:56 Running- last update
over 1 year ago 29,450 pass - last update
over 1 year ago 29,499 pass - Open on Drupal.org →Environment: PHP 8.2 & MySQL 8last update
over 1 year ago Waiting for branch to pass - last update
over 1 year ago 29,508 pass - last update
over 1 year ago 29,553 pass - last update
over 1 year ago 29,553 pass 59:13 54:58 Running- last update
over 1 year ago 29,567 pass - last update
over 1 year ago 29,571 pass - last update
over 1 year ago 29,801 pass - Status changed to Needs review
over 1 year ago 10:02pm 5 July 2023 - 🇬🇧United Kingdom longwave UK
As we only ever require Composer I think we can just make this even simpler?
trait RequiresComposerTrait { /** * @beforeClass */ public static function requiresComposer() { $finder = new ExecutableFinder(); if (!$finder->find('composer')) { static::markTestSkipped('This test requires Composer.'); } } }
You just add this trait to any class and it automatically skips if Composer is not available?
- Assigned to mondrake
- 🇮🇹Italy mondrake 🇮🇹
I have some doubts we can skip a test through a
@beforeClass
annotated method, but I got the gist of this. Need some trials. - 🇬🇧United Kingdom longwave UK
I did a very rough trial locally and it seemed to work, so I am hopeful.
- Status changed to Needs work
over 1 year ago 8:28am 6 July 2023 - last update
over 1 year ago 29,801 pass - last update
over 1 year ago 29,793 pass, 2 fail - last update
over 1 year ago 29,801 pass - Issue was unassigned.
- Status changed to Needs review
over 1 year ago 12:27pm 6 July 2023 - 🇮🇹Italy mondrake 🇮🇹
Can't add a deprecation trigger for
ExternalCommandRequirementsTrait
as it would fire during test discovery when the bridge is not yet capturing deprecations. So added a trigger to all the trait's methods instead. - Status changed to RTBC
over 1 year ago 2:41pm 6 July 2023 - last update
over 1 year ago 29,802 pass - last update
over 1 year ago 29,805 pass - Status changed to Fixed
over 1 year ago 4:35pm 10 July 2023 - 🇬🇧United Kingdom catch
Committed/pushed to 11.x, thanks! (ignore the 10.1 commits...)
Automatically closed - issue fixed for 2 weeks with no activity.
- Status changed to Fixed
over 1 year ago 5:09am 10 September 2023