-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path.travis.yml
67 lines (54 loc) · 2.4 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
language: php
sudo: false
php:
# Use >= 5.4 since it has built-in webserver.
- 5.4
- 5.5
- 5.6
- 7
# @todo Impossible to use HHVM since it will not have "$PHP INI" and tests will be failed every time.
services:
- mysql
matrix:
fast_finish: true
allow_failures:
- php: 7
install:
# Now we are in the directory with repository sources. Go back
# to "vendor" directory, where "commerce" will be located.
- cd ..
# Set environment variables.
- PHPINI="$HOME/.phpenv/versions/$(phpenv version-name)/etc/php.ini"
- DRUPALDIR="$(pwd)/drupal"
- DRUPALHOST="127.0.0.1:1349"
# Populate Composer packages.
- export PATH="$HOME/.composer/vendor/bin:$PATH"
# Install Drush.
- composer global require --prefer-source --no-interaction drush/drush:8.*
# Download Drupal.
- drush dl drupal-7 --drupal-project-rename=$(basename $DRUPALDIR)
# Move "commerce" module to Drupal.
- mv commerce/ $DRUPALDIR/sites/all/modules/
# Disable Sendmail.
- echo sendmail_path=$(which true) >> $PHPINI
# Increase the MySQL connection timeout on the PHP end.
- echo "mysql.connect_timeout=3000" >> $PHPINI
- echo "default_socket_timeout=3000" >> $PHPINI
# Increase the MySQL server timetout and packet size.
- mysql -uroot -e "SET GLOBAL wait_timeout = 36000;"
- mysql -uroot -e "SET GLOBAL max_allowed_packet = 33554432;"
before_script:
- cd $DRUPALDIR
# Install Drupal.
- drush si -y minimal --db-url=mysql://root:@127.0.0.1/drupal --account-name=admin --account-pass=admin [email protected] --site-name=Commerce
# Enabled set of modules.
- drush en -y commerce_cart commerce_customer_ui commerce_product_ui commerce_line_item_ui commerce_order_ui commerce_payment commerce_payment_example commerce_tax_ui simpletest
# Start HTTP server.
- drush runserver $DRUPALHOST > /dev/null 2>&1 &
script:
- php scripts/run-tests.sh --verbose --color --concurrency 4 --php $(which php) --url http://$DRUPALHOST "Drupal Commerce" | tee /tmp/test.txt
# Exit with the inverted value, because if there are no fails found, it will exit with 1 and for us
# that is a good thing so invert it to 0. Travis has some issues with the exclamation mark in front
# so we have to fiddle a bit.
# Also make the grep case insensitive and fail on run-tests.sh regular fails as well on fatal errors.
- exit $(! egrep -i "([1-9]+ fail)|([1-9]+ exception)|(error)" /tmp/test.txt > /dev/null 2>&1) $?