Giter Site home page Giter Site logo

parallel-phpunit's People

Contributors

yohang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

parallel-phpunit's Issues

Tests with exit code 1 do not register as failure

When all phpunit commands are finnished the execution will end. The exit status is 0 if all phphunit commands return 0 otherwice it is 1.

If there is a test execution that results with exit(1);, the return code is not registered as a test failure by parallel-phpunit.

<?php
class exitTest
{
    public function test_exitDuringTest() {
        echo 'about to exit...';
        exit(1);
    }
}

Output:

$ parallel-phpunit --pu-verbose .
Running parallel-phpunit 1.3.0
Starting command: /usr/local/bin/phpunit -d parallel-phpunit-thread=0 ./exitTest.php
Command ended: /usr/local/bin/phpunit -d parallel-phpunit-thread=0 ./exitTest.php
PHPUnit 4.2.4 by Sebastian Bergmann.

Configuration read from /tests/phpunit.xml

about to exit...Success: 0 Fail: 0 Error: 0 Skip: 0 Incomplete: 0

Use phpunit from composer when using it

If you installed parallel-phpunit using composer it should use ./vendor/bin/phpunit as default command and not the global installation. (In my case, I even deleted the global installation since I have phpunit shipped with a project using composer).

So at the moment I have to run the following command
./vendor/bin/parallel-phpunit --pu-cmd vendor/bin/phpunit .

More convenient would be just
./vendor/bin/parallel-phpunit .

Odd issue occurs in Circle CI

Hi, hopefully you can help here. I use Sauce labs and CircleCI as continuous integration. I'm having a weird issue, allow me to describe...

When I use composer.json to add "verkkokauppacom/parallel-phpunit": "dev-master"
on my local Ubuntu machine, composer takes care of everything seemingly nice, as I witness that the folder verkkokauppacom/parallel-phpunit/ gets fully-populated with the expected subdirectories (bin, example, tests) and additional files .git, composer.json, and release, and README.md

These files, just FYI, are part of a project that I also track in github, and when I push files to my remote repository, the directory verkkokauppacom/parallel-phpunit/ is empty.

Here is what occurs when composer installs the files:
`Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file

  • Installing verkkokauppacom/parallel-phpunit (dev-master 84f2cea)
    Cloning 84f2cea

    Skipped installation of bin bin/parallel-phpunit for package verkkokauppacom/parallel-phpunit: name conflicts with an existing file
    Generating autoload files`

If I remove the files from my local machine completely, and then push up the difference to my remote, and tell CircleCI to use composer to get the files, all is good again.

Any ideas?

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

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!

Strange output

It will be nice to have same output as original phpunit have. Right now I see something strange:

$ bin/parallel-phpunit example/
Running parallel wrapper for phpunit
Starting command: phpunit   example//1
Starting command: phpunit   example//2
Starting command: phpunit   example//5/6
Success: 1 Fail: 0 Error: 0 Skip: 0 Incomplete: 0
Command ended: phpunit   example//5/6
Command ended: phpunit   example//1
PHPUnit @package_version@ by Sebastian Bergmann.

.

Time: 2 seconds, Memory: 5.00Mb

OK (1 test, 1 assertion)
PHPUnit @package_version@ by Sebastian Bergmann.

.

Time: 2 seconds, Memory: 5.00Mb

OK (1 test, 1 assertion)
Command ended: phpunit   example//2
PHPUnit @package_version@ by Sebastian Bergmann.

...

Time: 3 seconds, Memory: 5.25Mb

OK (3 tests, 3 assertions)
Success: 5 Fail: 0 Error: 0 Skip: 0 Incomplete: 0

Add parameter for less ouput

What about adding new parameter for less output, or parameter for more output like a --pu--verbose? I think that is enough to write on output only this line:

Success: 536 Fail: 0 Error: 0 Skip: 0 Incomplete: 0

after succesfully performed test. And if test ends with error, then should by good to write output from test. That helps to better orientation in output

Mark test as failed when PHP error, warning, ... occured

When test ends for example with this warning:

PHP Warning: require_once(/home/extranet/web/library/Config.php): failed to open stream

Then should be marked as failed. It helps to run tests in parallel automatically and checks only the last line "Success: 542 Fail: 0 Error: 0 Skip: 0 Incomplete: 0"

Subdirectories not used

When I use parallel-phpunit in my root test directory, only the BootstrapTest.php file which is located directly in the root directory is used. No subdirectory is analysed or used for a test-run.

Using phpunit, the subdirectories are used as expected.

parallel-phpunit . > 1 file tested
phpunit . > all files tested

My phpunit.xml isn't fancy at all.

<phpunit bootstrap="./bootstrap.php" colors="true"></phpunit>

Any hints as to why that happens?

Thanks!

Best,
Philipp

Temporary files still existing

First of: thanks for the great tool! It's pretty useful for running selenium tests :)

Now to the issue: I noticed that after exiting there are still some log files present created by pu. Is this a bug or a feature?

Edit: I am refering to the parallel-phpunit.* files.

typo

looks like a typo:
ROOT="${@:-1}" # last argument

should be:
ROOT="${@: -1}" # last argument

parallel-phpunit doesn't recognize php errors

I've been running some tests but it seems parallel-phpunit just runs fine, without reporting any errors, if there is a php error. Look at the log excerpt I've attached.

(...)
Success: 0 Fail: 0 Error: 0 Skip: 0 Incomplete: 0
Command ended: /usr/bin/phpunit -d parallel-phpunit-thread=1 ./b3Test.php
PHPUnit 3.7.21 by Sebastian Bergmann.

PHP Fatal error: Call to undefined function fuckItUp() in /var/www/t/b/b3Test.php on line 54
PHP Stack trace:
PHP 3. PHPUnit_TextUI_Command->run() /usr/share/php/PHPUnit/TextUI/Command.php:129
PHP 4. PHPUnit_TextUI_TestRunner->doRun() /usr/share/php/PHPUnit/TextUI/Command.php:176
PHP 5. PHPUnit_Framework_TestSuite->run() /usr/share/php/PHPUnit/TextUI/TestRunner.php:349
PHP 6. PHPUnit_Framework_TestSuite->runTest() /usr/share/php/PHPUnit/Framework/TestSuite.php:745
PHP 7. PHPUnit_Framework_TestCase->run() /usr/share/php/PHPUnit/Framework/TestSuite.php:775
PHP 8. PHPUnit_Framework_TestResult->run() /usr/share/php/PHPUnit/Framework/TestCase.php:776
PHP 9. PHPUnit_Framework_TestCase->runBare() /usr/share/php/PHPUnit/Framework/TestResult.php:648
PHP 10. PHPUnit_Framework_TestCase->runTest() /usr/share/php/PHPUnit/Framework/TestCase.php:831
PHP 11. ReflectionMethod->invokeArgs() /usr/share/php/PHPUnit/Framework/TestCase.php:976
PHP 12. b3Test->test1() /usr/share/php/PHPUnit/Framework/TestCase.php:976
Starting command with thread 1: /usr/bin/phpunit -d parallel-phpunit-thread=1 ./b2Test.php
./b5Test.php
Success: 1 Fail: 0 Error: 0 Skip: 0 Incomplete: 0
Success: 1 Fail: 0 Error: 0 Skip: 0 Incomplete: 0
Success: 1 Fail: 0 Error: 0 Skip: 0 Incomplete: 0
(...)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.