Open neeravp opened 3 years ago
Issue-Label Bot is automatically applying the label bug
to this issue, with a confidence of 0.85. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!
Links: app homepage, dashboard and code for this bot.
@neeravp Can you copy the command that's being run? It should show before the error
Executing task: /Users/neerav/Sites/pcg/modules/studeo/vendor/bin/pest /Users/neerav/Sites/pcg/modules/studeo/tests/Unit/StudeoTest.php --filter 'knows the path' --configuration /Users/neerav/Sites/pcg/modules/studeo/phpunit.xml <
FAIL Modules\studeo\vendor\pestphp\pest\bin\pest
Digging a little, I think the issue arises because the $rootPath
in vendor/pestphp/pest/bin/pest
as well as vendor/pestphp/pest/src/Actions/LoadStructure.php
always takes the project root and not the package root.
My file structure is as below
LaravelApp
|-app
|- other default laravel folders/directories
|-modules
|-mypackage
|-src
|-tests
|-Unit
|-Feature
|-vendor (contains pestphp)
When I try running any test from within Unit or Feature folder within mypackage/tests
the $rootPath
is being set to LaravelApp and not mypackage so it doesn't pick up on the Pest.php
file in the mypackage/tests
directory.
If you look at the task being executed it is being executed from /Users/neerav/Sites/pcg/modules/studeo/vendor/bin/pest
, however when I check for $rootPath in vendor/pestphp/pest/bin/pest
or vendor/pestphp/pest/src/Actions/LoadStructure.php
using dd($rootPath) I'm getting /Users/neerav/Sites/pcg
@m1guelpf Any update?? I'm really missing the ease of running the tests directly from vscode.
@m1guelpf Still awaiting update. Will you be able to spare time to look in to the issue and try to get it fixed soon? Or is it that your current commitments makes it difficult to spare time for the same. I would really be very happy to have a fix asap - I understand you may be busy with your other pressing commitments though Keeping fingers crossed
Hey @m1guelpf Tried to look in the code and solve the issue to submit a PR, however could not get to wrap my head around. Would you be able to spare time and look in the issue?
What are the steps to reproduce this issue?
When running the test using
Cmd+K, Cmd+R
What happens
It gives an error
Target class [config] does not exist.
What were you expecting to happen?
It should run the test without giving the above error. When I run the test from terminal it runs flawlessly without any error. I am running this test from within a local package using Orchestra Testbench.
Any logs, error output, etc?
…
Any other comments?
It's actually not picking up
tests\Pest.php
or evenuses(Orchestra\Testbench\TestCase::class)
in the file when run thru the extension in vscode (from within a local Laravel package) However, it picks up bothtests\Pest.php
and/oruses(Orchestra\Testbench\TestCase::class)
in the file when run from the terminal (again from within a local Laravel Package)What versions are you using?
Operating System: macOS 10.15.7 Package Version: 0.3.1