Make run-tests.php compatible with php 7.0-7.2 - #3981
Conversation
Motivation: As an extension author, I want to speed up running tests in php <=7.3, both locally and in CI (e.g. with valgrind). This can be done by manually copying php 7.4's run-tests.php script to replace the one generated by `phpize` - list() doesn't work in php 7.0 - negative string offset doesn't work in php 7.2 If run-tests.php can be copied from php-src without any manual patches, that would be the easiest. Related to php#2822 - I didn't see any discussion for/against compatibility with older php versions
|
I think the original idea was to keep run-tests.php in sync to as big an extend as possible, so I think it makes good sense to do this |
|
Friendly reminder: PHP 7.0 is dead... |
I'm aware of that, but the work needed to fix this syntax error is negligible and some extension authors haven't dropped php 7.0 from their major version releases (e.g. for CI). If that position is taken by a majority of reviewers, I'm fine with taking that back out. Off-topic: I noticed that
|
|
@petk its a small sacrifice for cross compatibility, it is even better if it helps extension authors. As you can see, the patch is relatively simple and fair enough. Things like these are usually done on a case by case basis and the win for people doing cross versions, despite we do not actively support a certain branch. I therefore think it is a fair compromise to do this |
|
Tagging @hikari-no-yume for the parallel thing you mentioned @TysonAndre |
|
This approach works in Appveyor/Travis. The speedup for Travis with valgrind is noticeable but not as much as I'd expect, but I assume that's just because the VM in AWS is being throttled (virtual CPUs, not real CPUs). Appveyor takes 3 seconds with/without it, but works. https://ci.appveyor.com/project/TysonAndre/igbinary-bemsx/build/job/ha3kop5huw9agtf7 More off-topic discussion:
It seems like Appveyor's unicode support is lacking ; that's one argument in support of a --no-ansi equivalent. It literally looks like the below text in my browser (Chrome/Firefox). Maybe I misconfigured something when running the batch script generated in .appveyor.yml, though (and it may be nice to have a minimal version without the concurrent test workers running count, e.g. when NO_INTERACTION=1 is set or via some new config/env flag) |
|
Other notes on run-tests.php in php 7.4-dev: https://git.php.net/?p=php-src.git;a=commitdiff;h=03f15f705ad30ce2dde7f7b2ab087a132b859ba0 made memory leaks start failing tests at the same time
Would it be reasonable to add
|
|
Regarding -j1, I use it to debug the parallel testing system to see if a test failure is because of parallelism or because of the different execution mode. |
No, I don't think that's reasonable: If you are running tests with valgrind you are checking for memory errors and that includes leaks. If you want to consider memory errors (including leaks) as unimportant for a particular project, then you should allow_failure in your travis configuration, rather than adding another env var to run-tests. Maybe a bit of rationale to explain my position: False positives can be suppressed by configuration of vg, so false positives are a non-issue. The issue you have is that your project leaks and or has memory errors that you want to ignore, but beyond that, you want other people relying on your project to ignore them - that's my issue. Continuous integration, and testing, are a way to determine the suitability of a project for use, and if your project has memory errors and leaks then anyone intending to use your project should be aware of that, and you should be trying to fix those errors, not finding ways to suppress them, and give others the false impression that it's in a better state than it actually is. Setting allowed failures still allows the build to pass, but for anyone looking, they can see instantly that there are issues in some builds, without digging through env vars and or run-tests to determine the actual state of the project. |
|
How about PHP 5.6 support? There are a lot of 5.6 out there also... |
|
@petk Let's be reasonable here really, we might as well support these as they are in the same major version, just because X is available does not mean we need Y because its also used etc. If you have ever written an extension and maintained it over a cross set of versions of PHP, you will know how much something so simple eases it. |
|
Merged as 936356b, thanks. |
Noted... Added Anyway this entire run-tests.php script is in need of a complete rewrite to be more proper anyway. So all is good :) |
Motivation:
As an extension author, I want to speed up running tests in php <=7.3,
both locally and in CI (e.g. when running with valgrind).
This can be done by manually copying php 7.4's run-tests.php script
to replace the one generated by
phpizeIf run-tests.php can be copied from php-src without any manual patches,
that would be the easiest.
Related to #2822 and #3838 - I didn't see any discussion for/against compatibility
with older php versions in that PR.
except for https://github.com/php/php-src/pull/3838/files#r257469673