Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Travis] Fixed REST tests failing for PHP < 7.3 #2909

Merged
merged 2 commits into from
Jan 9, 2020
Merged

[Travis] Fixed REST tests failing for PHP < 7.3 #2909

merged 2 commits into from
Jan 9, 2020

Conversation

mnocon
Copy link
Member

@mnocon mnocon commented Jan 7, 2020

Question Answer
JIRA issue https://jira.ez.no/browse/EZP-31268
Bug/Improvement issue in tests
New feature no
Target version 6.13, 7.5 (not needed for master, as it requires PHP 7.3)
BC breaks no
Tests pass should
Doc needed no

The REST functional tests job in ezplatform-http-cache is failing: https://travis-ci.org/ezsystems/ezplatform-http-cache/jobs/626775072

This is caused by the usage of heredoc syntax that has been allowed only since PHP 7.3:
https://www.php.net/manual/en/migration73.new-features.php#migration73.new-features.core.heredoc

This PR:

  1. b152807f1536141aca4ffac769d51b6075762d45 (to uncover the issue): lowers the PHP versions on which tests (the ones using Docker) are run, so we can detect issues like this one. The change is from PHP 7.3 to PHP 7.2 - I've considered different versions, but since this is the lowest still supported (according to https://www.php.net/supported-versions.php ) I think we can focus on that in tests.
  2. 199ff5c23d30d407c59fef22f23796d936530b07: changes the syntax, so that tests can be run on older PHP versions as well

TO DO (before merge):

  1. Remove TMP before merging
  2. Remove redundant commits

Notes:

  1. The code looks different in 7.5 and will require additional changes when merging upstream

TODO:

  • Implement feature / fix a bug.
  • Implement tests.
  • Fix new code according to Coding Standards ($ composer fix-cs).
  • Ask for Code Review.

.travis.yml Outdated Show resolved Hide resolved
@mnocon mnocon changed the title [WIP] [Travis] Fix REST tests failing for PHP < 7.3 [Travis] Fix REST tests failing for PHP < 7.3 Jan 8, 2020
@mnocon mnocon requested review from alongosz and adamwojs January 8, 2020 07:29
.travis.yml Outdated Show resolved Hide resolved
@andrerom
Copy link
Contributor

andrerom commented Jan 8, 2020

Seems 5.6 is running into memory:

Package operations: 127 installs, 0 updates, 0 removals

  • Installing symfony/polyfill-ctype (v1.13.1): Downloading (100%)
    proc_open(): fork failed - Cannot allocate memory
    The archive may contain identical file names with different capitalization (which fails on case insensitive filesystems)
    Unzip with unzip command failed, falling back to ZipArchive class
    The following exception is caused by a lack of memory or swap, or not having swap configured
    Check https://getcomposer.org/doc/articles/troubleshooting.md#proc-open-fork-failed-errors for details
    PHP Warning: proc_open(): fork failed - Cannot allocate memory in phar:///home/travis/.phpenv/versions/5.6.32/bin/composer/vendor/symfony/console/Application.php on line 952
    Warning: proc_open(): fork failed - Cannot allocate memory in phar:///home/travis/.phpenv/versions/5.6.32/bin/composer/vendor/symfony/console/Application.php on line 952

[ErrorException]
proc_open(): fork failed - Cannot allocate memory

@alongosz
Copy link
Member

alongosz commented Jan 8, 2020

Seems 5.6 is running into memory:

@mnocon How about running temporarily tests with committed composer.lock? Just to see if on 5.6 it's still working.

Final solution should use PHP 7.1 then.

@mnocon
Copy link
Member Author

mnocon commented Jan 8, 2020

@alongosz Sure: a8fff7b

If it passes I'll rework the PR to use PHP7.1. If it fails... I'll see what can be done

@mnocon
Copy link
Member Author

mnocon commented Jan 9, 2020

Passing job on 5.6: https://travis-ci.org/ezsystems/ezpublish-kernel/jobs/634269119 (with composer.lock) (Solr job failed because the dependency is not added when running with lock).

I will rework this PR to use PHP7.1 now.

@mnocon
Copy link
Member Author

mnocon commented Jan 9, 2020

@alongosz @andrerom please have a look again - all jobs using full setup have been moved to use PHP7.1

@alongosz alongosz changed the title [Travis] Fix REST tests failing for PHP < 7.3 [Travis] Fixed REST tests failing for PHP < 7.3 Jan 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

4 participants