.travis.yml 1.89 KB
Newer Older
1 2
dist: precise
sudo: required
amitaibu's avatar
amitaibu committed
3 4 5
language: php

php:
6
  - 5.6
7
  - 7.3
amitaibu's avatar
amitaibu committed
8 9 10 11 12 13 14

mysql:
  database: drupal
  username: root
  encoding: utf8

before_script:
15
  # Navigate out of module directory to prevent blown stack by recursive module lookup
amitaibu's avatar
amitaibu committed
16 17
  - cd ../..

18
  # Install Drush
19
  - composer global require drush/drush:8
20
  - export PATH=$PATH:~/.composer/vendor/bin
amitaibu's avatar
amitaibu committed
21

22
  # Install php packages required for running Drupal
amitaibu's avatar
amitaibu committed
23
  - sudo apt-get update > /dev/null
24
  - sudo apt-get install -y --force-yes php5-mysql
amitaibu's avatar
amitaibu committed
25

26 27 28 29 30 31
  # Try to avoid MySQL has gone away errors
  - mysql -e "SET GLOBAL wait_timeout = 36000;"
  - mysql -e "SET GLOBAL max_allowed_packet = 134209536;"
  - mysql -e "SHOW VARIABLES LIKE 'max_allowed_packet';"
  - mysql -e "SHOW VARIABLES LIKE 'wait_timeout';"

32
  # Create new site, stubbing sendmail path with true to prevent delivery errors
33
  - mysql -e 'CREATE DATABASE drupal'
Aron Novak's avatar
Aron Novak committed
34 35
  - export PHP_OPTIONS="-d sendmail_path=`which true`"
  - drush --yes core-quick-drupal --core=drupal-7.x --profile=testing --no-server --db-url=mysql://root:@127.0.0.1/drupal --enable=simpletest og
36
  - export DRUPAL_ROOT=og/drupal-7.x
amitaibu's avatar
amitaibu committed
37

38
  # Reference and enable module in build site
39 40
  - ln -s $(readlink -e $(cd -)) $DRUPAL_ROOT/sites/all/modules/og
  - cd $DRUPAL_ROOT
amitaibu's avatar
amitaibu committed
41

42 43
  # Enable OG-UI, so drush will auto-download all dependencies
  - drush --yes pm-enable og_ui
amitaibu's avatar
amitaibu committed
44

45 46 47 48 49 50
  # Create webserver for the Simpletest
  # Mandatory despite the fact that the tests can be
  # executed from CLI!
  - drush runserver 127.0.0.1:8080 &
  - until netstat -an 2>/dev/null | grep '8080.*LISTEN'; do true; done

51
script:
52 53
  - 'php scripts/run-tests.sh --url http://127.0.0.1:8080 --php $(phpenv which php) --concurrency 2 --verbose --color "Organic groups","Organic groups access","Organic groups context","Organic groups field access","Organic groups UI" 2>&1 | tee /tmp/simpletest-result.txt'
  - '! egrep -i "([1-9]+ fail)|(Fatal error)|([1-9]+ exception)" /tmp/simpletest-result.txt'