-
Notifications
You must be signed in to change notification settings - Fork 62
Description
I have a very weird bug in vscode, when I invoke Test: Run Test at Cursor cmd id testing.runAtCursor using keyboard shortcut (ctrl+ů c), then it runs the test under the cursor twice, look at the output:
php vendor/bin/pest --filter=^.*::(it returns 404 for invalid date route parameter)(( with (data set )?.*)?)?$ e:\htdocs\pulse\tests\Feature\MessageCountControllerTest.php --colors=never --teamcity
tests/Feature/MessageCountControllerTest.php
tests/Feature/MessageCountControllerTest.php
✅ it returns 404 for invalid date route parameter 45 ms
✅ it returns 404 for invalid date route parameter 44 ms
Tests: 1 passed (1 assertions)
Duration: 0.52s
Tests: 1 passed (1 assertions)
Duration: 0.52s
when I invoke the test using
php vendor/bin/pest --filter=^.*::(it returns 404 for invalid date route parameter)(( with (data set )?.*)?)?$ e:\htdocs\pulse\tests\Feature\MessageCountControllerTest.php --colors=never --teamcity
tests/Feature/MessageCountControllerTest.php
✅ it returns 404 for invalid date route parameter 45 ms
Tests: 1 passed (1 assertions)
Duration: 0.50s
The first run can fail if am using different .env file, like:
{
"phpunit.phpunit": "vendor/bin/pest",
"phpunit.environment": {
"APP_ENV": "testing.mysql"
}
}That APP_ENV isn't applied to the first run, but it is a secondary problem, test should be invoked once anyway, most important feature.
Now I have also tried to invoke"Test: Rerun Last Run" cmd id testing.reRunLastRun using keyboard shortcut, and it executes the last unit test twice too.
My keybindings for "Run Test at Cursor":
When I run the exact same command directly from the pwsh terminal: php vendor/bin/pest --filter=^.*::(it returns 404 for invalid date route parameter)(( with (data set )?.*)?)?$ e:\htdocs\pulse\tests\Feature\MessageCountControllerTest.php --colors=never --teamcity, then the unit test is invoked only once.
Do you have any idea where the problem can be? Thx for any advice