WordPress.org

Make WordPress Core

Changeset 47125


Ignore:
Timestamp:
01/29/2020 03:20:38 PM (20 months ago)
Author:
SergeyBiryukov
Message:

Build/Test Tools: Pass the TRAVIS_BRANCH and TRAVIS_PULL_REQUEST environment variables along to the Docker container.

This ensures that WP_UnitTestCase::skipOnAutomatedBranches() has access to these variables.

Correct the check for pull requests in WP_UnitTestCase_Base::skipOnAutomatedBranches().

Merges [46999], [47000], and [47001] to the 5.3 branch.
Fixes #49050.

Location:
branches/5.3
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/5.3

  • branches/5.3/docker-compose.yml

    r46320 r47125  
    106106      PHP_FPM_UID: ${PHP_FPM_UID-1000}
    107107      PHP_FPM_GID: ${PHP_FPM_GID-1000}
     108      TRAVIS_BRANCH: ${TRAVIS_BRANCH-false}
     109      TRAVIS_PULL_REQUEST: ${TRAVIS_PULL_REQUEST-false}
    108110
    109111    volumes:
  • branches/5.3/tests/phpunit/includes/abstract-testcase.php

    r46451 r47125  
    187187     */
    188188    public function skipOnAutomatedBranches() {
    189         // gentenv can be disabled
    190         if ( ! function_exists( 'getenv' ) ) {
    191             return false;
    192         }
    193 
    194189        // https://docs.travis-ci.com/user/environment-variables/#Default-Environment-Variables
    195190        $travis_branch       = getenv( 'TRAVIS_BRANCH' );
    196191        $travis_pull_request = getenv( 'TRAVIS_PULL_REQUEST' );
    197192
    198         if ( false !== $travis_pull_request && 'master' !== $travis_branch ) {
     193        if ( ! $travis_branch || ! $travis_pull_request ) {
     194            return;
     195        }
     196
     197        if ( 'master' !== $travis_branch || 'false' !== $travis_pull_request ) {
    199198            $this->markTestSkipped( 'For automated test runs, this test is only run on trunk/master' );
    200199        }
Note: See TracChangeset for help on using the changeset viewer.