Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reflection error: Drupal\Tests\PhpunitCompatibilityTrait not found. #4253

Closed
dmgig opened this issue Sep 30, 2020 · 2 comments
Closed

Reflection error: Drupal\Tests\PhpunitCompatibilityTrait not found. #4253

dmgig opened this issue Sep 30, 2020 · 2 comments
Labels
Bug Something isn't working

Comments

@dmgig
Copy link

dmgig commented Sep 30, 2020

Describe the bug
When running the pre-push validation, there is an error in the tests:deprecated:modules stage and the validation fails.

 ------ ---------------------------------------------------------------------
  Line   relationships/tests/src/Kernel/RelationshipsBuilderModuleTest.php
 ------ ---------------------------------------------------------------------
         Reflection error: Drupal\Tests\PhpunitCompatibilityTrait not found.
         💡 Learn more at https://phpstan.org/user-guide/discovering-symbols
 ------ ---------------------------------------------------------------------

To Reproduce

Run git push

Problem seems to be related to this ticket which was opened fairly recently: https://github.com/mglaman/drupal-check/issues/186

The solution was to run composer require phpstan/phpstan:0.12.42 --dev because, according to the ticket, phpstan 0.12.43 has a bug.

I'm not even sure if this would be considered a blt issue, my apologies if not, but wanted to point it out as it crops up running a blt command.

Expected behavior
The validation should pass.

BLT doctor output

davidgiglio@iMac teamleaders (develop) $ blt doctor
+---------------------------+--------------------------------------------------------------+
| Property                  | Value                                                        |
+---------------------------+--------------------------------------------------------------+
| %paths.%root              | /Users/davidgiglio/Repos/newyorkcares/teamleaders/docroot    |
| %paths.%site              | sites/default                                                |
| %paths.%modules           | sites/all/modules                                            |
| %paths.%themes            | sites/all/themes                                             |
| %paths.%config-sync       | /Users/davidgiglio/Repos/newyorkcares/teamleaders/config/def |
|                           | ault                                                         |
| %paths.%files             | sites/default/files                                          |
| %paths.%temp              | /tmp                                                         |
| %paths.%private           | /Users/davidgiglio/Repos/newyorkcares/teamleaders/files-priv |
|                           | ate/default                                                  |
| admin-theme               | seven                                                        |
| alias-searchpaths.0       | /Users/davidgiglio/Repos/newyorkcares/teamleaders/drush/site |
|                           | s                                                            |
| base-profile              |                                                              |
| blt-version               | 11.5.0                                                       |
| bootstrap                 | Successful                                                   |
| composer-version          | Composer version 1.10.0 2020-03-10 14:08:05                  |
| config-sync               | /Users/davidgiglio/Repos/newyorkcares/teamleaders/config/def |
|                           | ault                                                         |
| db-driver                 | mysql                                                        |
| db-hostname               | 127.0.0.1                                                    |
| db-name                   | db                                                           |
| db-password               | db                                                           |
| db-port                   | 32826                                                        |
| db-status                 | Connected                                                    |
| db-username               | db                                                           |
| drupal-settings-file      | sites/default/settings.php                                   |
| drupal-version            | 8.9.6                                                        |
| drush-alias-files.0       | /Users/davidgiglio/Repos/newyorkcares/teamleaders/drush/site |
|                           | s/teamleaders.site.yml                                       |
| drush-cache-directory     | /Users/davidgiglio/.drush/cache                              |
| drush-conf.0              | /Users/davidgiglio/Repos/newyorkcares/teamleaders/vendor/dru |
|                           | sh/drush/drush.yml                                           |
| drush-conf.1              | /Users/davidgiglio/Repos/newyorkcares/teamleaders/drush/drus |
|                           | h.yml                                                        |
| drush-conf.2              | /Users/davidgiglio/Repos/newyorkcares/teamleaders/docroot/si |
|                           | tes/default/local.drush.yml                                  |
| drush-script              | /Users/davidgiglio/Repos/newyorkcares/teamleaders/vendor/dru |
|                           | sh/drush/drush                                               |
| drush-temp                | /tmp                                                         |
| drush-version             | 10.3.4                                                       |
| files                     | sites/default/files                                          |
| install-profile           | lightning                                                    |
| modules                   | sites/all/modules                                            |
| php-bin                   | /usr/local/Cellar/php/7.4.9/bin/php                          |
| php-conf.0                | /usr/local/etc/php/7.4/php.ini                               |
| php-os                    | Darwin                                                       |
| private                   | /Users/davidgiglio/Repos/newyorkcares/teamleaders/files-priv |
|                           | ate/default                                                  |
| root                      | /Users/davidgiglio/Repos/newyorkcares/teamleaders/docroot    |
| site                      | sites/default                                                |
| stacks.drupal-vm.inited   | false                                                        |
| stacks.dev-desktop.inited | false                                                        |
| temp                      | /tmp                                                         |
| theme                     | breeze                                                       |
| themes                    | sites/all/themes                                             |
| uri                       | https://teamleaders.ddev.site                                |
+---------------------------+--------------------------------------------------------------+
+------------------------------------------+--------------------------------------------------------------+
| Check                                    | Problem                                                      |
+------------------------------------------+--------------------------------------------------------------+
| FileSystemCheck:checkFileSystem:%private | Private files directory does not exist.                      |
|                                          |                                                              |
|                                          | Create                                                       |
|                                          | /Users/davidgiglio/Repos/newyorkcares/teamleaders/files-priv |
|                                          | ate/default.                                                 |
|                                          | Installing Drupal will create this directory for you.        |
|                                          | Run `blt drupal:install` to install Drupal, or run `blt      |
|                                          | setup` to run the entire setup process.                      |
|                                          | Otherwise, run `mkdir -p                                     |
|                                          | /Users/davidgiglio/Repos/newyorkcares/teamleaders/files-priv |
|                                          | ate/default`.                                                |
|                                          |                                                              |
| NodeCheck:checkNodeVersionFileExists     | Neither .nvmrc nor .node-version file found in repo root.    |
| PhpCheck:checkPhpDateTimezone            | PHP setting for date.timezone is not set.                    |
|                                          |   Define date.timezone in /usr/local/etc/php/7.4/php.ini     |
+------------------------------------------+--------------------------------------------------------------+
[error]  BLT Doctor discovered one or more critical issues.
For troubleshooting guidance and support, see https://docs.acquia.com/blt/support/

System information

  • Operating system type: Mac
  • Operating system version: 10.14.6
  • BLT version: BLT 11.5.0
@dmgig dmgig added the Bug Something isn't working label Sep 30, 2020
@danepowell
Copy link
Contributor

If this turns out to be due to drupal-check, I'm going to remove it entirely from BLT. This is about the tenth time that a new "minor" release has broken something. The phpstan/drupal-check stack is just too unstable. cc @mikemadison13

@danepowell
Copy link
Contributor

danepowell commented Oct 2, 2020

It sounds like the problem was just with that particular version of phpstan (0.12.43). There have been five new releases since then (in itself a little unnerving), and I couldn't reproduce it on the latest (0.12.48).

I hate to do this, but I think we have to remove the integration, it just causes people too much grief: #4254

danepowell added a commit that referenced this issue Oct 7, 2020
* Remove Drupal Check commands

* Update composer

* Fix tests

* Remove from validate:all
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants