diff --git a/.travis.yml b/.travis.yml index a5601061..2c1cf3b0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,30 +2,36 @@ language: php # run tests on php misc php versions php: - - 5.4 - - 5.5 +# - 5.4 +# - 5.5 - 5.6 +env: + - SUITE=phpunit + - SUITE=behat INSTALL="demoContentNonUniqueDB" PROFILE="demo" TEST="content" + - SUITE=behat INSTALL="demoCleanNonUniqueDB" PROFILE="legacyAdmin" TEST="full" + # test only master (+ Pull requests) branches: only: - master -# setup requirements for running unit tests -before_script: - # TEMP get latests version of composer which is faster - ##- composer self-update - # Disable xdebug to speed things up as we don't currently generate coverge on travis - - if [ $TRAVIS_PHP_VERSION != "hhvm" ]; then phpenv config-rm xdebug.ini ; fi +# Get ezpublish5 repo, and use it as the build dir +before_install: # Setup github key to avoid api rate limit - ./composer_install_github_key.sh - # Install packages using composer - - composer install --dev --prefer-dist - # Copy default test configuration - - cp config.php-DEVELOPMENT config.php + - if [[ $SUITE == "phpunit" ]]; then ./.travis/phpunit_before_install.sh; fi; + - if [[ $SUITE == "behat" ]]; then ./.travis/behat_before_install.sh; fi; + +# setup requirements for running unit tests +before_script: + - if [[ $SUITE == "phpunit" ]]; then ./.travis/phpunit_before_script.sh; fi; + - if [[ $SUITE == "behat" ]]; then ./.travis/behat_before_script.sh; fi; -# execute phpunit as the script command -script: "./bin/phpunit -d date.timezone='America/New_York' -d memory_limit=-1" +# execute the test command +script: + - if [[ $SUITE == "phpunit" ]]; then ./bin/phpunit -d date.timezone='America/New_York' -d memory_limit=-1; fi; + - if [[ $SUITE == "behat" ]]; then ./bin/behat --profile $PROFILE --suite $TEST; fi; # disable mail notifications notification: diff --git a/.travis/behat_before_install.sh b/.travis/behat_before_install.sh new file mode 100755 index 00000000..aa342d15 --- /dev/null +++ b/.travis/behat_before_install.sh @@ -0,0 +1,14 @@ +#!/bin/sh +export BRANCH_BUILD_DIR=$TRAVIS_BUILD_DIR +export TRAVIS_BUILD_DIR="$HOME/build/ezpublish-community" +cd "$HOME/build" + +# Change the branch and/or remote to use a different ezpublish-community branch +git clone --depth 1 --single-branch --branch EZP-23934-remove_legacy_bridge https://github.com/ezsystems/ezpublish-community.git +cd ezpublish-community + +# Use this if you depend on another branch for a dependency (only works for the ezsystems remote) +# (note that packagist may take time to update the references, leading to errors. Just retrigger the build) +#- composer require --no-update dev-MyCustomBranch +./bin/.travis/prepare_system.sh +./bin/.travis/prepare_sahi.sh diff --git a/.travis/behat_before_script.sh b/.travis/behat_before_script.sh new file mode 100755 index 00000000..41fcd462 --- /dev/null +++ b/.travis/behat_before_script.sh @@ -0,0 +1,47 @@ +#!/bin/sh +echo "> Configuring legacy-bridge" + +composer require --no-update "legacy-bridge:dev-master" + +php ./bin/.travis/enablelegacybundle.php + +# Load LegacyBundle routes +echo << EOF >> ezpublish/config/routing.yml + +_ezpublishLegacyRoutes: + resource: '@EzPublishLegacyBundle/Resources/config/routing.yml' + +EOF + +# legacy mode +echo << EOF >> ezpublish/config/ezpublish.yml + +ez_publish_legacy: + system: + behat_site_admin: + legacy_mode: true + +EOF + +# setup firewall rule +echo << EOF >> ezpublish/config/security.yml + + ezpublish_setup: + pattern: ^/ezsetup + security: false + +EOF + +# Enabled eztpl templating engine +sed -i "s/'twig'/'eztpl', 'twig'/" ezpublish/config/config.yml + + +./bin/.travis/prepare_ezpublish.sh + +# Replace legacy-bridge with the one from the pull-request +rm -rf vendor/ezsystems/legacy-bridge +mv "$BRANCH_BUILD_DIR" vendor/ezsystems/legacy-bridge + +# Run setup wizard +php bin/behat --profile setupWizard --suite $INSTALL +php ezpublish/console assetic:dump --env=behat --no-debug diff --git a/.travis/enablelegacybundle.php b/.travis/enablelegacybundle.php new file mode 100755 index 00000000..13629d08 --- /dev/null +++ b/.travis/enablelegacybundle.php @@ -0,0 +1,18 @@ +