-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
executable file
·86 lines (75 loc) · 3.45 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
language: php
php:
- 7.2
env:
global:
- SIMPLETEST_DB=sqlite://tmp/site.sqlite
- SIMPLETEST_BASE_URL="http://127.0.0.1:8080"
- COMPOSER_MEMORY_LIMIT=-1
matrix:
- RELEASE=stable COMPOSER_CHANNEL=stable
# - RELEASE=stable COMPOSER_CHANNEL=snapshot
services:
- memcached
before_install:
# add extension for memcache
- echo "extension = memcached.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
# increase memorry limit
- echo "memory_limit=3G" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
# setup sendmail path
- echo 'sendmail_path = /bin/true' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
# disable xdebug
- phpenv config-rm xdebug.ini
# update and upgrade apt-get
- sudo apt purge "mysql-server-*"
- sudo apt-get update
- npm update
- npm install -g n
- sudo -E env "PATH=$PATH" n stable
- php -ini | grep memory_limit
#- sudo n stable
# update composer
- composer clear-cache
- composer --verbose self-update --$COMPOSER_CHANNEL
- composer --verbose self-update --rollback --$COMPOSER_CHANNEL
- composer --version
install:
# remove duplicates
- if [ -d "vendor" ]; then rm -Rf vendor; fi
- if [ -d "html" ]; then rm -Rf html; fi
- if [ -d "scripts" ]; then rm -Rf scripts; fi
# composer create project
- composer --verbose validate
- composer --verbose create-project opengov/opengov-project:dev-master opengov-project --prefer-dist --no-interaction
# install site
- cd $TRAVIS_BUILD_DIR/opengov-project/html
- ./../vendor/bin/drush site-install og --verbose --yes --db-url=sqlite://tmp/site.sqlite --site-name 'Open Government' --account-name test --account-pass test
script:
# clear cache
- ./../vendor/bin/drush cr
# turn css/javascript aggregation off
- ./../vendor/bin/drush -y config-set system.performance css.preprocess 0
- ./../vendor/bin/drush -y config-set system.performance js.preprocess 0
# check response
- ./../vendor/bin/drush runserver $SIMPLETEST_BASE_URL &
- until curl -s $SIMPLETEST_BASE_URL; do true; done > /dev/null
# setup nightwatch to execute tests
- npm install -g [email protected]
#- npm update -g nightwatch
- cd $TRAVIS_BUILD_DIR/tests/bin
- wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
- sudo dpkg -i google-chrome*.deb
- google-chrome --version
- cd $TRAVIS_BUILD_DIR/tests
- sudo chmod -R 777 bin
# execute tests
- sudo /home/travis/.nvm/versions/node/v8.12.0/lib/node_modules/nightwatch/bin/nightwatch tests/basic/homepageTest.js
- sudo /home/travis/.nvm/versions/node/v8.12.0/lib/node_modules/nightwatch/bin/nightwatch tests/Functional/basicPageTest.js
- sudo /home/travis/.nvm/versions/node/v8.12.0/lib/node_modules/nightwatch/bin/nightwatch tests/Functional/blockTest.js
- sudo /home/travis/.nvm/versions/node/v8.12.0/lib/node_modules/nightwatch/bin/nightwatch tests/Functional/blogTest.js
- sudo /home/travis/.nvm/versions/node/v8.12.0/lib/node_modules/nightwatch/bin/nightwatch tests/Functional/webformsTest.js
# The tests below do not currently work with travis due to certain HTML elements not being generated
#- sudo /home/travis/.nvm/versions/node/v8.12.0/lib/node_modules/nightwatch/bin/nightwatch tests/Functional/commentTest.js
#- sudo /home/travis/.nvm/versions/node/v8.12.0/lib/node_modules/nightwatch/bin/nightwatch tests/Functional/votingTest.js
- cd $TRAVIS_BUILD_DIR/opengov-project/html
- ./../vendor/bin/drush watchdog-show