forked from eventespresso/event-espresso-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
circle.yml
44 lines (38 loc) · 1.8 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
## 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_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
## Customize dependencies
dependencies:
pre:
#enable xdebug. LINE 1/2 to uncomment if you want to run a code coverage report.
# - sed -i 's/^;//' ~/.phpenv/versions/$(phpenv global)/etc/conf.d/xdebug.ini
#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;
# set up database
- mysql -e 'CREATE DATABASE wordpress_test;' -uroot;
# setup phpunit
- wget --no-check-certificate https://phar.phpunit.de/phpunit-old.phar && chmod +x phpunit-old.phar && mv phpunit-old.phar /home/ubuntu/.phpenv/shims/phpunit
##tests override
test:
override:
# comment out the below line to run a code coverage report.
- cd $plugin_tests_dir; phpunit --log-junit $CIRCLE_TEST_REPORTS/phpunit/junit.xml
## LINE 2/2 to uncomment if you want to run a code coverage report.
# - cd $plugin_tests_dir; phpunit --coverage-html $CIRCLE_ARTIFACTS