Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Problem/Motivation
https://www.drupal.org/pift-ci-job/2432195
Scaffold.Drupal\Tests\Composer\Plugin\Scaffold\Functional\ComposerHookTest
✗
Drupal\Tests\Composer\Plugin\Scaffold\Functional\ComposerHookTest
exception: [Other] Line 0 of sites/default/files/simpletest/phpunit-562.xml:
PHPUnit Test failed to complete; Error: PHPUnit 9.5.20 �[44m#StandWith�[0m�[43mUkraine�[0m
Testing Drupal\Tests\Composer\Plugin\Scaffold\Functional\ComposerHookTest
E. 2 / 2 (100%)
Time: 00:05.026, Memory: 4.00 MB
There was 1 error:
1) Drupal\Tests\Composer\Plugin\Scaffold\Functional\ComposerHookTest::testComposerHooks
RuntimeException: Exit code: 1
No composer.lock file present. Updating dependencies to latest instead of installing from lock file. See https://getcomposer.org/install for more information.
Loading composer repositories with package information
Updating dependencies
Lock file operations: 3 installs, 0 updates, 0 removals
- Locking drupal/core-composer-scaffold (10.0.x-dev)
- Locking fixtures/drupal-assets-fixture (dev-main)
- Locking fixtures/drupal-core-fixture (dev-main)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 3 installs, 0 updates, 0 removals
In PluginManager.php line 769:
drupal/core-composer-scaffold contains a Composer plugin which is blocked b
y your allow-plugins config. You may add it to the list if you consider it
safe.
You can run "composer config --no-plugins allow-plugins.drupal/core-compose
r-scaffold [true|false]" to enable it (true) or disable it explicitly and s
uppress this exception (false)
See https://getcomposer.org/allow-plugins
install [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--dry-run] [--dev] [--no-suggest] [--no-dev] [--no-autoloader] [--no-progress] [--no-install] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--] [...]
Steps to reproduce
Update to the latest composer 2 stable release 2.3.10 for example. Run ./vendor/bin/phpunit -v core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Functional/ComposerHookTest.php --filter testComposerHooks
Proposed resolution
Fix test and the corresponding fixture. Latest composer versions do not support requiring plugins without allowing or dis-allowing them.
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Comment | File | Size | Author |
---|---|---|---|
#11 | 3298821-7.patch | 4.11 KB | alexpott |
#9 | 3298821-10.patch | 1.57 KB | alexpott |
| |||
#9 | 8-10-interdiff.txt | 4.12 KB | alexpott |
#3 | 3298821-9-5.patch | 422 bytes | catch |
#7 | 3298821-7.patch | 4.11 KB | alexpott |
Comments
Comment #2
catchComment #3
catchComment #4
SpokjeAs it turns out, the PHP 8.1/8.2 containers were updated by the DA.
Which means currently the local composer version is
Composer version 2.3.10 2022-07-13 15:48:23
.Looks like this test now fails on the new behaviour introduced in 2.3.9:
https://github.com/composer/composer/releases/tag/2.3.9
Or most probably this one: https://github.com/composer/composer/pull/10920#issuecomment-1175147334
Comment #5
SpokjeComment #6
alexpottYep I think correct thing to do here is to remove the test. It just doesn't work the way we are testing it now. Patch incoming.
Comment #7
alexpottWe can't and shouldn't really test something that has been deliberately broken by composer.
Comment #8
alexpottFWIW the test fails locally once you are on the latest Composer 2 as well.
Comment #9
alexpottActually I think we can do a better test - at least more in the spirit of the way composer works now... although you could argue that we're testing composer here...
Comment #10
longwaveAgree that we are testing composer itself here - as far as I see none of our code even runs in the system under test, given that we disallow the plugin, so there is no benefit to us of having this test.
Comment #11
alexpottRe-upping #7 as that's the patch that @longwave is suggesting we use. I'm not sure it matters.
Comment #12
SpokjeHappy to RTBC if TestBot is also happy after a full run.
Comment #13
dwwIf bot is happy, I am, too. 😉
Comment #14
andypost+1 to commit it fixes PHP 8.2 too
Comment #16
larowlanCommitted to 10.1.x and all the way back to 9.4.x
Will ask if we need this in 9.3.x too
Comment #18
larowlanDiscussed with @alexpott and he agreed re backport to 9.3.x, so did that too