.travis.yml 5.95 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 19 20
  - UPGRADE=7.x-2.34
  - UPGRADE=7.x-2.33
  - UPGRADE=7.x-2.32
21 22 23
  - UPGRADE=7.x-2.31
  - UPGRADE=7.x-2.30
  - UPGRADE=7.x-2.29
24 25
  - UPGRADE=7.x-2.28
  - UPGRADE=7.x-2.27
26 27 28
  - UPGRADE=7.x-2.26
  - UPGRADE=7.x-2.25
  - UPGRADE=7.x-2.24
29 30
  - UPGRADE=7.x-2.23
  - UPGRADE=7.x-2.22
31
  - UPGRADE=7.x-2.21
32 33 34
  - UPGRADE=7.x-2.20
  - UPGRADE=7.x-2.19
  - UPGRADE=7.x-2.18
35
  - UPGRADE=7.x-2.17
36

37 38
matrix:
  fast_finish: true
39
  include:
Matt Glaman's avatar
Matt Glaman committed
40 41
    - php: 5.5
      env: UPGRADE=none
42 43
    - php: 5.5
      env: UPGRADE=7.x-2.23 TEST_FEATURES_OVERRIDES=1
Matt Glaman's avatar
Matt Glaman committed
44 45 46 47 48 49

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

52 53 54
install:
  - "mysql -e 'create database drupal;'"

55
  # Install latest Drush 6.
Matt Glaman's avatar
Matt Glaman committed
56 57
  - travis_retry composer self-update && composer --version
  - travis_retry composer global require "drush/drush:6.*"
58
  - export PATH="$HOME/.composer/vendor/bin:$PATH"
Matt Glaman's avatar
Matt Glaman committed
59 60

  # Drupal.org verify tool
61 62
  - drush dl -y drupalorg_drush-7.x-1.x-dev --destination=$HOME/.drush
  - drush cc drush
63 64 65

  # Build Behat dependencies
  - cd ./tests/behat
Matt Glaman's avatar
Matt Glaman committed
66
  - travis_retry composer install --prefer-dist --no-interaction
67 68
  - cd ../../../

69
  # Setting Behat environment
70 71 72 73
  - 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
74

75 76 77 78 79 80 81
  # Build Codebase
  - mkdir private_files
  - mkdir profiles
  - mv commerce_kickstart profiles/
  - mkdir drupal
  - mv profiles drupal/

82
  # Build the current branch
83
  - cd drupal
84 85
  - 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
86 87
  # Download Diff module for checking overridden features through Drush.
  - drush dl diff
88 89
  - cd ../

90 91 92 93
  # 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

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

97
  # Setup files
98
  - chmod -R 777 drupal/sites/all
99 100 101 102 103 104 105

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

  # Get Selenium
106 107
  - 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 &
108
  - nc -zvv localhost 4444; out=$?; while [[ $out -ne 0 ]]; do echo "Retry hit port 4444..."; nc -zvv localhost 4444; out=$?; sleep 5; done
109

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

113 114 115 116
  # 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

117 118 119 120
  # 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

121 122 123 124
  # 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
125 126 127 128 129 130 131
  # 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

132 133
before_script:

134 135
  # 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
136 137 138 139 140


  # 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

141
  - 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
142
  - drush pm-disable dblog --yes
143 144

  # If testing the override, enable it and revert feature it's overriding (because we didn't on the same install.)
145 146 147
  # 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
148

149 150 151
  - cd ../drupal

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

  # Start server
155
  - drush runserver --server=builtin 8888 > /dev/null 2>&1 &
156
  - nc -zvv localhost 8888; out=$?; while [[ $out -ne 0 ]]; do echo "Retry hit port 8888..."; nc -zvv localhost 8888; out=$?; sleep 5; done
157 158 159 160
  - cd profiles/commerce_kickstart/tests/behat

script:

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

  # Run Behat tests.
165 166
  - 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
167 168 169 170

notifications:

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