Skip to:
Content

BuddyPress.org

Ticket #5708: 5708.patch

File 5708.patch, 4.4 KB (added by netweb, 11 years ago)
  • .travis.yml

     
     1# Travis CI Configuration File
     2
     3# Tell Travis CI we're using PHP
    14language: php
    25
     6# PHP version used in first build configuration.
    37php:
    48    - 5.2
    59    - 5.3
     
    610    - 5.4
    711    - 5.5
    812
     13# WordPress versions uses Git 'develop' repo branches
    914env:
    10     - WP_VERSION=trunk
    11     - WP_VERSION=tags/3.9
    12     - WP_VERSION=tags/3.8.3
    13     - WP_VERSION=tags/3.7.3
     15    - WP_VERSION=master # Git equivalent of SVN /trunk
     16    - WP_VERSION=3.9    # Includes latest 3.9.x release
     17    - WP_VERSION=3.8    # Includes latest 3.8.x release
     18    - WP_VERSION=3.7    # Includes latest 3.7.x release
    1419
     20# Build matrix options
    1521matrix:
    1622  include:
    1723    - php: 5.6
    18       env: WP_VERSION=trunk
     24      env: WP_VERSION=master
     25    - php: hhvm
     26      env: WP_VERSION=master
    1927  allow_failures:
    2028    - php: 5.6
     29    - php: hhvm
     30  fast_finish: true
    2131
    22 before_script:
    23     # set up WP install
    24     - WP_CORE_DIR=/tmp/wordpress/
    25     - mkdir -p $WP_CORE_DIR
    26     - svn co --ignore-externals https://develop.svn.wordpress.org/$WP_VERSION $WP_CORE_DIR
    27     - plugin_slug=$(basename $(pwd))
    28     - plugin_dir=$WP_CORE_DIR/src/wp-content/plugins/$plugin_slug
    29     - cd ..
    30     - mv $plugin_slug $plugin_dir
    31     # set up tests config
    32     - cd $WP_CORE_DIR
     32# Before install, failures in this section will result in build status 'errored'
     33before_install:
     34    # setup WP_DEVELOP_DIR (needed for BuddyPress to bootstrap WP PHPUnit tests)
     35    - WP_DEVELOP_DIR=/tmp/wordpress
     36    # clone the WordPress develop repo
     37    - git clone --depth=1 --branch="$WP_VERSION" git://develop.git.wordpress.org/ $WP_DEVELOP_DIR
     38    - mv $TRAVIS_BUILD_DIR /tmp/wordpress/src/wp-content/plugins/buddypress
     39    - cd $WP_DEVELOP_DIR
     40    # setub db
     41    - mysql -e "CREATE DATABASE wordpress_test;" -uroot
     42    # setub wp-config
    3343    - cp wp-tests-config-sample.php wp-tests-config.php
    3444    - sed -i "s/youremptytestdbnamehere/wordpress_test/" wp-tests-config.php
    3545    - sed -i "s/yourusernamehere/root/" wp-tests-config.php
    3646    - sed -i "s/yourpasswordhere//" wp-tests-config.php
    37     # disable WP_DEBUG for PHP 5.5 due to ext/mysqli E_DEPRECATED errors
    38     - if [[ "$TRAVIS_PHP_VERSION" == 5.5* ]] ; then sed -i "s:define( 'WP_DEBUG://define( 'WP_DEBUG:" wp-tests-config.php; fi;
    39     # set up database
    40     - mysql -e 'CREATE DATABASE wordpress_test;' -uroot
    41     # prepare for running the tests
    42     - cd $plugin_dir
     47    # disable WP_DEBUG for PHP 5.5 and WordPress 3.7 branch due to ext/mysqli E_DEPRECATED errors
     48    - if [ "$TRAVIS_PHP_VERSION" == "5.5" ] && [ "$WP_VERSION" == "3.7" ]; then sed -i "s:define( 'WP_DEBUG://define( 'WP_DEBUG:" wp-tests-config.php; fi;
     49    # prepare for running BuddyPress' tests
     50    - BP_DEVELOP_DIR=$WP_DEVELOP_DIR/src/wp-content/plugins/buddypress
     51    - cd $BP_DEVELOP_DIR
     52    # 'build' BuddyPress
    4353    - npm install -g grunt-cli
     54
     55# Before script, failures in this section will result in build status 'failed'
     56before_script:
    4457    - npm install
    4558
    4659script: grunt travis
  • tests/phpunit/includes/define-constants.php

     
    2323if ( false !== getenv( 'WP_TESTS_DIR' ) ) {
    2424        define( 'WP_TESTS_DIR', getenv( 'WP_TESTS_DIR' ) );
    2525        define( 'WP_ROOT_DIR', WP_TESTS_DIR );
    26 } else {
    27         // Support WP_DEVELOP_DIR, as used by some plugins
    28         if ( false !== getenv( 'WP_DEVELOP_DIR' ) ) {
    29                 define( 'WP_ROOT_DIR', getenv( 'WP_DEVELOP_DIR' ) );
    30         } else {
    31                 define( 'WP_ROOT_DIR', dirname( dirname( dirname( dirname( dirname( dirname( dirname( __DIR__ ) ) ) ) ) ) ) );
    32         }
    3326
     27// Support WP_DEVELOP_DIR, as used by some plugins
     28} else if ( false !== getenv( 'WP_DEVELOP_DIR' ) ) {
     29        define( 'WP_ROOT_DIR', getenv( 'WP_DEVELOP_DIR' ) );
    3430        define( 'WP_TESTS_DIR', WP_ROOT_DIR . '/tests/phpunit' );
     31
     32// Support Travis CI build environment
     33} else if ( false !== getenv( 'TRAVIS' ) ) {
     34        define( 'WP_ROOT_DIR', '/tmp/wordpress' );
     35        define( 'WP_TESTS_DIR', WP_ROOT_DIR . '/tests/phpunit' );
     36
     37} else {
     38        define( 'WP_ROOT_DIR', dirname( dirname( dirname( dirname( dirname( dirname( dirname( __DIR__ ) ) ) ) ) ) ) );
     39        define( 'WP_TESTS_DIR', WP_ROOT_DIR . '/tests/phpunit' );
    3540}
    3641
    3742// Based on the tests directory, look for a config file