[random test failure] ScaffoldUpgradeTest and ScaffoldTest rely on packagist.org

Created on 8 June 2020, almost 5 years ago
Updated 22 October 2024, 6 months ago

Problem/Motivation

\Drupal\Tests\Composer\Plugin\Scaffold\Functional\ScaffoldUpgradeTest and \Drupal\Tests\Composer\Plugin\Scaffold\Functional\ScaffoldTest failed today:

I've attached the phpunit xml output from the tests. It looks like this tests need the internet.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

πŸ› Bug report
Status

Active

Version

11.0 πŸ”₯

Component

base system

Created by

πŸ‡¬πŸ‡§United Kingdom alexpott πŸ‡ͺπŸ‡ΊπŸŒ

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡³πŸ‡ΏNew Zealand quietone
  • πŸ‡¦πŸ‡Ί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 before composer 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.

Production build 0.71.5 2024