WordPress.org

Make WordPress Core

Changeset 924 in tests


Ignore:
Timestamp:
07/19/12 18:18:12 (21 months ago)
Author:
nacin
Message:

By default, do not execute the ajax tests. They are slow due to the requirement that they run in a separate process for DOING_AJAX reasons.

As they will be run separately, stop running ajax tests in a separate process. The exception is autosave, which has DOING_AUTOSAVE.

When the full test suite is run as plain phpunit, add a message to remind the developer that ajax was not run.

see #49, see #42.

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/bootstrap.php

    r918 r924  
    100100            array_keys( $this->longOptions ) 
    101101        ); 
     102        if ( empty( $options[0] ) ) { 
     103            register_shutdown_function( array( __CLASS__, 'ajaxTestsWereNotRun' ) ); 
     104            return; 
     105        } 
    102106        foreach ( $options[0] as $option ) { 
    103107            if ( $option[0] !== '--group' ) 
     
    110114        } 
    111115    } 
     116 
     117    static function ajaxTestsWereNotRun() { 
     118        echo PHP_EOL . 'By default, Ajax tests are not run. To execute these, use `phpunit --group ajax`' . PHP_EOL; 
     119    } 
    112120} 
    113121new WP_PHPUnit_TextUI_Command( $_SERVER['argv'] ); 
  • trunk/phpunit.xml

    r905 r924  
    1010            <directory suffix=".php">tests</directory> 
    1111            <file phpVersion="5.3.0">tests/actions/closures.php</file> 
     12            <groups> 
     13                <exclude> 
     14                    <group>ajax</group> 
     15                </exclude> 
     16            </groups> 
    1217        </testsuite> 
    1318    </testsuites> 
  • trunk/tests/ajax/DeleteComment.php

    r904 r924  
    1313 * @since      3.4.0 
    1414 * @group      ajax 
    15  * @runTestsInSeparateProcesses 
    1615 */ 
    1716class Tests_Ajax_DeleteComment extends WP_Ajax_UnitTestCase { 
  • trunk/tests/ajax/DimComment.php

    r904 r924  
    1313 * @since      3.4.0 
    1414 * @group      ajax 
    15  * @runTestsInSeparateProcesses 
    1615 */ 
    1716class Tests_Ajax_DimComment extends WP_Ajax_UnitTestCase { 
  • trunk/tests/ajax/EditComment.php

    r909 r924  
    1313 * @since      3.4.0 
    1414 * @group      ajax 
    15  * @runTestsInSeparateProcesses 
    1615 */ 
    1716class Tests_Ajax_EditComment extends WP_Ajax_UnitTestCase { 
  • trunk/tests/ajax/GetComments.php

    r904 r924  
    1313 * @since      3.4.0 
    1414 * @group      ajax 
    15  * @runTestsInSeparateProcesses 
    1615 */ 
    1716class Tests_Ajax_GetComments extends WP_Ajax_UnitTestCase { 
  • trunk/tests/ajax/ReplytoComment.php

    r904 r924  
    1313 * @since      3.4.0 
    1414 * @group      ajax 
    15  * @runTestsInSeparateProcesses 
    1615 */ 
    1716class Tests_Ajax_ReplytoComment extends WP_Ajax_UnitTestCase { 
  • trunk/tests/ajax/TagSearch.php

    r904 r924  
    1313 * @since      3.4.0 
    1414 * @group      ajax 
    15  * @runTestsInSeparateProcesses 
    1615 */ 
    1716class Tests_Ajax_TagSearch extends WP_Ajax_UnitTestCase { 
Note: See TracChangeset for help on using the changeset viewer.