.travis.yml 5.42 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.23
  - UPGRADE=7.x-2.22
20
  - UPGRADE=7.x-2.21
21 22 23
  - UPGRADE=7.x-2.20
  - UPGRADE=7.x-2.19
  - UPGRADE=7.x-2.18
24
  - UPGRADE=7.x-2.17
25 26
  - UPGRADE=7.x-2.16
  - UPGRADE=7.x-2.15
27
  - UPGRADE=7.x-2.14
28
  - UPGRADE=7.x-2.13
29 30
  - UPGRADE=7.x-2.12

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

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

47 48 49
install:
  - "mysql -e 'create database drupal;'"

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

  # Drupal.org verify tool
56 57
  - drush dl -y drupalorg_drush-7.x-1.x-dev --destination=$HOME/.drush
  - drush cc drush
58 59 60

  # Build Behat dependencies
  - cd ./tests/behat
Matt Glaman's avatar
Matt Glaman committed
61
  - travis_retry composer install --prefer-dist --no-interaction
62 63
  - cd ../../../

64
  # Setting Behat environment
65 66 67 68
  - 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
69

70 71 72 73 74 75 76
  # Build Codebase
  - mkdir private_files
  - mkdir profiles
  - mv commerce_kickstart profiles/
  - mkdir drupal
  - mv profiles drupal/

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

85 86 87 88
  # 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

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

92
  # Setup files
93
  - chmod -R 777 drupal/sites/all
94 95 96 97 98 99 100

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

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

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

108 109 110 111 112 113 114 115
  # 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
116 117 118 119 120 121 122
  # 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

123 124
before_script:

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


  # 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

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

  # If testing the override, enable it and revert feature it's overriding (because we didn't on the same install.)
  - if [[ "$TEST_FEATURES_OVERRIDES" == 1 ]]; then drush en -y commerce_kickstart_overrides_test && drush fr -y commerce_kickstart_blog; fi

138 139 140
  - cd ../drupal

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

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

script:

150 151 152 153
  # 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.
154 155
  - 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
156 157 158 159

notifications:

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