Handle PHPStan baseline additions about vfs

Created on 21 September 2024, 7 months ago

Problem/Motivation

In 📌 Bump phpstan/phpstan to latest to make daily "updated deps" QA run pass again RTBC we added 2 errors to the baseline of PHPStan to ensure our daily "Updated deps" GitLab run would not fail at the PHPStan-fase and thus never show any other possible issues with dependency updates in the actual tests.

This issue exists to decide on/fix/leave these errors in the baseline.

$ignoreErrors[] = [
	// identifier: includeOnce.fileNotFound
	'message' => '#^Path in include_once\\(\\) "vfs\\://drupal/sites/default/modules/module_a/module_a\\.post_update\\.php" is not a file or it does not exist\\.$#',
	'count' => 1,
	'path' => __DIR__ . '/tests/Drupal/Tests/Core/Update/UpdateRegistryTest.php',
];
$ignoreErrors[] = [
	// identifier: includeOnce.fileNotFound
	'message' => '#^Path in include_once\\(\\) "vfs\\://drupal/sites/default/modules/module_b/module_b\\.post_update\\.php" is not a file or it does not exist\\.$#',
	'count' => 1,
	'path' => __DIR__ . '/tests/Drupal/Tests/Core/Update/UpdateRegistryTest.php',
];

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

📌 Task
Status

Active

Version

11.0 🔥

Component
PHPUnit 

Last updated about 7 hours ago

Created by

🇳🇱Netherlands spokje

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

Merge Requests

Comments & Activities

  • Issue created by @spokje
  • Merge request !10097First stab → (Open) created by spokje
  • Pipeline finished with Failed
    5 months ago
    Total: 97s
    #332373
  • Pipeline finished with Failed
    5 months ago
    Total: 132s
    #332372
  • Pipeline finished with Success
    5 months ago
    Total: 840s
    #332384
  • Pipeline finished with Success
    5 months ago
    Total: 1299s
    #332376
  • 🇳🇱Netherlands spokje

    Whilst I fully agree with @mondrake in #3, I think we can dance around the problem with MR !10097.

    However, whilst checking if that MR is hitting \Drupal\Core\Update\UpdateRegistry::getAvailableUpdateFunctions with the same input as before (which it did), I found the test \Drupal\Tests\Core\Update\UpdateRegistryTest::testGetPendingUpdateFunctionsWithLoadedModulesButNotEnabled also passes without these lines:

        // Preload modules to ensure that ::getAvailableUpdateFunctions filters out
        // not enabled modules.
        include_once 'vfs://drupal/sites/default/modules/module_a/module_a.post_update.php';
        include_once 'vfs://drupal/sites/default/modules/module_b/module_b.post_update.php';
    

    So the preloading doesn't seem to make any difference. (See )

    Unsure what would be the next step here, but let's put this up for a review and take it from there.

  • Status changed to Needs work 5 months ago
  • 🇮🇹Italy mondrake 🇮🇹

    Actually: testGetPendingUpdateFunctionsWithLoadedModulesButNotEnabled()

    this is dating back to 2013 - but is "loaded modules but not enabled" still a thing today?

Production build 0.71.5 2024