RobThree/TwoFactorAuth

Travis will no longer build

RobThree opened this issue ยท 8 comments

If somebody is capable of fixing .travis.yml and phpunit.xml to make it build & run code coverage that would be very much appreciated!

@RobThree with php5.6 something inside the following testcase: TwoFactorAuthTest::testEnsureAllTimeProvidersReturnCorrectTime times out.
Therefore the build will be canceled eventually.

Options that come to mind:

  • find and fix the "bug" inside one of the time time providers related to php5.6
  • allow php5.6 to fail for the build matrix

I dug a bit further - when commenting https://github.com/RobThree/TwoFactorAuth/blob/master/tests/TwoFactorAuthTest.php#L128 Tests complete with 5.6 (you need to confirm with travis though)

I wonder why ntp://time.windows.com does not play well with 5.6 only...

What the... you're right. And there I was, thinking it was phpunit to blame...

Thank you very much! ๐ŸŽ‰

Oh and you should probably run the tests for all php versions not just 5.6

  • if [[ "$TRAVIS_PHP_VERSION" == '5.6' ]]; then phpunit --coverage-text tests ; fi

except for 5.6 nothing will run and always return with exit 0 status and make the build succeed
That probably explains why only 5.6 fails :neckbeard:

Yeah, I removed the conditional and then this happens.

I'm not very much a PHP developer (more of a .Net guy ๐Ÿ˜‰ ) and I'm probably doing it wrong but this is so annoying to test/reproduce. I need to change a line, commit, push, see what Travis does, guess how to fix, try again, lather, rinse, repeat or rollback...

I agree that it can be annoying ๐Ÿ˜‰ on the other hand travis runs against quite a large matrix of php versions... To do that locally is even more annoying (I did with docker php:5.6-cli from https://hub.docker.com/_/php/) to debug this issue.

I would suggest to just drop a few versions (5.4, 5.5, hhvm). If someone really still cares for these versions they could contribute the fixes and re-add the version to the build matrix.

To fix the autoloading issue with 7.x you could try to run vendor/bin/phpunit (which gets installed via composer) instead of the travis default phpunit.

I would suggest to just drop a few versions (5.4, 5.5, hhvm).

As long as there's no reason to drop support for those versions (besides travis/phpunit weirdness) I think it's a plus to also support old(er) versions. You are, however, correct that support for those versions could easily be dropped.

If someone really still cares for these versions they could contribute the fixes and re-add the version to the build matrix.

It's hard (when not calling it out explicitly in the README) to show that it works for all those versions without having an actual build. And it will be hard to convey that the only issue is with travis/phpunit and not the library itself.

To fix the autoloading issue with 7.x you could try to run vendor/bin/phpunit (which gets installed via composer) instead of the travis default phpunit.

I'll try. Thanks, again, for your valuable input!

Finally I got it working with 5.4 and up. Sometimes a job still times out so I removed time.google.com which I put in place for time.windows.com and that seems to help. Also the 7.x versions now build (and do code coverage).

Again, thanks!