umpirsky / centipede

:sparkler: The Simplest automated testing tool on Earth.
MIT License
141 stars 15 forks source link

Fails with "PHP Catchable fatal error" #19

Closed clue closed 9 years ago

clue commented 9 years ago

The current master (bfe44f6) does not work and quits with the following error. Didn't dig into this any further, but looks like one of the dependencies received an incompatible update:

$ php bin/centipede run http://10.52.18.222/
PHP Catchable fatal error:  Argument 2 passed to Centipede\Console\Command\Run::Centipede\Console\Command\{closure}() must be an instance of GuzzleHttp\Message\FutureResponse, instance of Symfony\Component\BrowserKit\Response given, called in /tmp/phar-composer8/vendor/umpirsky/centipede-crawler/src/Centipede/Crawler.php on line 64 and defined in /tmp/phar-composer8/src/Centipede/Console/Command/Run.php on line 30
PHP Stack trace:
PHP   1. {main}() /tmp/phar-composer8/bin/centipede:0
PHP   2. Symfony\Component\Console\Application->run() /tmp/phar-composer8/bin/centipede:19
PHP   3. Symfony\Component\Console\Application->doRun() /tmp/phar-composer8/vendor/symfony/console/Symfony/Component/Console/Application.php:126
PHP   4. Symfony\Component\Console\Application->doRunCommand() /tmp/phar-composer8/vendor/symfony/console/Symfony/Component/Console/Application.php:195
PHP   5. Symfony\Component\Console\Command\Command->run() /tmp/phar-composer8/vendor/symfony/console/Symfony/Component/Console/Application.php:874
PHP   6. Centipede\Console\Command\Run->execute() /tmp/phar-composer8/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:252
PHP   7. Centipede\Crawler->crawl() /tmp/phar-composer8/src/Centipede/Console/Command/Run.php:44
PHP   8. Centipede\Crawler->request() /tmp/phar-composer8/vendor/umpirsky/centipede-crawler/src/Centipede/Crawler.php:27
PHP   9. Centipede\Console\Command\Run->Centipede\Console\Command\{closure}() /tmp/phar-composer8/vendor/umpirsky/centipede-crawler/src/Centipede/Crawler.php:64
umpirsky commented 9 years ago

@clue How did you install centipede?

clue commented 9 years ago

Bare git clone and composer install. Just confirmed that the same error still occurs.

Also, running composer update doesn't work either:

$ composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - umpirsky/centipede-crawler dev-master requires react/promise dev-master@dev -> no matching package found.
…

Anything else that could help debugging this?

umpirsky commented 9 years ago

@clue I see, the problem is that it does not fetch the latest centipede-crawler, which is the case when you install centipede as a composer dependency in your project. See https://github.com/umpirsky/centipede/pull/14.

Since centipede-crawler is not stable yet, composer update fails. You can fix it by adding "minimum-stability": "dev" in composer.json.

clue commented 9 years ago

Indeed, modifying the composer.json and running composer update fixes this issue. Thanks!

The project README implies this is to be run as a standalone application (usage, screenshot, its "bin" definition and the fact it contains a composer.lock). In this case the composer.lock should already ship with a set of definitions that is known to work.

I can file a PR for the updated json and lock files, but given that the above directive updated literally every dependency to a dev version, I'm not particular comfortable with it.

What's your take on this?

umpirsky commented 9 years ago

@clue Thanks. I think we need to tag centipede-crawler and by making it a released version fix this issue. I will try to do this as soon as I have time.

clue commented 9 years ago

Awesome, I'll keep an eye on this! Thanks for the quick feedback

umpirsky commented 9 years ago

@clue Should be fixed now. If error persists, feel free to reopen. Thanks!