Open joachim-n opened 3 weeks ago
@rfay are SIMPLETEST_DB_VALUE and DRUPAL_TEST_DB_URL_VALUE and DRUPAL_CORE_DDEV_URL not known at add-on install time, only when ddev is being started?
DDEV doesn't know anything about "install time". It only knows about whether it's started. The way to sort things like this out is to use simple statements like
hooks:
post-start:
- exec: "echo $SOMEVAR"
Sorry, I should have been more specific -- I mean when the addon is being installed, when post_install_actions
are run (and not when Drupal is being installed)
Lot of times during add-on installation, DDEV isn't even started, so you won't get those unless you get them from somewhere.
That said, none of those vars are set by DDEV itself. You must be thinking they'll get set somewhere, you'll have to figure out where. But add-on installation does not require that a project be started already. In fact, since a restart is almost always required, it's better to think about them as being done on stopped project.
Lot of times during add-on installation, DDEV isn't even started, so you won't get those unless you get them from somewhere.
I just tried doing ddev addon get
on an unstarted project, and it started ddev. Is that normal, or is there something in this particular addon's code which caused a startup?
Your add-on may be starting it, or you may be running a custom command that starts it.
If you try ddev add-on get ddev/ddev-redis
for example, it won't start the project.
I'm not sure what's going on with the phpunit.xml file.
I thought that it was getting copied when the addon gets installed, with some token replacements, in install.yaml:
but in config.core-dev.yaml, this also happens whenever ddev is started:
I don't understand this. We're redoing the setting of DRUPAL_CORE_DDEV_URL. Then there's SIMPLETEST_DB_VALUE that we set now, but didn't on install -- is that because we only know the database once DDEV is running, rather than when the addon is installed?
Then there's the
core-dev/src/Command/TestBrowserCommand.php
command which copies the file again, but this time to allow you switch between thephpunit-chrome.xml
andphpunit-firefox.xml
flavours that come with this addon.See also: https://github.com/rfay/ddev-drupal-core-dev/commit/90eeb91e7bc4b31096fca8bac4fb46cafad9ed02#r148645439