[wp-trac] [WordPress Trac] #49050: skipOnAutomatedBranches() does not work as expected

WordPress Trac noreply at wordpress.org
Thu Dec 19 23:52:07 UTC 2019


#49050: skipOnAutomatedBranches() does not work as expected
------------------------------+---------------------
 Reporter:  SergeyBiryukov    |       Owner:  (none)
     Type:  defect (bug)      |      Status:  new
 Priority:  normal            |   Milestone:  5.4
Component:  Build/Test Tools  |     Version:
 Severity:  normal            |  Resolution:
 Keywords:                    |     Focuses:
------------------------------+---------------------

Comment (by SergeyBiryukov):

 Originally introduced in [40241] / #39486.

 Just noted that this only applies to the 5.3 branch. For 5.2 and earlier
 branches, the tests are skipped as expected, as [https://travis-
 ci.com/WordPress/wordpress-develop/jobs/266659075#L1756 job 266659075]
 shows.

 This appears to be caused by the work on #47767. It looks like
 `TRAVIS_BRANCH` and `TRAVIS_PULL_REQUEST` environment variables are not
 passed to the Docker container.

 Looking closer, the skip condition in `::skipOnAutomatedBranches()` could
 use some further correction. Per [https://docs.travis-ci.com/user
 /environment-variables/#Default-Environment-Variables Travis
 documentation], if the current job is not a pull request,
 `TRAVIS_PULL_REQUEST` contains a string `"false"`, not boolean `false`, so
 `false !== $travis_pull_request` always returns true, whether the job is a
 pull request or not.

 If the goal is to skip on pull requests OR branches, this seems to be the
 correct condition:
 {{{
 'false' !== $travis_pull_request || 'master' !== $travis_branch
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/49050#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list