Make WordPress Core


Ignore:
Timestamp:
11/10/2014 02:48:28 PM (12 years ago)
Author:
boonebgorges
Message:

Exclude external-http tests when running phpunit.

The external-http tests are very slow, and Wp_Http functionality is fairly
isolated, so the benefits of skipping these tests by default outweigh the
risks.

A grunt phpunit:external-http subtask has been added, to ensure that the
tests are executed during exhaustive runs of the test suite, such as in
continuous integration.

Fixes #30304.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/includes/bootstrap.php

    r30286 r30298  
    129129                }
    130130
    131                 $ajax_message = true;
    132                 $ms_files_message = true;
     131                $skipped_groups = array(
     132                        'ajax' => true,
     133                        'ms-files' => true,
     134                        'external-http' => true,
     135                );
     136
    133137                foreach ( $options as $option ) {
    134138                        switch ( $option[0] ) {
    135139                                case '--exclude-group' :
    136                                         $ajax_message = false;
    137                                         $ms_files_message = false;
     140                                        foreach ( $skipped_groups as $group_name => $skipped ) {
     141                                                $skipped_groups[ $group_name ] = false;
     142                                        }
    138143                                        continue 2;
    139144                                case '--group' :
    … …  
    144149                                                }
    145150                                        }
    146                                         $ajax_message = ! in_array( 'ajax', $groups );
    147                                         $ms_files_message = ! in_array( 'ms-files', $groups );
     151
     152                                        foreach ( $skipped_groups as $group_name => $skipped ) {
     153                                                if ( in_array( $group_name, $groups ) ) {
     154                                                        $skipped_groups[ $group_name ] = false;
     155                                                }
     156                                        }
    148157                                        continue 2;
    149158                        }
    150159                }
    151                 if ( $ajax_message ) {
    152                         echo "Not running ajax tests... To execute these, use --group ajax." . PHP_EOL;
    153                 }
    154                 if ( $ms_files_message ) {
    155                         echo "Not running ms_files_rewriting tests... To execute these, use --group ms-files." . PHP_EOL;
     160
     161                $skipped_groups = array_filter( $skipped_groups );
     162                foreach ( $skipped_groups as $group_name => $skipped ) {
     163                        echo sprintf( 'Not running %1$s tests. To execute these, use --group %1$s.', $group_name ) . PHP_EOL;
    156164                }
    157165    }
Note: See TracChangeset for help on using the changeset viewer.