Open ili101 opened 1 week ago
{
"phpunit.phpunit": "/srv/api/bin/phpunit",
"phpunit.args": [
"--configuration", "/srv/api/phpunit.xml.dist"
],
}
Changed, still not detected.
Same.
This is my config:
"phpunit.command": "node ./phpunit-wrapper.mjs",
"phpunit.php": "",
"phpunit.phpunit": "",
Since I updated to version 3.4.2
extension is not finding tests. Latest version which works for me is 3.3.9
In my phpunit.xml
I have
<testsuites>
<testsuite name="Functional">
<directory suffix="Test.php">packages/*/Tests</directory>
</testsuite>
...
</testsuites>
If I replace *
with specific folder
<directory suffix="Test.php">packages/Package1/Tests</directory>
then it returns tests in versions after 3.3.9
I have the same problem of this issue (which is the same as the one of 2 weeks ago)
Since I updated to version
3.4.2
extension is not finding tests. Latest version which works for me is3.3.9
In my
phpunit.xml
I have<testsuites> <testsuite name="Functional"> <directory suffix="Test.php">packages/*/Tests</directory> </testsuite> ... </testsuites>
If I replace
*
with specific folder<directory suffix="Test.php">packages/Package1/Tests</directory>
then it returns tests in versions after
3.3.9
@ljubadr Allowpackages/*/Tests starting from version 3.4.4."
The test files are not displayed; you can refer to #188 for more details.
It looks like my problem is that absolute paths are not working.
With my original config that worked before and works from terminal /srv/api/bin/phpunit --configuration /srv/api/phpunit.xml.dist
the extension doesn't detect the XML:
"phpunit.args": [
"--configuration", "/srv/api/phpunit.xml.dist"
],
if I change it to:
"phpunit.args": [
"--configuration", "./api/phpunit.xml.dist"
],
Extention finds the XML (in /srv/api/phpunit.xml.dist
) but PHPUnit looks for it in /srv/api/api/phpunit.xml.dist
.
I think absolute paths need to be fixed so I can use my original config or something like what is suggested in the phpunit.args configuration example:
"phpunit.args": [
"--configuration", "${workspaceFolder}/api/phpunit.xml.dist"
],
@recca0120 I just tested 3.4.4
that you mentioned here and it finds tests with packages/*/Tests
One thing that I noticed is that in this vscode extension packages/*/Tests
is case sensitive so it won't match packages/Package2/tests
Current phpunit.xml
config
<directory suffix="Test.php">packages/*/Tests</directory>
will match both tests packages/.../Tests
and packages/.../tests
. I tested this by running
phpunit --list-tests
My phpunit/phpunit
version is 9.6.10
@recca0120 - thanks for your efforts!
But I just want to say that 3.4.7 is still broken for me 😊
3.3.9 was working well.
Thanks again.
@ghnp5 you can install version > 3.4.9, maybe fix your problem.
Thanks. I tried 3.4.10, but it still doesn't find any tests. :(
What is the method the extension finds the Test php files? Is it in some config?
The reason I ask is because the settings I have are these:
"phpunit.command": "node ./phpunit-wrapper.mjs",
"phpunit.php": "",
"phpunit.phpunit": "",
Which means I'm not passing any path/wildcard to say where the tests are.
The tests are inside a folder called something/tests/
, with a file called __phpunit.xml
with the configs for the tests.
So, unless the extension does a full scan to the whole repository to find the tests, I'm not seeing what other way the extension would know where the tests are.
Thanks!
I started experiencing this issue recently where the tests are not appearing in the testing section like they used to. I do remote development through SSH and docker/sail. Never had issues before, didn't change any config either. Version 3.4.10 btw.
Hi, updated from 3.2.2 to 3.4.2.
/srv/.vscode/settings.json
/srv/api/phpunit.xml.dist
Test file:
/srv/api/tests/Api/FlowTest.php
(also tried to copy to/srv/api/tests/FlowTest.php
or set<directory>
to/srv/api/tests/Api
)Testing from terminal: