PostgreSQL tests fail because Drupal core patch is trying to install pg_trgm
extension in parallel multiple times.
Failed to run installer database tasks: Drupal could not check for the pg_trgm extension: SQLSTATE[23505]: Unique violation: 7 ERROR: duplicate key value violates unique constraint "pg_extension_name_index"
DETAIL: Key (extname)=(pg_trgm) already exists.: CREATE EXTENSION IF NOT EXISTS pg_trgm;
The drupal/core-dev package is simply a shortcut for including
dependencies necessary for running automated tests.
See https://github.com/drupal/core-dev/blob/9.4.x/composer.json
It is designed specifically for running Drupal core automated
tests. We used it as a simple way to get our automated tests
running initially, but it includes some dependencies that we do
not need.
It also pins some package versions, including symfony/finder and
symfony/filesystem. This caused an issue for us when we refactored
our composer.json files to use composer-merge-plugin. We got
around this issue by pinning symfony/finder to ^4.
See https://www.drupal.org/project/farm/issues/3239420
See bd33d0f139
Furthermore, in testing Drush 11, I discovered that a similar
conflict started occurring with symfony/filesystem (presumably
because Drush depends on that as well now). I eventually managed
to get it to work by pinning symfony/filesystem as well, but only
if I moved both pins to the root farmOS composer.json (it didn't
fix it if they were in composer.project.json). That is what
ultimately drove me to dig into this and decide to split up our
dependency on drupal/core-dev.
By removing the dependency on drupal/core-dev, we no longer have
the issue with symfony/finder, so that pinned dependency can
be removed.
I repeatedly ran tests with as few of the drupal/core-dev
dependencies as possible until tests started passing again. So
this final list represents the minimum requirements for our
tests.
Resolves:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- drupal/core-dev[9.2.0-alpha1, ..., 9.2.x-dev] require symfony/finder ^4.4 -> found symfony/finder[v4.4.0-BETA1, ..., 4.4.x-dev] but the package is fixed to v5.3.7 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
- Root composer.json requires drupal/core-dev ~9.2.0 -> satisfiable by drupal/core-dev[9.2.0-alpha1, ..., 9.2.x-dev].
This enables more of the dependencies and configuration that need to be
present in the root project composer.json to be managed in the farmOS
repository itself, including drupal/core-composer-scaffold and
drupal/core-dev, which should match the drupal/core version defined in
the farmOS composer.json.
Previously these were declared in the project composer.json template
in https://github.com/farmOS/composer-project. This configuraton is
used as a template when a new farmOS project is created via
`composer create-project farmos/project`, but after initial setup it
is maintained by the end user. This means that updates to the project
composer.json generally requires the end-user to make changes
manually. This would be required every time farmOS requires a minor
version update of Drupal core.
So instead, we can manage those update in this new composer.project.json,
and use wikimedia/composer-merge-plugin to merge that into the project
composer.json. This allows the project composer.json to be much simpler,
and therefore will require less frequent manual updates.