Make WordPress Core


Ignore:
Timestamp:
01/29/2020 03:20:38 PM (5 years 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:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.3

  • 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.