- π¦πΊAustralia mstrelan
Had a look in to this and not sure it is entirely accurate anymore. I started by disabling wifi and running ScaffoldTest, yet it passed every time. Possibly there is a composer cache somewhere, but it passed even after clearing my local composer cache. Regardless, the test apparently creates an isolated cache for each test run.
Then I tried ScaffoldUpgradeTest, but it is currently skipped because 8.8.0 doesn't support Composer 2. If I unskip it and bump the requirement to 9.5.0 it then complains that the path repo with 11.x-dev has higher priority. I've managed to work around that and have opened π Unskip ScaffoldUpgradeTest Active to fix it. With wifi disabled I then get "Could not resolve host: repo.packagist.org", and once I enable wifi the test passes.
So we need to verify that ScaffoldTest is indeed accessing packagist (maybe the path repo is taking priority now) and we need a solution for ScaffoldUpgradeTest when repo.packagist.org is down. Maybe we can set up a mock mirror or we can prepopulate the cache from a fixture.
- π¦πΊAustralia mstrelan
I don't think
\Drupal\Tests\Composer\Plugin\Scaffold\Fixtures::createIsolatedComposerCacheDir
actually works. It creates the dir and sets the env var, but composer doesn't actually use it.I verified this by putting a breakpoint after the
composer require
command and inspecting the tmp dir and seeing it's empty. Then I added the following command beforecomposer require
and when I step through it the cache gets populated.$this->mustExec("composer config cache-dir " . getenv('COMPOSER_CACHE_DIR'), $sut);
.So if we want to pre-populate the cache then we need to ensure the cache dir actually works.