Hey folks,
maybe you can help me with following conspicuousness:

Problem/Motivation

Running drupal/upgrade_status drush command: "upgrade_status:analyze" leads to warnings in numerous modules regarding automated tests.

This is the warning I get most of the times.

Reflection error: Drupal\Tests\PhpunitCompatibilityTrait not found.

Steps to reproduce

-> install drupal 8.x composer based setup
-> require drupal/upgrade_status
-> running " drush upgrade_status:analyze"

Anyone else having same troubles? Do I have a misconfiguration or is this a general problem?

Best

CommentFileSizeAuthor
#8 3172382.patch354 bytesGábor Hojtsy
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

r81d3r created an issue. See original summary.

r81d3r’s picture

Issue summary: View changes
r81d3r’s picture

I solved this problem on my setup with a complete reinstallation of phpunit and drupal/upgradestatus the following way:

drush pmu upgrade_status
composer remove drupal/upgrade_status
composer remove phpunit/phpunit --dev
composer require phpunit/phpunit:"^6.5 || ^7" --dev && composer update --with-dependencies
composer require drupal/upgrade_status && composer update --with-dependencies
drush cr && drush en upgrade_status && drush cr
drush upgrade_status:analyze --all

after upgrade_status runs trough no warnings have been detected

edit: could someone explain to me what this warnings are about?

Arlina’s picture

Experiencing similar errors. Found out the issue started happening after the latest release of phpstan/phpstan 0.12.43. Issue has been reported on the mglaman/drupal-check project: https://github.com/mglaman/drupal-check/issues/186

Quick fix for a project using this would be to manually require the previous version for the time being:
composer require phpstan/phpstan:"0.12.42"

mglaman’s picture

This is a bug in PHPStan Drupal's compact with PHPStan, as @Arlina has noted.

Gábor Hojtsy’s picture

Should we have a composer conflict added?

mglaman’s picture

I think a conflict would be the best approach until I can set aside time to fix the autoloading in PHPStan Drupal

Gábor Hojtsy’s picture

Status: Active » Needs review
FileSize
354 bytes

So this is what we need I guess.

Gábor Hojtsy’s picture

Title: Running "drush upgrade_status:analyze" leads to reflection errors » Running "drush upgrade_status:analyze" leads to reflection errors, add conflict to new phpstan versions for now

  • Gábor Hojtsy committed 3c8cb76 on 8.x-3.x
    Issue #3172382 by Gábor Hojtsy, r81d3r, mglaman, Arlina: Running "drush...
Gábor Hojtsy’s picture

Version: 8.x-2.9 » 8.x-3.x-dev
Status: Needs review » Fixed

Fixed for now. Will tag a new release of 3.x soon and 2.x soon.

  • Gábor Hojtsy committed 79b1dc7 on 8.x-2.x
    Issue #3172382 by Gábor Hojtsy, r81d3r, mglaman, Arlina: Running "drush...
mglaman’s picture

Good call. I'm trying to figure out what broke phpstan-drupal in nikic/php-parser to 4.10.0 or ondrejmirtes/better-reflection to 4.3.29 for PHPStan 0.12.43.

Gábor Hojtsy’s picture

Released for now in 8.x-2.11 and 8.x-3.0-beta2.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.