Skip to content

Conversation

@gvieira18
Copy link

Motivation

This PR introduces a optional flag --no-phpunit similar to --no-phpstorm for the modules:sync command to prevent it from modifying the phpunit.xml file. It is useful in scenarios where the user wants to maintain custom test suite configurations without interference from the sync process.


In my case, I have configured the app-modules to use same test suites as the main tests folder.

<testsuites>
    <testsuite name="Unit">
        <directory>tests/Unit</directory>
        <directory>app-modules/*/tests/Unit</directory>
    </testsuite>
    <testsuite name="Feature">
        <directory>tests/Feature</directory>
        <directory>app-modules/*/tests/Feature</directory>
    </testsuite>
</testsuites>

When I ran php artisan modules:sync, the command adds the new test suite Modules with all the tests from app-modules/*/tests:

<testsuites>
    <testsuite name="Unit">
        <directory>tests/Unit</directory>
        <directory>app-modules/*/tests/Unit</directory>
    </testsuite>
    <testsuite name="Feature">
        <directory>tests/Feature</directory>
        <directory>app-modules/*/tests/Feature</directory>
    </testsuite>
    <testsuite name="Modules">
        <directory suffix="Test.php">./app-modules/*/tests</directory>
    </testsuite>
</testsuites>

Which results in warnings like this displayed in the console:

WARN  Cannot add file <TEST FILE> to test suite "Modules" as it was already added to test suite "{Unit|Feature}"

@danielhe4rt
Copy link

I was looking for that! Thanks for the Pull Request, @gvieira18. I'll be using your fork for now until they merge it.

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

Successfully merging this pull request may close these issues.

3 participants