forked from jhedstrom/drupalextension
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
99 lines (91 loc) · 4.28 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
language: php
php:
- 5.5
- 5.6
- 7.0
- 7.1
env:
global:
- PATH=$PATH:/home/travis/.composer/vendor/bin
- TRAVIS_NODE_VERSION="4.0.0"
matrix:
- DRUPAL_VERSION=6
- DRUPAL_VERSION=7
- DRUPAL_VERSION=8
matrix:
exclude:
- php: 5.5
env: DRUPAL_VERSION=8
- php: 5.6
env: DRUPAL_VERSION=6
- php: 7.0
env: DRUPAL_VERSION=6
- php: 7.1
env: DRUPAL_VERSION=6
allow_failures:
- php: 7.1
env: DRUPAL_VERSION=7
# Enable Travis containers.
sudo: false
install:
- composer self-update
# For Drupal 8 install the behat drush endpoint.
# Pins symfony/dependency-injection to match core.
# @see https://github.com/jhedstrom/drupalextension/issues/413
# @todo Re-enable behat drush endpoint testing.
# @see https://github.com/jhedstrom/drupalextension/issues/458
- test ${DRUPAL_VERSION} -ne 8 || composer require --prefer-source drush/drush:~9.0 symfony/dependency-injection:3.4.4
- composer install
# Install drush globally.
- (test ${DRUPAL_VERSION} -ne 8 && composer global require drush/drush:~8.0 drupal/drupal-driver) || composer global require drush/drush:~9.0
# Install the Behat Drush Endpoint for Drupal 7 tests.
- test ${DRUPAL_VERSION} -ne 7 || (git clone https://github.com/drush-ops/behat-drush-endpoint.git drush/behat-drush-endpoint && (cd drush/behat-drush-endpoint && composer install && cd -))
# Pin node version.
# @see http://austinpray.com/ops/2015/09/20/change-travis-node-version.html
- rm -rf ~/.nvm && git clone https://github.com/creationix/nvm.git ~/.nvm && (cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`) && source ~/.nvm/nvm.sh && nvm install $TRAVIS_NODE_VERSION
- npm install
before_script:
# Set NODE_PATH for zombie driver.
- export NODE_PATH="`pwd`/node_modules"
# Define the module path according to the Drupal version being tested.
- test ${DRUPAL_VERSION} -ne 8 || export MODULE_PATH="drupal/modules"
- test ${DRUPAL_VERSION} -eq 8 || export MODULE_PATH="drupal/sites/all/modules" && mkdir -p ${MODULE_PATH}
# Set sendmail so drush doesn't throw an error during site install.
- echo "sendmail_path='true'" >> `php --ini | grep "Loaded Configuration" | awk '{print $4}'`
- mysql -e 'create database drupal'
# Download and install Drupal so we can test API abilities.
# For Drush 9, dl is deprecated so we must use composer. However, we still
# cannot simply require drupal/drupal since it hardcodes it's autoloader
# and we'd need to use drupal-scaffold, etc, etc.
- test ${DRUPAL_VERSION} -eq 8 || drush dl --quiet --yes drupal-${DRUPAL_VERSION}.x --all --drupal-project-rename=drupal
- test ${DRUPAL_VERSION} -ne 8 || (mkdir -p tmp && cd tmp && composer require --no-interaction drupal/drupal && cd - && rm -rf drupal && mv tmp/vendor/drupal/drupal ./drupal && cd drupal && composer install && cd - && rm -rf tmp)
- drush --yes --root=$PWD/drupal site-install --db-url=mysql://travis:@127.0.0.1/drupal
# Copy the static HTML that is used for blackbox testing in the web root.
- cp -r fixtures/blackbox $PWD/drupal
# Copy our test module to the correct location.
- cp -r fixtures/drupal${DRUPAL_VERSION}/modules/behat_test ${MODULE_PATH}
- cd drupal
- drush --yes en behat_test
- drush cc drush
# @todo Re-enable behat drush endpoint testing.
# @see https://github.com/jhedstrom/drupalextension/issues/458
- test ${DRUPAL_VERSION} -eq 6 || test ${DRUPAL_VERSION} -eq 8 || (test ${DRUPAL_VERSION} -eq 7 && drush help behat)
# Only revert features on Drupal 7.
- test \! ${DRUPAL_VERSION} -eq 7 || drush --yes fr behat_test
# Disable the page cache on Drupal 8.
- test \! ${DRUPAL_VERSION} -eq 8 || drush --yes pmu page_cache
# Test with big_pipe enabled for Drupal 8.
- test \! ${DRUPAL_VERSION} -eq 8 || drush --yes en -y big_pipe
# Clear the cache on Drupal 6 and 7, rebuild on Drupal 8.
- test ${DRUPAL_VERSION} -eq 8 && drush cr || drush cc all || true
- drush --debug runserver :8888 > ~/debug.txt 2>&1 &
- cd -
- sleep 4s
script:
- composer test
- vendor/bin/behat -fprogress --strict
- vendor/bin/behat -fprogress --profile=drupal${DRUPAL_VERSION} --strict
# Do not test the Drush profile unless Drupal 7 was installed.
- test ${DRUPAL_VERSION} -ne 7 || vendor/bin/behat -fprogress --profile=drush --strict
after_failure:
- cat ~/debug.txt