-
Notifications
You must be signed in to change notification settings - Fork 56
/
.travis.yml
193 lines (162 loc) · 6.23 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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
# Use the new container-based infrastructure (it's faster).
sudo: false
language: php
# dist: trusty
notifications:
email:
on_success: never
on_failure: change
# Configure caches
cache:
apt: true
# cache:
# directories:
# - vendor
# - "$HOME/.composer/cache"
# 5.6 is required for Codeception.
php:
- 5.6
# - 7.0
# Run against regular and multisite.
env:
# - WP_MULTISITE=0 WP_VERSION=latest
# - WP_MULTISITE=1 WP_VERSION=latest
- RUN_WPCEPT=1
# matrix:
# include:
# - php: hhvm
# env: WP_MULTISITE=0
# sudo: required
# dist: trusty
# group: edge
# addons:
# apt:
# packages:
# - mysql-server-5.6
# - mysql-client-core-5.6
# - mysql-client-5.6
# - php: nightly
# env: WP_MULTISITE=0
# allow_failures:
# - php: hhvm
# - php: nightly
# fast_finish: true
# matrix:
# include:
# - php: 7.1
# env: WP_VERSION=latest #WP_MULTISITE=1
# dist: trusty # this enables us to use jdk_switcher
# - php: 5.3 # too old and crash composer dependances
# env: WP_VERSION=latest
# dist: precise # trusty not working with php 5.3
before_script:
# BEFORE:
- |
# if [[ ! -z "$RUN_WPCEPT" ]] ; then
if [ -z "$RUN_WPCEPT" ] ; then # if "$RUN_WPCEPT" string is empty
echo "PREPARE PHPUNIT TESTS"
export PATH="$HOME/.composer/vendor/bin:$PATH"
if [ -f ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini ]; then
phpenv config-rm xdebug.ini
else
echo "xdebug.ini does not exist"
fi
if [[ ! -z "$WP_VERSION" ]] ; then
bash bin/install-wp-tests.sh wordpress_test root '' localhost $WP_VERSION
if [[ ${TRAVIS_PHP_VERSION:0:2} == "5." ]]; then
composer global require "phpunit/phpunit=4.8.*"
else
composer global require "phpunit/phpunit=5.7.*"
fi
fi
if [[ "$WP_TRAVISCI" == "phpcs" ]] ; then
composer global require wp-coding-standards/wpcs
phpcs --config-set installed_paths $HOME/.composer/vendor/wp-coding-standards/wpcs
fi
fi
# - composer install -vvv
# # - composer show
# # - composer info
# # - mysql -e 'create database homestead_test;'
#AFTER:
- |
if [[ "$RUN_WPCEPT" == 1 ]] ; then
echo "PREPARE ACCEPTANCE TESTS"
# Define vars.
export WP_VERSION=master
export WP_DEVELOP_DIR=/tmp/wordpress # php Unit WP installation scripts
export WP_CORE_DIR=/tmp/wordpress/src # installable WordPress folder
export WP_CEPT_SERVER='127.0.0.1:8888'
# Install WordPress
source travis.sh
install-wordpress
# Start up a web server.
php -S "$WP_CEPT_SERVER" -t "$WP_CORE_DIR" >/dev/null 2>&1 &
# Start up the webdriver.
phantomjs --webdriver=4444 >/dev/null 2>&1 &
# Install Codeception and WP Browser.
# Doing this last gives the webdriver and server time to start up.
composer install --prefer-source
# Activate Live Composer plugin.
vendor/bin/wp plugin activate live-composer-page-builder --path="$WP_CORE_DIR/"
# Install and Activate Yoast SEO plugin (used in tests).
vendor/bin/wp plugin install wordpress-seo --activate --path="$WP_CORE_DIR/"
fi
script:
#BEFORE:
# - bash bin/scripts.sh
# - cat /etc/hosts; ip addr show; exit 0
# if [ -z "$string" ]; then
- |
if [ -z "$RUN_WPCEPT" ] ; then # if "$RUN_WPCEPT" string is empty
echo "RUN PHPUNIT TESTS"
if [[ ! -z "$WP_VERSION" ]] ; then
phpunit
WP_MULTISITE=1 phpunit
fi
if [[ "$WP_TRAVISCI" == "phpcs" ]] ; then
phpcs
fi
fi
- |
if [[ "$RUN_WPCEPT" == 1 ]] ; then
echo "RUN ACCEPTANCE TESTS"
vendor/bin/wpcept run --steps --debug -vvv --env travis # --debug -vvv
# php ./vendor/bin/codecept run acceptance --steps && codecept run functional && codecept run # Debug mode: -d output data with this function: codecept_debug($data)
fi
# - whereis google-chrome-stable
# - whereis chromedriver
#33785
# - curl http://127.0.0.1:8888 -S --data status
# - curl http://lc.dev:8888 -S --data status
# - curl http://127.0.0.1:8080 -S --data status
# - curl http://127.0.0.1:8080/wp-login.php -S --data status
# - curl http://127.0.0.1:8080/tmp/wordpress-tests-lib/ -S --data status
# - curl http://127.0.0.1:8080/tmp/wordpress-tests-lib/wp-login.php -S --data status
# - curl http://127.0.0.1:8080/tmp/wordpress/wp-login.php -S --data status
# /home/travis/build/live-composer/live-composer-page-builder/
addons:
artifacts: # https://docs.travis-ci.com/user/uploading-artifacts/
s3_region: "us-west-2" # US West (Oregon)
# working_dir: "/home/travis/build/live-composer/live-composer-page-builder/tests/codeception/_output/"
paths:
- $(ls /home/travis/build/live-composer/live-composer-page-builder/tests/codeception/_output/*.png | tr "\n" ":")
# - $(git ls-files -o | tr "\n" ":")
# - $(ls /var/log/*.log | tr "\n" ":")
# - $HOME/some/other/thing.log
# debug: true
# addons:
# # sauce_connect: # Connecto to Sauce Labs
# # username: livecomposer
# # access_key:
# # secure: "uNd18W5u4nfySwEjXXby24lA34II4d7Q+YTm5q9bnZDnQFsI7OkVScu8V4D8XLlNKZtG5pmqcXaputN0gJJCNKNATvlnXfw4reHFHHbBL1Ko0PiRxiALLIArJaMT1QNMEo/bc1Ok8l2AjoovibEco3zLGmkr5E/1dMHTdyAax0s5bhAbCjhiK++dIwpdbI7z6Pal0DBZ7FqmALrj61So+Iwa6l8ZL+U/Wx9uuIBZB+uZS1GJ061Dp2R+iMfWkpinLJhCr3NsQuIbFEBlgA0eLG/tXjJ9ATsd9hToPtSoxa1a0kbjE1wGApGfdNaFa5bXTe/k9nGmMcZPSEFCTrXXP84pjQ8q+wiz0yI76aDukgxzu5qL41VrqNcbCOYXx9xqtbyoqyrXCKNp6qZD717uQ8AlmbrOWjIxRfO7i2qHYRnHKCKk7sEr9ZcTEZSQFfCBLYmO3hhTqPXWYCPhnXUoAf+exnXL5FKHzHV2IsNOdkTWGYeF3+vQ3xAWQfIvhQvZsVOJy49DXRQ5nyRxWs7K71ggMsbCliZfBpy92gdfYCZrCK/LNqFMW+H+yZvCjELRUxwlLYawGUnjgQwjcD5cXY3Deh0Qu1NPzvZ5WRp872DyiSO5Dx+9ewqhgJAWQC1tbf0eRpqpiNJoQAu12HIoZwrFVLv7wUg6Na9Bhgoam3k="
# chrome: stable # get google-chrome-stable
# # hosts:
# # - lc.dev # create a virtual host/domain.
# install: # Install ChromeDriver (64bits; replace 64 with 32 for 32bits).
# - wget -N http://chromedriver.storage.googleapis.com/2.30/chromedriver_linux64.zip -P ~/
# - unzip ~/chromedriver_linux64.zip -d ~/
# - rm ~/chromedriver_linux64.zip
# - sudo mv -f ~/chromedriver /usr/local/share/
# - sudo chmod +x /usr/local/share/chromedriver
# - sudo ln -s /usr/local/share/chromedriver /usr/local/bin/chromedriver