From 670145aedfda9d3d1e946fecec2eb34b82357160 Mon Sep 17 00:00:00 2001 From: Bertrand Dunogier Date: Sat, 7 Feb 2015 16:38:17 +0100 Subject: [PATCH 1/4] BDD attempt 1 --- .travis.yml | 34 ++++++++++++++++++------------- .travis/behat_before_install.sh | 14 +++++++++++++ .travis/behat_before_script.sh | 13 ++++++++++++ .travis/phpunit_before_install.sh | 5 +++++ 4 files changed, 52 insertions(+), 14 deletions(-) create mode 100644 .travis/behat_before_install.sh create mode 100644 .travis/behat_before_script.sh create mode 100644 .travis/phpunit_before_install.sh diff --git a/.travis.yml b/.travis.yml index a5601061..87caf0f8 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 # disable mail notifications notification: diff --git a/.travis/behat_before_install.sh b/.travis/behat_before_install.sh new file mode 100644 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 100644 index 00000000..3bbc6f82 --- /dev/null +++ b/.travis/behat_before_script.sh @@ -0,0 +1,13 @@ +#!/bin/sh +echo "> Require legacy-bridge" +composer require legacy-bridge:dev-master + +./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/phpunit_before_install.sh b/.travis/phpunit_before_install.sh new file mode 100644 index 00000000..dd1e13c8 --- /dev/null +++ b/.travis/phpunit_before_install.sh @@ -0,0 +1,5 @@ +#!/bin/sh +# Install packages using composer +composer install --dev --prefer-dist +# Copy default test configuration +cp config.php-DEVELOPMENT config.php From efb349f21f9b16c091a553c6220cc7eec8212ad2 Mon Sep 17 00:00:00 2001 From: Bertrand Dunogier Date: Sat, 7 Feb 2015 17:10:57 +0100 Subject: [PATCH 2/4] BDD attempt 2 --- .travis.yml | 12 +++++------ .travis/behat_before_script.sh | 38 ++++++++++++++++++++++++++++++++-- .travis/enablelegacybundle.php | 18 ++++++++++++++++ 3 files changed, 60 insertions(+), 8 deletions(-) create mode 100644 .travis/enablelegacybundle.php diff --git a/.travis.yml b/.travis.yml index 87caf0f8..95b15e71 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,18 +20,18 @@ branches: before_install: # Setup github key to avoid api rate limit - ./composer_install_github_key.sh - - if [ $SUITE == "phpunit" ]; then ./.travis/phpunit_before_install.sh; fi - - if [ $SUITE == "behat" ]; then ./travis/behat_before_install.sh; fi + - 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 + - if [[ $SUITE == "phpunit" ]]; then ./.travis/phpunit_before_script.sh; fi + - if [[ $SUITE == "behat" ]]; then ./.travis/behat_before_script.sh; fi # 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 + - 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 # disable mail notifications notification: diff --git a/.travis/behat_before_script.sh b/.travis/behat_before_script.sh index 3bbc6f82..41fcd462 100644 --- a/.travis/behat_before_script.sh +++ b/.travis/behat_before_script.sh @@ -1,6 +1,40 @@ #!/bin/sh -echo "> Require legacy-bridge" -composer require legacy-bridge:dev-master +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 diff --git a/.travis/enablelegacybundle.php b/.travis/enablelegacybundle.php new file mode 100644 index 00000000..13629d08 --- /dev/null +++ b/.travis/enablelegacybundle.php @@ -0,0 +1,18 @@ + Date: Sat, 7 Feb 2015 17:13:39 +0100 Subject: [PATCH 3/4] BDD attempt 3 --- .travis/behat_before_install.sh | 0 .travis/behat_before_script.sh | 0 .travis/enablelegacybundle.php | 0 .travis/phpunit_before_install.sh | 0 4 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 .travis/behat_before_install.sh mode change 100644 => 100755 .travis/behat_before_script.sh mode change 100644 => 100755 .travis/enablelegacybundle.php mode change 100644 => 100755 .travis/phpunit_before_install.sh diff --git a/.travis/behat_before_install.sh b/.travis/behat_before_install.sh old mode 100644 new mode 100755 diff --git a/.travis/behat_before_script.sh b/.travis/behat_before_script.sh old mode 100644 new mode 100755 diff --git a/.travis/enablelegacybundle.php b/.travis/enablelegacybundle.php old mode 100644 new mode 100755 diff --git a/.travis/phpunit_before_install.sh b/.travis/phpunit_before_install.sh old mode 100644 new mode 100755 From f33e1d35a5a957e9077cde25bda74cc778d8d78b Mon Sep 17 00:00:00 2001 From: Bertrand Dunogier Date: Sat, 7 Feb 2015 17:16:36 +0100 Subject: [PATCH 4/4] BDD attempt 4 --- .travis.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 95b15e71..2c1cf3b0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,18 +20,18 @@ branches: before_install: # Setup github key to avoid api rate limit - ./composer_install_github_key.sh - - if [[ $SUITE == "phpunit" ]]; then ./.travis/phpunit_before_install.sh; fi - - if [[ $SUITE == "behat" ]]; then ./travis/behat_before_install.sh; fi + - 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 + - if [[ $SUITE == "phpunit" ]]; then ./.travis/phpunit_before_script.sh; fi; + - if [[ $SUITE == "behat" ]]; then ./.travis/behat_before_script.sh; fi; # 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 + - 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: