|
1 | 1 | language: php
|
| 2 | +sudo: false |
2 | 3 |
|
3 | 4 | php:
|
4 |
| - - 5.3 |
| 5 | + - 5.4 |
| 6 | + - 5.5 |
| 7 | + - 5.6 |
5 | 8 |
|
6 | 9 | mysql:
|
7 | 10 | database: message
|
8 | 11 | username: root
|
9 | 12 | encoding: utf8
|
10 | 13 |
|
11 |
| -before_script: |
12 |
| - # navigate out of module directory to prevent blown stack by recursive module |
13 |
| - # lookup |
14 |
| - - cd ../.. |
| 14 | +addons: |
| 15 | + apt: |
| 16 | + packages: |
| 17 | + - php5-cgi |
| 18 | + - php5-mysql |
| 19 | + |
| 20 | +install: |
15 | 21 |
|
16 |
| - # install drush |
17 |
| - - pear channel-discover pear.drush.org |
18 |
| - - pear install drush/drush-5.8.0 |
19 |
| - - phpenv rehash |
| 22 | + # Add composer's global bin directory to the path |
| 23 | + # See: https://github.com/drush-ops/drush#install---composer |
| 24 | + - export PATH="$HOME/.composer/vendor/bin:$PATH" |
20 | 25 |
|
21 |
| - # install php packages required for running a web server from drush on php 5.3 |
22 |
| - - sudo apt-get update > /dev/null |
23 |
| - - sudo apt-get install -y --force-yes php5-cgi php5-mysql |
| 26 | + # Install drush globally |
| 27 | + - composer global require drush/drush:7.0 |
| 28 | + |
| 29 | +before_script: |
| 30 | + # Navigate out of module directory to prevent blown stack by recursive module |
| 31 | + # lookup. |
| 32 | + - cd ../.. |
24 | 33 |
|
25 |
| - # create new site, stubbing sendmail path with true to prevent delivery errors |
| 34 | + # Create new site, stubbing sendmail path with true to prevent delivery errors |
26 | 35 | # and manually resolving drush path
|
27 | 36 | - mysql -e 'create database message'
|
28 |
| - - php -d sendmail_path=`which true` `pear config-get php_dir`/drush/drush.php --yes core-quick-drupal --profile=testing --no-server --db-url=mysql://root:@127.0.0.1/message --enable=simpletest message |
| 37 | + - php -d sendmail_path=`which true` ~/.composer/vendor/bin/drush.php --yes core-quick-drupal --profile=testing --no-server --db-url=mysql://root:@127.0.0.1/message --enable=simpletest message |
29 | 38 |
|
30 |
| - # reference and enable message in build site |
| 39 | + # Reference and enable message in build site. |
31 | 40 | - ln -s $(readlink -e $(cd -)) message/drupal/sites/all/modules/message
|
32 | 41 | - cd message/drupal
|
33 |
| - - drush --yes pm-enable message_example |
| 42 | + - drush dl entity ctools features views token |
| 43 | + - drush --yes pm-enable message message_example |
34 | 44 |
|
35 |
| - # start a web server on port 8080, run in the background; wait for |
36 |
| - # initialization |
37 |
| - - drush runserver 127.0.0.1:8080 & |
38 |
| - - until netstat -an 2>/dev/null | grep '8080.*LISTEN'; do true; done |
| 45 | + # Start a web server on port 8080, run in the background. |
| 46 | + - drush runserver 127.0.0.1:8080 > ~/php-server.log 2>&1 & |
39 | 47 |
|
40 |
| -script: drush test-run Message --uri=http://127.0.0.1:8080 |
| 48 | +script: |
| 49 | + - php scripts/run-tests.sh --php $(which php) --concurrency 4 --verbose --color --url 127.0.0.1:8080 Message 2>&1 | tee /tmp/simpletest-result.txt |
| 50 | + - egrep -i "([1-9]+ fail)|(Fatal error)|([1-9]+ exception)" /tmp/simpletest-result.txt && exit 1 |
| 51 | + - exit 0 |
0 commit comments