.travis.yml 5.62 KB
Newer Older
1
language: php
2
sudo: false
3 4 5 6 7

php:
  - 5.4

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
  - UPGRADE=7.x-2.28
  - UPGRADE=7.x-2.27
20 21 22
  - UPGRADE=7.x-2.26
  - UPGRADE=7.x-2.25
  - UPGRADE=7.x-2.24
23 24
  - UPGRADE=7.x-2.23
  - UPGRADE=7.x-2.22
25
  - UPGRADE=7.x-2.21
26 27 28
  - UPGRADE=7.x-2.20
  - UPGRADE=7.x-2.19
  - UPGRADE=7.x-2.18
29
  - UPGRADE=7.x-2.17
30 31
  - UPGRADE=7.x-2.16
  - UPGRADE=7.x-2.15
32
  - UPGRADE=7.x-2.14
33

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

# Cache Composer & Drush directories.
cache:
  directories:
    - $HOME/.composer/cache
    - $HOME/.drush/cache
49

50 51 52
install:
  - "mysql -e 'create database drupal;'"

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

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

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

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

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

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

88 89 90 91
  # 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

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

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

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

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

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

111 112 113 114 115 116 117 118
  # 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

  # 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
119 120 121 122 123 124 125
  # 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

126 127
before_script:

128 129
  # 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
130 131 132 133 134


  # 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

135
  - 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
136
  - drush pm-disable dblog --yes
137 138

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

143 144 145
  - cd ../drupal

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

  # Start server
149
  - drush runserver --server=builtin 8888 > /dev/null 2>&1 &
150
  - nc -zvv localhost 8888; out=$?; while [[ $out -ne 0 ]]; do echo "Retry hit port 8888..."; nc -zvv localhost 8888; out=$?; sleep 5; done
151 152 153 154
  - cd profiles/commerce_kickstart/tests/behat

script:

155 156 157 158
  # 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.
159 160
  - 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
161 162 163 164

notifications:

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