McNetic/PHPZipStreamer

Travis-CI not working with PHP 5.5/5.6

Opened this issue · 15 comments

Unit tests in Travis-CI are not working for PHP 5.5/5.6, although the tests can be run manually without problems. See https://travis-ci.org/McNetic/PHPZipStreamer/builds/72121020 for the output.
@szepeviktor

I've seen a solution somewhere else:
Open a PR that produces debug output to Travis build log.
That seems to be the fastest solution.

Uhm, I don't understand what you mean.

If you open a PR and modify the test's code to output debug data,
you can watch Travis' output.
Then you close the PR at the end.

It seems this error is caused by missing propro and raphf extensions (dependencies of pecl_http)

The propro and raphf extensions are installed by the travis script in the test directory. Otherwise, it would not work for the other version combinations, also.

Interestingly, this happens only with php 5.5 and 5.6, but not with earlier nor with later versions (I just implemented the travis tests for php 7). I could also never reproduce the issues on my systems, only on travis.

Try using the more modern Travis instance https://docs.travis-ci.com/user/trusty-ci-environment/

The problem on PHP 7 is simply extension double-loading.

The trusty instances seem to lack some packages required for building the php extensions, and contain phpunit version no longer working with php < 5.6. There is a bit work necessary to make that work.

@McNetic After taking a look at https://pecl.php.net/package/raphf
pecl install raphf-1.1.2 will do for PHP < 7

and some ideas for test/travis/php-modules-install.sh:
szepeviktor@96f931f

Actually, PHP7 tests are working as of current master (see https://travis-ci.org/McNetic/PHPZipStreamer/builds/105642618). It's only the 5.5 and 5.6 tests that fail.
Additionally, I don't see any functional changes in your commit aside from the raphf-1.1.2 change. It's hard to see with your changing the code style nearly everywhere. Or are these changes your purpose?

This is the relevant part for this issue

if [ "${PECL_HTTP_VERSION%%.*}" -ge 7 ]; then
   yes | pecl_module_install raphf raphf.so
   yes | pecl_module_install propro propro.so
elif [ "${PECL_HTTP_VERSION%%.*}" -gt 1 ]; then
  yes | pecl_module_install raphf-1.1.2 raphf.so
  yes | pecl_module_install propro-1.0.2 propro.so
fi

All other modifications are making the test safer.

The point is that latest raphf works only on PHP 7, 1.1.2 has to be installed for 5.*

Well, that's nice. With these raphf/propro versions, it works at least for pecl_http 3 (unfortunately, still not with pecl_http 2.5.0).
Regarding your various style changes: I can not see any real improvement in these. `` vs. $() is mostly a style decision (I adopted this to be consistent). There is no additional safety in quoting constructs like ${...} or $(...), or direct variable assignments like ...=$1. The variable substitution in the above snippet is nice though.
Thank you very much for your improvements!

You're welcome.