.travis.yml 6.51 KB
Newer Older
1
language: php
2
sudo: false
3 4

php:
5
  - 5.6
6 7

branches:
8 9
  except:
    - 7.x-1.x
10 11 12 13 14 15

mysql:
  database: drupal
  username: root
  encoding: utf8

16 17
env:
  - UPGRADE=none
18
  - UPGRADE=7.x-2.39
19
  - UPGRADE=7.x-2.38
Lars Olesen's avatar
Lars Olesen committed
20 21
  - UPGRADE=7.x-2.37
  - UPGRADE=7.x-2.36
22
  - UPGRADE=7.x-2.35
23 24 25
  - UPGRADE=7.x-2.34
  - UPGRADE=7.x-2.33
  - UPGRADE=7.x-2.32
26 27 28
  - UPGRADE=7.x-2.31
  - UPGRADE=7.x-2.30
  - UPGRADE=7.x-2.29
29 30
  - UPGRADE=7.x-2.28
  - UPGRADE=7.x-2.27
31
  - UPGRADE=7.x-2.26
32

33 34
matrix:
  fast_finish: true
35
  include:
Matt Glaman's avatar
Matt Glaman committed
36 37
    - php: 5.5
      env: UPGRADE=none
38 39
    - php: 5.5
      env: UPGRADE=7.x-2.23 TEST_FEATURES_OVERRIDES=1
40 41 42 43 44 45 46
    - php: 7.0
      env: UPGRADE=none
    - php: hhvm
      env: UPGRADE=none
  allow_failures:
    - php: 7.0
    - php: hhvm
Matt Glaman's avatar
Matt Glaman committed
47 48 49 50 51 52

# Cache Composer & Drush directories.
cache:
  directories:
    - $HOME/.composer/cache
    - $HOME/.drush/cache
53
    - tests/behat/vendor
54

55
install:
56 57 58 59
  # Remove xdebug for the moment. We aren't generating code coverage, and it slows us down.
  - rm /home/travis/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini

  # Create database.
60 61
  - "mysql -e 'create database drupal;'"

62
  # Install latest Drush 6.
Matt Glaman's avatar
Matt Glaman committed
63 64
  - travis_retry composer self-update && composer --version
  - travis_retry composer global require "drush/drush:6.*"
65
  - export PATH="$HOME/.composer/vendor/bin:$PATH"
Matt Glaman's avatar
Matt Glaman committed
66 67

  # Drupal.org verify tool
68 69
  - drush dl -y drupalorg_drush-7.x-1.x-dev --destination=$HOME/.drush
  - drush cc drush
70 71 72

  # Build Behat dependencies
  - cd ./tests/behat
Matt Glaman's avatar
Matt Glaman committed
73
  - travis_retry composer install --prefer-dist --no-interaction
74 75
  - cd ../../../

76
  # Setting Behat environment
77 78 79 80
  - BUILD_TOP=`dirname $TRAVIS_BUILD_DIR`
  - BEHAT_PARAMS='{"extensions":{"Drupal\\DrupalExtension":{"drupal":{"drupal_root":"BUILD_TOP/drupal"}}}}'
  - BEHAT_PARAMS=`echo $BEHAT_PARAMS | sed -e s#BUILD_TOP#$BUILD_TOP#`
  - export BEHAT_PARAMS
81

82 83 84 85 86 87 88
  # Build Codebase
  - mkdir private_files
  - mkdir profiles
  - mv commerce_kickstart profiles/
  - mkdir drupal
  - mv profiles drupal/

89
  # Build the current branch
90
  - cd drupal
91 92
  - drush make --yes profiles/commerce_kickstart/drupal-org-core.make --prepare-install
  - drush make --yes profiles/commerce_kickstart/drupal-org.make --no-core --contrib-destination=profiles/commerce_kickstart
93 94
  # Download Diff module for checking overridden features through Drush.
  - drush dl diff
95 96
  - cd ../

97 98 99 100
  # Verify that all the .make files will work on Drupal.org.
  - drush verify-makefile drupal/profiles/commerce_kickstart/drupal-org.make
  - find drupal/profiles/commerce_kickstart/modules -name \*.make -print0 | xargs -0 -n1 drush verify-makefile

101 102 103
  # Download an old version to test upgrading from.
  - if [[ "$UPGRADE" != none ]]; then drush dl commerce_kickstart-$UPGRADE; fi

104
  # Setup files
105
  - chmod -R 777 drupal/sites/all
106 107 108 109 110 111 112

  # Setup display for Selenium
  - export DISPLAY=:99.0
  - sh -e /etc/init.d/xvfb start
  - sleep 5

  # Get Selenium
