Page MenuHomePhabricator

tools.heritage CI is broken because of PHP test
Closed, ResolvedPublic

Description

In c765e76a72c3 I added the PHP unit test structure (via Composer entry-point) and in c99668d56189 I added it to the CI config with the composer-test55 template.

Now the tests are failing because composer-test55 includes composer-hhvm-trusty, which fails on the preg_replace construct.

I’m not entirely sure what’s happening here. I do understand that “this feature was DEPRECATED in PHP 5.5.0, and REMOVED as of PHP 7.0.0.”. If I understand correctly, the HHVM job runs PHP 5.6.99. Certainly the job should raise a deprecation warning without failing? But why a construct fine in the composer-php55 builder is not in composer-hhvm?

I’m not sure what do here either. I could refactor the code to not use the deprecated feature ; but on the other hand I don’t think we have any interest in supporting any PHP version besides whatever is on ToolLabs (5.5.9 as of now I believe) ; and certainly not HHVM.

Alternatively I change the CI config by only executing composer-php55 (and composer-validate etc) but I won’t be able to use the template so will have some duplication.

Thoughts @hashar and @Lokal_Profil ?

Details

Related Changes in Gerrit:

Event Timeline

JeanFred moved this task from Incoming to Internals on the Wiki-Loves-Monuments board.
1) CommonFunctionsTest::test_processWikitext_empty
preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead

2) CommonFunctionsTest::test_processWikitext_makelinks_form_1
preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead
 
3) CommonFunctionsTest::test_processWikitext_makelinks_form_2
preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead
 
api/includes/CommonFunctions.php:26
api/tests/CommonFunctionsTest.php:53

We can surely drop the hhvm job, then the regex modifier /e (which eval code) is definitely evil and I can see why it never got supported by HHVM.

Change 286590 had a related patch set uploaded (by Hashar):
[labs/tools/heritage] drop HHVM job

https://gerrit.wikimedia.org/r/286590

Change 286590 merged by jenkins-bot:
[labs/tools/heritage] drop HHVM job

https://gerrit.wikimedia.org/r/286590

@JeanFred wrote:

Alternatively I change the CI config by only executing composer-php55 (and composer-validate etc) but I won’t be able to use the template so will have some duplication.

CI enforces a lot of things, but making life of developers harder is not one of them :-} The templates in Zuul are merely for convenience, if a repo has a different use case by all price lets just adjust the CI conf.

With https://gerrit.wikimedia.org/r/286590 it should no more run the HHVM jobs which most probably fix this task.

I highly recommend filling a task to eventually drop the /e regex modifier.

I highly recommend filling a task to eventually drop the /e regex modifier.

Now in T134236

Was there anything left in this task or can it be closed? @JeanFred ?

Yes, I believe we can close this :)