-
Notifications
You must be signed in to change notification settings - Fork 1
/
circle.yml
48 lines (42 loc) · 2.33 KB
/
circle.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
## Customize the test machine
machine:
timezone:
America/Denver # Set the timezone
# Version of php to use
php:
version: 5.4.21
# Add some environment variables
environment:
CIRCLE_ENV: test
WP_VERSION: 3.8.1
WP_MULTISITE: 0
WP_CORE_DIR: /home/ubuntu/wordpress-develop
WP_TESTS_DIR: /home/ubuntu/wordpress-develop/tests/phpunit
plugin_loc: /home/ubuntu/$CIRCLE_PROJECT_REPONAME
plugin_slug: $CIRCLE_PROJECT_REPONAME
plugin_dir: /home/ubuntu/wordpress-develop/src/wp-content/plugins/$plugin_slug
plugin_tests_dir: /home/ubuntu/wordpress-develop/src/wp-content/plugins/$plugin_slug/tests
event_espresso_core_dir: /home/ubuntu/wordpress-develop/src/wp-content/plugins/event-espresso-core
## Customize dependencies
dependencies:
pre:
#setup WP install
- git clone git://develop.git.wordpress.org/ $WP_CORE_DIR;
- cd $WP_CORE_DIR && cp wp-tests-config-sample.php wp-tests-config.php && sed -i "s/youremptytestdbnamehere/wordpress_test/" wp-tests-config.php && sed -i "s/yourusernamehere/root/" wp-tests-config.php && sed -i "s/yourpasswordhere//" wp-tests-config.php;
# move plugin into tests/src
- mv $plugin_loc $plugin_dir;
#pull in event-espresso-core master branch
#note by using $CIRCLE_BRANCH the addon is being tested against the corresponding branch of event-espresso-core. So development branch of addon will be development branch of core.
- git clone [email protected]:eventespresso/event-espresso-core.git $event_espresso_core_dir;
- cd $event_espresso_core_dir; git checkout $CIRCLE_BRANCH;
# set up database
- mysql -e 'CREATE DATABASE wordpress_test;' -uroot;
# setup phpunit
- wget https://phar.phpunit.de/phpunit.phar && chmod +x phpunit.phar && mv phpunit.phar /home/ubuntu/.phpenv/shims/phpunit
##tests override. Note you'll want to make sure that the addon is tested against all ee core main branches.
test:
override:
- cd $event_espresso_core_dir; git checkout development; cd $plugin_tests_dir; phpunit -d display_errors=On
- cd $event_espresso_core_dir; git checkout alpha; cd $plugin_tests_dir; phpunit -d display_errors=On
- cd $event_espresso-core_dir; git checkout beta; cd $plugin_tests_dir; phpunit -d display_errors=On
- cd $event_espresso_core_dir; git checkout master; cd $plugin_tests_dir; phpunit -d display_errors=On