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

"phpunit.args" option causing args to be appended multiple times #109

Open
zjbarg opened this issue Jul 28, 2024 · 0 comments
Open

"phpunit.args" option causing args to be appended multiple times #109

zjbarg opened this issue Jul 28, 2024 · 0 comments

Comments

@zjbarg
Copy link

zjbarg commented Jul 28, 2024

Repro

  1. Add "phpunit.args": ["--no-coverage"] to settings.json
  2. Run a test using the extension twice

Outcome

The --no-coverage is appended to the run command an extra time with each run. (5 runs adds --no-coverage 5 times)
1) Option --no-coverage cannot be used more than once warning message

Expected outcome

Not to append the same arg multiple times.

Logs / output / settings

Settings.json

{
    "phpunit.args": ["--no-coverage"]
}

phpunit.xml

<?xml version="1.0" encoding="UTF-8"?>
<phpunit
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.2/phpunit.xsd"
    bootstrap="vendor/autoload.php"
    cacheDirectory=".phpunit.cache"
    executionOrder="depends,defects"
    requireCoverageMetadata="true"
    beStrictAboutCoverageMetadata="true"
    beStrictAboutOutputDuringTests="true"
    failOnRisky="true"
    failOnWarning="true"
>
    <testsuites>
        <testsuite name="myTestSuite">
            <directory>tests/Unit</directory>
        </testsuite>
    </testsuites>

    <source ignoreIndirectDeprecations="true" restrictNotices="true" restrictWarnings="true">
        <include>
            <directory>src</directory>
        </include>
    </source>
</phpunit>

Terminal


 *  Executing task: '/Users/zjbarg/code/foo-project/vendor/bin/phpunit' --colors=always --filter 'SomeTest' --no-coverage --no-coverage --no-coverage '/Users/zjbarg/code/foo-project/tests/some-directory/SomeTest.php' 

PHPUnit 11.2.8 by Sebastian Bergmann and contributors.

Runtime:       PHP 8.3.6
Configuration: /Users/zjbarg/code/foo-project/phpunit.xml

.                                                                   1 / 1 (100%)

Time: 00:00.002, Memory: 8.00 MB

There was 1 PHPUnit test runner warning:

1) Option --no-coverage cannot be used more than once

WARNINGS!
Tests: 1, Assertions: 1, Warnings: 1.

 *  The terminal process "/bin/zsh '-l', '-c', ''/Users/zjbarg/code/foo-project/vendor/bin/phpunit' --colors=always --filter 'SomeTest' --no-coverage --no-coverage --no-coverage '/Users/zjbarg/code/foo-project/tests/some-directory/SomeTest.php''" failed to launch (exit code: 1). 
 *  Terminal will be reused by tasks, press any key to close it. 

Environment Values
Extension version v4.16.1
Operating system macOS
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

1 participant