Skip to content

Commit

Permalink
[Travis] Fixed memory issues during build (#2869)
Browse files Browse the repository at this point in the history
* [Travis] Reduced Composer memory usage.

* [Travis] Enabled swap for Behat tests.

Co-Authored-By: Andrew Longosz <alongosz@users.noreply.github.com>
  • Loading branch information
mnocon and alongosz committed Nov 27, 2019
1 parent dd16959 commit 44fa432
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
7 changes: 4 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ env:
# In order to specify extra flags like ignoring platform reqs, using only stable packages and so on-
- COMPOSER_FLAGS=""
# By default test with Symfony 2.8, some test are done against 3.4 for forward compat testing.
- SYMFONY_VERSION="~2.8.51"
- SYMFONY_VERSION="~2.8.52"

matrix:
fast_finish: true
Expand All @@ -42,7 +42,7 @@ matrix:
- php: 5.6
env: TEST_CONFIG="phpunit-integration-legacy.xml" DB="postgresql" DATABASE="pgsql://postgres@localhost/testdb"
- php: 5.6
env: BEHAT_OPTS="--profile=core --tags=~@broken" RUN_INSTALL=1 SYMFONY_ENV=behat SYMFONY_DEBUG=1
env: BEHAT_OPTS="--profile=core --tags=~@broken" RUN_INSTALL=1 SYMFONY_ENV=behat SYMFONY_DEBUG=1 COMPOSER_MEMORY_LIMIT=-1
# 7.0
- php: 7.0
env: REST_TEST_CONFIG="phpunit-functional-rest.xml" RUN_INSTALL=1 SYMFONY_ENV=dev SYMFONY_DEBUG=1
Expand All @@ -55,7 +55,7 @@ matrix:
env: TEST_CONFIG="phpunit-integration-legacy.xml" DB="mysql" DATABASE="mysql://root@localhost/testdb" CUSTOM_CACHE_POOL="singleredis" REDIS_ENABLE_LZF="true" REDIS_ENABLE_IGBINARY="true" SYMFONY_VERSION="~3.4.26"
# 7.2
- php: 7.2
env: TEST_CONFIG="phpunit.xml" SYMFONY_VERSION="~3.4.26"
env: TEST_CONFIG="phpunit.xml" SYMFONY_VERSION="~3.4.34"
# 7.3
- php: 7.3
env: TEST_CONFIG="phpunit.xml"
Expand All @@ -82,6 +82,7 @@ before_install:
- if [ "$REDIS_ENABLE_LZF" = true ] ; then printf "no\n" | pecl install lzf ; fi
# Prepare system
- if [ "$TEST_CONFIG" != "" ] ; then ./bin/.travis/prepare_unittest.sh ; fi
- if [ "$BEHAT_OPTS" != "" ] ; then ./bin/.travis/enable_swap.sh ; fi
- if [ "$BEHAT_OPTS" != "" ] ; then ./bin/.travis/prepare_behat.sh ; fi
- if [ "$REST_TEST_CONFIG" != "" ] ; then ./bin/.travis/prepare_behat.sh ; fi
# Detecting timezone issues by testing on random timezone
Expand Down
6 changes: 6 additions & 0 deletions bin/.travis/enable_swap.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

echo '> Enabling swap...'
sudo /bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=4096
sudo /sbin/mkswap /var/swap.1
sudo /sbin/swapon /var/swap.1
3 changes: 2 additions & 1 deletion bin/.travis/prepare_behat.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export BRANCH_BUILD_DIR=$TRAVIS_BUILD_DIR TRAVIS_BUILD_DIR="$HOME/build/ezplatfo

# Checkout meta repo, use the branch indicated in composer.json under extra._ezplatform_branch_for_behat_tests
EZPLATFORM_BRANCH=`php -r 'echo json_decode(file_get_contents("./composer.json"))->extra->_ezplatform_branch_for_behat_tests;'`
BRANCH_ALIAS=`php -r "echo json_decode(file_get_contents('./composer.json'))->extra->{'branch-alias'}->{'dev-tmp_ci_branch'};"`

cd "$HOME/build"

Expand All @@ -24,4 +25,4 @@ cd ezplatform
#fi

# Install everything needed for behat testing, using our local branch of this repo
./bin/.travis/trusty/setup_from_external_repo.sh $BRANCH_BUILD_DIR "ezsystems/ezpublish-kernel:dev-tmp_ci_branch"
./bin/.travis/trusty/setup_from_external_repo.sh $BRANCH_BUILD_DIR "ezsystems/ezpublish-kernel:dev-tmp_ci_branch as ${BRANCH_ALIAS}"
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"ext-SPL": "*",
"ext-xsl": "*",
"zetacomponents/mail": "^1.8.3",
"symfony/symfony": "^2.8.51 | ^3.4.26",
"symfony/symfony": "^2.8.52 | ^3.4.34",
"symfony-cmf/routing": "~1.4",
"qafoo/rmf": "1.0.*",
"kriswallsmith/buzz": "~0.16.1",
Expand Down

0 comments on commit 44fa432

Please sign in to comment.