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

[Proposal] phpunit.xml - Same behaviour as running phpunit #9

Open
schickling opened this issue Apr 30, 2013 · 9 comments
Open

[Proposal] phpunit.xml - Same behaviour as running phpunit #9

schickling opened this issue Apr 30, 2013 · 9 comments

Comments

@schickling
Copy link

I don't know if you follow certain ideas with the solution by now supporting a single phpunit.xml in the root directory as phpunit does it. But I think if you would support this behavior it would be more straight-forward for "native phpunit" users ;)

So if I currently run ./vendor/bin/parallel-phpunit --pu-cmd vendor/bin/phpunit . my complete directory gets tested and not the files I selected in the phpunit.xml. So also all tests in my vendor directory are executed.

Please let me know about your thoughts on this. Have you intended this way or just haven't implemented phpunit.xml support yet.

Cheers!

@razielsd
Copy link

parallel-phpunit doesn't support files selection for phpunit.xml. You can use parameter --group, --exclude-group.

@schickling
Copy link
Author

Well then see this issue as a feature request. I think many people would be very happy about this. Since you already write in your readme:

In most use cases you can just simply replace phpunit with parallel-phpunit and get the same end result.

@siivonen
Copy link
Contributor

siivonen commented May 2, 2013

I don't understand the problem here. Are you talking about testsuites section in phpunit.xml? Could you send an example of phpunit.xml that is not working for you? And maybe the current and expected ouput.

@razielsd
Copy link

razielsd commented May 2, 2013

I'm understand, tomorow try make this feature, getting files from phpunit.xml.

P.S. getting testfiles from phpunit.xml is bad way

@schickling
Copy link
Author

@siivonen If my folder structure looks something like this...

.
├── CONTRIBUTING.md
├── app
│   ├── tests
├── bootstrap
├── composer.json
├── composer.lock
├── phpunit.xml
└── vendor

... I don't want to run all of test tests shipped with my vendor packages. I just want to run the test(-suites) i specified in phpunit.xml

<?xml version="1.0" encoding="UTF-8"?>

<phpunit backupGlobals="false" backupStaticAttributes="false" bootstrap="bootstrap/autoload.php" colors="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false" syntaxCheck="true">
    <testsuites>
        <testsuite name="unit">
            <directory>./app/tests/commands/</directory>
            <directory>./app/tests/models/</directory>
            <directory>./app/tests/controllers/jobs/</directory>
        </testsuite>
    </testsuites>
    <filter>
        <blacklist>
            <directory suffix=".php">./vendor/</directory>
        </blacklist>
        <whitelist addUncoveredFilesFromWhitelist="true">
            <directory suffix=".php">./app/</directory>
        </whitelist>
    </filter>
</phpunit>

@razielsd
Copy link

razielsd commented May 7, 2013

I'm have version for support phpunit.xml, but when running dropped directory/file parameters for each file:

   <testsuites>
        <testsuite name="unit">
            <directory>./app/tests/commands/</directory>
            <directory>./app/tests/models/</directory>
            <directory>./app/tests/controllers/jobs/</directory>
        </testsuite>
    </testsuites>

Commit comming soon ...

@razielsd
Copy link

You can try here https://github.com/razielsd/parallel_phpunit2. Syntax using not changed. Examples: https://github.com/razielsd/parallel_phpunit2/blob/master/README.md

P.S. Only for preview, after complete merge here.

@EvanK
Copy link

EvanK commented May 29, 2014

I don't know if this project is still maintained, but being able to use an existing phpunit.xml config would be supremely helpful in continuous build/integration environments like TravisCI or Codeship

@razielsd
Copy link

@EvanK project work fine, but this issue didn't like to do :) TravisCI is not same behavior for parallel running. Codeship never used:(. I'm use Jenkins CI and Bamboo.

For using phpunit.xml i'm use https://github.com/razielsd/parallel-phpunit2

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

4 participants