algolia / scout-extended

Scout Extended: The Full Power of Algolia in Laravel
https://www.algolia.com/doc/framework-integration/laravel/getting-started/introduction-to-scout-extended/
MIT License
400 stars 86 forks source link

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

Closed andresilvagomez closed 1 year ago

andresilvagomez commented 2 years ago

Description

When I Run

php artisan scout:sync

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

Steps To Reproduce

DevinCodes commented 2 years ago

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.

andresilvagomez commented 2 years ago

@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
DevinCodes commented 2 years ago

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!

freshleafmedia commented 1 year ago

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.

taivu commented 7 months ago

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! 🍻