scout-extended icon indicating copy to clipboard operation
scout-extended copied to clipboard

Please run `./vendor/bin/pest` instead of `/vendor/bin/phpunit`.

Open andresilvagomez opened this issue 3 years ago • 3 comments

  • Laravel version: 9.19.0
  • Algolia Scout Extended version:
  • Algolia Client Version: #.#.#
  • Language Version: 8.1

Description

When I Run

php artisan scout:sync

Please run ./vendor/bin/pest instead of /vendor/bin/phpunit.

Steps To Reproduce

andresilvagomez avatar Jun 15 '22 17:06 andresilvagomez

Hi @andresilvagomez ,

Could you please point me to where the phpunit command is being run when you run php artisan scout:extended? I can't find anything related to this in our code.

Thank you in advance.

DevinCodes avatar Jun 16 '22 08:06 DevinCodes

@DevinCodes sorry for this delay, thanks to you to answer.

I never execute, only when I put in the terminal, this commands it appear.

Screen Shot 2022-06-29 at 12 15 20

andresilvagomez avatar Jun 29 '22 17:06 andresilvagomez

I'm not able to reproduce this issue, does it come from some configuration in your project perhaps?

Would you be able to provide the steps for me to reproduce this? Thank you in advance!

DevinCodes avatar Jun 30 '22 16:06 DevinCodes

This error can be caused when the SearchableFinder scans for classes but finds tests. More specifically if you have test files anywhere in a PSR4 autoloaded directory (eg /app)

The call tree:

/vendor/algolia/scout-extended/src/Helpers/SearchableFinder.php:97 - require_once()
/vendor/algolia/scout-extended/src/Helpers/SearchableFinder.php:64 - getProjectClasses()
/vendor/algolia/scout-extended/src/Helpers/SearchableFinder.php:47 - find()
/vendor/algolia/scout-extended/src/Console/Commands/StatusCommand.php:44 - fromCommand()

This library is setup to handle exceptions during this discovery process but Pest calls exit and kills execution.

freshleafmedia avatar Aug 01 '23 09:08 freshleafmedia

2024: was getting errors for any scout command.

thanks @freshleafmedia , your response helped me fix this error. We found some tests deep in our /app folder. once removed, the scout commands worked fine.

cheers! 🍻

taivu avatar Apr 10 '24 16:04 taivu