113 114
  - wget http://selenium-release.storage.googleapis.com/2.42/selenium-server-standalone-2.42.1.jar
  - java -jar selenium-server-standalone-2.42.1.jar > /dev/null 2>&1 &
115
  - nc -zvv localhost 4444; out=$?; while [[ $out -ne 0 ]]; do echo "Retry hit port 4444..."; nc -zvv localhost 4444; out=$?; sleep 5; done
116

117 118 119
   # Disable sendmail
  - echo sendmail_path=`which true` >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini

120 121 122 123
  # Increase the MySQL connection timeout on the PHP end.
  - echo "mysql.connect_timeout=3000" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
  - echo "default_socket_timeout=3000" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini

124 125 126 127
  # Multibyte string input conversion in PHP is active and must be disabled for Drupal on PHP 5.6.
  - echo "mbstring.http_input = pass" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
  - echo "mbstring.http_output = pass" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini

128 129 130 131
  # Increase the MySQL server timetout and packet size.
  - mysql -e "SET GLOBAL wait_timeout = 36000;"
  - mysql -e "SET GLOBAL max_allowed_packet = 33554432;"

Matt Glaman's avatar
Matt Glaman committed
132 133 134 135 136 137 138
  # Enable APC
  - |
    if [[ $TRAVIS_PHP_VERSION < "5.5" ]]; then
      echo "extension=apc.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
      echo "apc.shm_size=256M" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
    fi

139 140
before_script:

141 142
  # Do the site install (either the current revision or old for the upgrade).
  - if [[ "$UPGRADE" == none ]]; then cd drupal; else cd commerce_kickstart-$UPGRADE; fi
143 144 145 146 147


  # Copy override module into sites/default/modules so it carries over when testing upgrades.
  - if [[ "$TEST_FEATURES_OVERRIDES" == 1 ]]; then mkdir sites/default/modules && cp -r ../drupal/profiles/commerce_kickstart/tests/commerce_kickstart_overrides_test sites/default/modules/commerce_kickstart_overrides_test; fi

148
  - drush si commerce_kickstart --db-url=mysql://root:@127.0.0.1/drupal --account-name=admin --account-pass=admin --site-mail=admin@example.com --site-name="Commerce Kickstart" --yes
149
  - drush pm-disable dblog --yes
150 151

  # If testing the override, enable it and revert feature it's overriding (because we didn't on the same install.)
152 153 154
  # We need to download rc2, because rc3 requires a function in Features 2.7,
  # breaking test.
  - if [[ "$TEST_FEATURES_OVERRIDES" == 1 ]]; then drush dl features_override-7.x-2.0-rc2 && drush en -y commerce_kickstart_overrides_test && drush fr -y commerce_kickstart_blog; fi
155

156 157 158
  - cd ../drupal

  # If we're an upgrade test, run the upgrade process.
159
  - if [[ "$UPGRADE" != none ]]; then cp -a ../commerce_kickstart-$UPGRADE/sites/default/* sites/default/ && drush updb --yes; drush cc all;  fi
160 161

  # Start server
162
  - drush runserver --server=builtin 8888 > /dev/null 2>&1 &
163
  - nc -zvv localhost 8888; out=$?; while [[ $out -ne 0 ]]; do echo "Retry hit port 8888..."; nc -zvv localhost 8888; out=$?; sleep 5; done
164 165 166 167
  - cd profiles/commerce_kickstart/tests/behat

script:

168 169 170
  # If this isn't an upgrade, we test if any features are overridden.
  - if [[ "$UPGRADE" == none ]]; then ../../scripts/check-overridden.sh; fi

171 172 173
  # Fix bad Commerce Migrate release for testing the demo.
  - if [[ "$UPGRADE" == "7.x-2.34" || "$UPGRADE" == "7.x-2.33" || "$UPGRADE" == "7.x-2.32" || "$UPGRADE" == "7.x-2.31" || "$UPGRADE" == "7.x-2.30" || "$UPGRADE" == "7.x-2.29" || "$UPGRADE" == "7.x-2.28" || "$UPGRADE" == "7.x-2.27" ]]; then drush mi --all --update; fi

174
  # Run Behat tests.
175 176
  - if [[ "$TEST_FEATURES_OVERRIDES" != 1 ]]; then ./bin/behat --config behat.travis.yml --tags ~@overrides; fi
  - if [[ "$TEST_FEATURES_OVERRIDES" == 1 ]]; then ./bin/behat --config behat.travis.yml --tags @overrides; fi
177 178 179 180

notifications:

  irc: "chat.freenode.net#drupal-commerce"