Closed amirHossein5 closed 1 year ago
Patch coverage: 8.33
% and project coverage change: -0.49
:warning:
Comparison is base (
d84d714
) 46.64% compared to head (a441f76
) 46.15%.
:mega: This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
See #102 and #103 on why there are some issues with running tests via test runners like artisan.
I wouldn't want the artisan test runner or any other test runner to replace the PHPUnit runner by default.
Test runners like artisan and pest are essentially wrappers around the PHPUnit runner. They generally work the same as PHPUnit with all the options and functionality except they add some functionality, sometimes change the default options, and have different styled output. The phpunit --testdox
output is very similar to the artisan test
output. You can toggle the --testdox
via the command palette PHPUnit: Toggle Option --testdox.
In the case of artisan and pest I don't think I mind having specific settings to enable those as candidate test runners instead of the phpunit executable e.g. boolean settings phpunit.pest
and phpunit.artisan
.
The working directory variable is potentially an issue because paths are already filtered for environment variables the user directory e.g. $HOME/path/...
will expand to the user home directory. A relative path like vendor/bin/runner
should resolve relative to the working directory so I'm not sure there is a need to explicitly specify it. An absolute path /home/code/project/vendor/bin/runner
should resolve without issue too.
The alternative test runner use cases I know of are artisan and pest. At the moment to use pest you can replace the phpunit executable (see #103):
"phpunit.executable": "vendor/bin/pest",
"phpunit.options":
{
"colors=never": true
},
And to use artisan it's a bit hacky (see #102):
"phpunit.prepend_cmd": ["artisan"],
"phpunit.executable": "test",
"phpunit.options":
{
"colors=never": true,
},
We can fix the artisan one to allow the following by allowing the phpunit.executable
option to be a list:
"phpunit.executable": ["artisan", "test"],
"phpunit.options":
{
"colors=never": true,
},
You can set settings on per-project basis: Menu > Project > Edit Project
{
"settings": {
"phpunit.executable": ["artisan", "test"],
"phpunit.options":
{
"colors=never": true,
},
}
}
Yeah that's lighter solution.
We can now replace the phpunit.executable
with a list so any of the following work:
"phpunit.executable": ["artisan", "test"],
"phpunit.executable": ["vendor/bin/pest"],
"phpunit.executable": "vendor/bin/pest",
I've also added some color output for Pest.
Add
phpunit.replace_phpunit_cmd_if_key_exists
option, to run$WORK_DIR/artisan, test
, or running tests from project script.But there are two issues: