Ticket #55668: 55668.diff
| File 55668.diff, 4.4 KB (added by , 4 years ago) |
|---|
-
docker-compose.yml
41 41 - LOCAL_PHP_MEMCACHED=${LOCAL_PHP_MEMCACHED-false} 42 42 - PHP_FPM_UID=${PHP_FPM_UID-1000} 43 43 - PHP_FPM_GID=${PHP_FPM_GID-1000} 44 - GITHUB_REF=${GITHUB_REF-false} 45 - GITHUB_EVENT_NAME=${GITHUB_EVENT_NAME-false} 44 46 45 47 volumes: 46 48 - ./tools/local-env/php-config.ini:/usr/local/etc/php/conf.d/php-config.ini -
tests/phpunit/includes/abstract-testcase.php
202 202 /** 203 203 * Allows tests to be skipped on some automated runs. 204 204 * 205 * For test runs on GitHub Actions for something other than trunk /master,206 * we want to skip tests that only need to run for master.205 * For test runs on GitHub Actions for something other than trunk, 206 * we want to skip tests that only need to run for trunk. 207 207 */ 208 208 public function skipOnAutomatedBranches() { 209 209 // https://docs.github.com/en/free-pro-team@latest/actions/reference/environment-variables#default-environment-variables … … 210 210 $github_event_name = getenv( 'GITHUB_EVENT_NAME' ); 211 211 $github_ref = getenv( 'GITHUB_REF' ); 212 212 213 if ( $github_event_name && 'false' !== $github_event_name) {213 if ( $github_event_name ) { 214 214 // We're on GitHub Actions. 215 215 $skipped = array( 'pull_request', 'pull_request_target' ); 216 216 217 if ( in_array( $github_event_name, $skipped, true ) || 'refs/heads/ master' !== $github_ref ) {218 $this->markTestSkipped( 'For automated test runs, this test is only run on trunk /master' );217 if ( in_array( $github_event_name, $skipped, true ) || 'refs/heads/trunk' !== $github_ref ) { 218 $this->markTestSkipped( 'For automated test runs, this test is only run on trunk' ); 219 219 } 220 220 } 221 221 } -
tests/phpunit/tests/basic.php
8 8 class Tests_Basic extends WP_UnitTestCase { 9 9 10 10 public function test_license() { 11 // This test is designed to only run on trunk /master.11 // This test is designed to only run on trunk. 12 12 $this->skipOnAutomatedBranches(); 13 13 14 14 $license = file_get_contents( ABSPATH . 'license.txt' ); … … 18 18 } 19 19 20 20 public function test_security_md() { 21 // This test is designed to only run on trunk /master.21 // This test is designed to only run on trunk. 22 22 $this->skipOnAutomatedBranches(); 23 23 24 24 $security = file_get_contents( dirname( ABSPATH ) . '/SECURITY.md' ); -
tests/phpunit/tests/external-http/basic.php
10 10 * @covers ::wp_remote_retrieve_body 11 11 */ 12 12 public function test_readme_php_version() { 13 // This test is designed to only run on trunk /master.13 // This test is designed to only run on trunk. 14 14 $this->skipOnAutomatedBranches(); 15 15 16 16 $readme = file_get_contents( ABSPATH . 'readme.html' ); … … 31 31 * @covers ::wp_remote_retrieve_body 32 32 */ 33 33 public function test_readme_mysql_version() { 34 // This test is designed to only run on trunk /master.34 // This test is designed to only run on trunk. 35 35 $this->skipOnAutomatedBranches(); 36 36 37 37 $readme = file_get_contents( ABSPATH . 'readme.html' ); … … 63 63 * @covers ::wp_remote_retrieve_body 64 64 */ 65 65 public function test_readme_mariadb_version() { 66 // This test is designed to only run on trunk /master.66 // This test is designed to only run on trunk. 67 67 $this->skipOnAutomatedBranches(); 68 68 69 69 $readme = file_get_contents( ABSPATH . 'readme.html' ); -
tests/phpunit/tests/theme.php
213 213 * @ticket 48566 214 214 */ 215 215 public function test_year_in_readme() { 216 // This test is designed to only run on trunk /master.216 // This test is designed to only run on trunk. 217 217 $this->skipOnAutomatedBranches(); 218 218 219 219 foreach ( $this->default_themes as $theme ) {