Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test results not displaying in VSCode when using a testsuite name that contains spaces #100

Closed
joeriharleman opened this issue Dec 11, 2023 · 1 comment

Comments

@joeriharleman
Copy link

joeriharleman commented Dec 11, 2023

Repro

  1. Create a few test methods, assuming a normal setup
  2. Configure a testsuite in your phpunit.xml with a testsuite name of "test repro" (see below for an example)
  3. Click "Run All Tests" from the Visual Studio Testing window

Outcome

Notice how the results of your entire test suite are not updated/reported.
It seems that the --testsuite argument value (the testsuite name) isn't put in quotes, which is somehow leading to the results not being shown in VSCode. See output below. Running individual tests works fine. Renaming the testsuite to "testRepro" fixes the issue.

Expected outcome

All the tests that are found by VSCode are updated (e.g. the result of the test is being shown both inline in code (in the case of errors) and in the Testing window).

Logs / output / settings

<phpunit
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
         bootstrap="./vendor/autoload.php">
    <testsuites>
        <testsuite name="test repro">
            <directory>tests</directory>
        </testsuite>
    </testsuites>
</phpunit>
> php -d display_errors=on "<my path>\vendor\bin\phpunit" -c phpunit.xml --teamcity --colors=never --testsuite test repro 
PHPUnit 10.5.2 by Sebastian Bergmann and contributors.
Runtime:       PHP 8.1.2
Configuration: <my path>\phpunit.xml
Unexpected: test 'testAbc' has started (but was not listed in Test Window)
Unexpected: test 'testAbc' has passed (but was not listed in Test Window)
Unexpected: test 'testGhi' has started (but was not listed in Test Window)
Unexpected: test 'testGhi' has passed (but was not listed in Test Window)
Environment Values
Extension version v4.12.0
Operating system Windows 11
PHPUnit 10.5.2
VSCode 1.84.2
@elonmallin
Copy link
Owner

Thanks for the issue.

I wrapped the value in --testsuite with quotes like --testsuite 'test repro' and released a new version that's on its way. I'll close this but please reopen if it doesn't work.

PR with fix #102

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants