-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
122 lines (101 loc) · 4.21 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
sudo: required
dist: trusty
language: php
cache:
bundler: true
apt: true
directories:
- "$HOME/.composer/cache"
- "$HOME/.drush/cache"
- "$HOME/.npm"
php:
- 7.0
env:
- VERSION=STABLE TEST_TAGS=panopoly
- VERSION=HEAD TEST_TAGS=panopoly
- VERSION=SUBPROFILE TEST_TAGS=~search
addons:
apt:
packages:
# Dependencies for Chrome.
- libappindicator1
- fonts-liberation
before_install:
- phpenv config-rm xdebug.ini
- composer self-update
- composer --version
# Initialize xvfb (see https://docs.travis-ci.com/user/gui-and-headless-browsers)
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- sleep 3
# Download Chrome Driver
- LATEST_CHROMEDRIVER=$(wget -q -O - http://chromedriver.storage.googleapis.com/LATEST_RELEASE)
- wget http://chromedriver.storage.googleapis.com/$LATEST_CHROMEDRIVER/chromedriver_linux64.zip
- unzip chromedriver_linux64.zip
- chmod +x chromedriver
- mkdir -p $HOME/.composer/vendor/bin
- mv -f chromedriver $HOME/.composer/vendor/bin/
- rm chromedriver_linux64.zip
# Update Chrome.
- export CHROME_BIN=/usr/bin/google-chrome
- wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
- sudo dpkg -i google-chrome-stable_current_amd64.deb
- rm google-chrome-stable_current_amd64.deb
- google-chrome --version
install:
# Add Composer's local bin directory to the PATH so that we will be running
# our installed versions of Drush, PHPCS, Behat, PhantomJS, etc.
- export PATH="$HOME/.composer/vendor/bin:$TRAVIS_BUILD_DIR/bin:$PATH"
# Create the MySQL database and add a user for testing.
- mysql -u root -e "CREATE DATABASE drupal; CREATE USER 'panopoly'@'localhost' IDENTIFIED BY 'panopoly'; GRANT ALL ON drupal.* TO 'panopoly'@'localhost';"
# PHP conf tweaks
- echo 'max_execution_time = 120' >> drupal.php.ini;
- echo 'sendmail_path = /bin/true' >> drupal.php.ini;
- phpenv config-add drupal.php.ini
- phpenv rehash
# Add Devel, which is a dependency of Lightning Dev, to the codebase
- composer require drupal/devel --no-update
# Build the Lightning code base.
- composer install
# Install Lightning.
- cd docroot
- drush site-install panopoly --yes --account-pass=admin --db-url=mysql://panopoly:[email protected]/drupal
- drush config-set system.logging error_level all --yes
# Create custom sub-profile, install it, and download custom tests.
- 'if [ $VERSION = "SUBPROFILE" ]; then
cd ..;
composer require drupal/paragraphs;
./bin/drupal panopoly:subprofile --no-interaction --name="Panopoly Extender" --machine-name=subprofile --include=paragraphs --exclude=panopoly_search;
mkdir -p ./tests/features;
chmod +w ./docroot/sites/default/settings.php;
cd docroot;
drush site-install subprofile --yes --account-pass=admin --db-url=mysql://panopoly:[email protected]/drupal;
fi;'
# Update codebase to head and run db updates.
- 'if [ $VERSION = "HEAD" ]; then
cd ..;
rm -rf docroot/modules/contrib && rm -rf docroot/profiles/contrib/panopoly && rm -rf vendor && rm composer.lock;
composer require panopoly/panopoly:dev-8.x-2.x --no-update;
composer update;
cd docroot;
drush updatedb -y;
fi;'
# Enable the dev module which performs any manual update steps.
- drush pm-enable panopoly_dev --yes
# Generate the behat config.
- cd ../
- ./bin/drupal behat:init http://127.0.0.1:8080 --merge=../docroot/profiles/contrib/panopoly/tests/behat.yml
- ./bin/drupal behat:include ../docroot/profiles/contrib/panopoly/tests/features --with-subcontexts=../docroot/profiles/contrib/panopoly/tests/features/bootstrap --with-subcontexts=../docroot/profiles/contrib/panopoly/src/LightningExtension/Context
- if [ $VERSION = "SUBPROFILE" ]; then ./bin/drupal behat:include ../tests/features; fi;
- cd ./docroot
before_script:
- drush runserver --default-server=builtin 8080 &>/dev/null &
# Start Selenium and dump its ginormous log into a temporary file.
- jdk_switcher use oraclejdk8
- mkdir tmp
- selenium-server-standalone -port 4444 -log tmp/selenium2.log &
- sleep 5
script:
- ../bin/behat --strict --stop-on-failure --config ./sites/default/files/behat.yml --tags=${TEST_TAGS}
matrix:
fast_finish: true