Skip to content

Conversation

@WyriHaximus
Copy link
Member

Travis CI added hhvm as possible PHP version to test against. Because hhvm is an emerging alternative PHP VM it's interesting to keep an eye on it. By adding it to the test matrix we can see how our code (changes) respond on hhvm. Since it's not critical and AFAIK a goal to work on hhvm I've added it to allow failures. So we don't have to worry about breaking the tests if it doesn't work in hhvm just yet.

@cboden
Copy link
Member

cboden commented Dec 17, 2013

I think adding HHVM to the build is a good idea. It looks like the .travis.yml file needs a bit of love first though. :)

@WyriHaximus
Copy link
Member Author

Yes it does, looking into making the if check for HHVM, before attempting to install libevent.

@nrk
Copy link
Member

nrk commented Dec 17, 2013

We should also skip tests for classes based on pecl extensions (such as React\EventLoop\LibEventLoop and React\EventLoop\LibEvLoop) by adding a check for HHVM_VERSION.

@nrk
Copy link
Member

nrk commented Dec 17, 2013

Oh wait never mind, they are implicitly skipped when related extensions are not found :-)

@WyriHaximus
Copy link
Member Author

Hmm didn't mean to commit that just yet but the github web ui decided I did. Anyway travis doesn't like my check, so have t o figure something else out. I'll contact travis for the best way to check for hhvm and come back with a working version. (Their docs haven't been updated with HHVM yet.)

@cboden
Copy link
Member

cboden commented Dec 17, 2013

You could try parsing the output of php --version and checking for HipHop (if I'm reading this correctly)

@WyriHaximus
Copy link
Member Author

Will try that, but what worries me is the parse error on line 32, not sure yet what is causing that. (Atleast it doesn't look healthy.)

@WyriHaximus
Copy link
Member Author

Ok so moved all the before_script logic into before_script.sh making it easier to maintain and extend.

@igorw
Copy link
Contributor

igorw commented Dec 17, 2013

looks good, the phpunit thing needs to be fixed in hhvm... anything missing form this PR or can it be merged?

@cboden
Copy link
Member

cboden commented Dec 17, 2013

I'd like to see the before_script.sh moved to scripts/travis-init.sh or something to that effect.

@WyriHaximus
Copy link
Member Author

Looks pretty good to me now. The only thing that is still nagging me are the phpunit phar errors. Might have something for that but that would mean loading in phpunit with composer instead of using the system wide install. If it's ok with you @igorw, I can add it to this PR.

@bzikarsky
Copy link

Changing to a non-phar phpunit won't resolve all issues. I just ran phpunit 3.7.28 with hhvm 2.3 on your react:master and get a fatal:

HipHop Fatal error: Declaration of Mock_LoopInterface_79ac08f0::addReadStream() must be compatible with that of React\EventLoop\LoopInterface::addReadStream() in /home/bzikarsky/projects/react/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Generator.php(231) : eval()'d code on line 1

@igorw
Copy link
Contributor

igorw commented Dec 18, 2013

Feel free to install phpunit via composer, but it looks like phpunit-mock-objects still has a bug?

@bzikarsky
Copy link

It's probably related to facebook/hhvm#1363.

The problematic test is React\Test\Dns\Config\FilesystemFactoryTest::parseEtcResolvConfShouldParseCorrectly which mocks LoopInterface. And LoopInterface uses the callable typehint.

I ran into a similiar problem yesterday, and ran some tests with the dev-hhvm branch of PHPUnit. It all came down to problems resolving around the callable typehint.

Edit: maybe it's not related to hhvm#1363 - EventLoop itself runs fine, it's just the mocking of the former. Maybe related to Reflection/callable on HHVM? I'll see what I can findout.

@WyriHaximus
Copy link
Member Author

Ok so phpunit is now loaded by composer, it solves the phar issue but as @bzikarsky mentions there are some fatal erros. How ever in my opinion that isn't something preventing this PR to be merged.

@bzikarsky
Copy link

Yes, I think the problems around HHVM and callable are no reason not to a merge. Loading PHPUnit from composer at least works around the PHAR-bug.

@cboden cboden merged commit 8596b14 into reactphp:master Dec 21, 2013
@cboden
Copy link
Member

cboden commented Dec 21, 2013

Merged. Thanks @WyriHaximus and @bzikarsky - great work! Now we play the waiting game :-)

@igorw
Copy link
Contributor

igorw commented Dec 21, 2013

Thanks indeed!

@bzikarsky
Copy link

Though I think the PHAR issue is already resolved in HHVM/master. We might be able to remove phpunit from composer.json very soon.

Edit: Link to resolved PHAR issue: facebook/hhvm#1334
=> When 2.4 is tagged and on Travis VMs we're safe to remove 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.

5 participants