- Issue created by @ergonlogic
-
ergonlogic →
committed ff50d6cd on main
Relates to #3424737: Add selenium-chrome service for Javascript testing.
-
ergonlogic →
committed ff50d6cd on main
-
ergonlogic →
committed c6ff20da on main
Relates to #3424737: Add 'ddev behat' command.
-
ergonlogic →
committed c6ff20da on main
-
ergonlogic →
committed 0ca544de on main
#3424737: Move dev tooling into .local-dev directory, to get JS tests to...
-
ergonlogic →
committed 0ca544de on main
- Status changed to Fixed
9 months ago 4:51pm 1 March 2024 - 🇨🇦Canada ergonlogic Montréal, Québec 🇨🇦
We were running into issues w/ Behat not being able to find Drupal. This appears to be due to the patterns that
DrupalFinder
is looking for (combinations of paths forcomposer.json
and Drupal core). The underlying issue seems to be that `ddev poser` doesn't create a persistent Composer file thatDrupalFinder
needs.To work around this, I resuscitated an idea that's been kicking around in my head for a while now. I moved all the tooling (config for Composer, DDEV, Behat, Drumkit, etc.) into a
.local-dev
directory.We can then include a
composer.json
using the "project" type. This works the way that DrupalFinder expects. We then symlink in our project thusly:{ "name": "workflow_required_by_state/local-dev", "description": "Local development site for developing Workflow Required by State.", "type": "project", "repositories": [ { "type": "path", "url": "/opt/project" }, { "type": "composer", "url": "https://packages.drupal.org/8" } ], "require": { "drupal/workflow_required_by_state": "@dev", [...]
The path repository points to
/opt/project
, which is configured as a mount in.local-dev/.ddev/docker-compose.mounts.yaml
:services: web: volumes: - "../..:/opt/project"
Then we can point Behat (which runs inside the DDEV "web" container) like so:
default: autoload: - "/opt/project/features/bootstrap" suites: default: &default paths: - "/opt/project/features" contexts: - FeatureContext [...]
This works quite nicely to avoid polluting the contrib project root with a lot of dev/test tooling. It also removes any project-specific config from this tooling, which should make it much easier to template into new projects.
Automatically closed - issue fixed for 2 weeks with no activity.