#49050 closed defect (bug) (fixed)
skipOnAutomatedBranches() does not work as expected
Reported by: | SergeyBiryukov | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 5.3.3 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Build/Test Tools | Keywords: | fixed-major |
Focuses: | Cc: |
Description
Background: #49049
WP_UnitTestCase_Base::skipOnAutomatedBranches() is supposed to make sure some tests only run on trunk/master, not on other branches.
test_readme() is one of those tests, however it currently runs (and fails) at least on the 5.3 branch too, see job 268747198 for example.
Change History (8)
#3
@
5 years ago
The function_exists( 'getenv' )
check in line 190 also seems redundant, as we already have two other instances of getenv()
without that check in lines 82 and 99 of includes/bootstrap.php
.
WordPress core also uses it without checking in wp_get_update_php_url() and wp_get_direct_php_update_url().
#4
@
5 years ago
- Owner set to SergeyBiryukov
- Resolution set to fixed
- Status changed from new to closed
In 47000:
Note: See
TracTickets for help on using
tickets.
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 job 266659075 shows.
This appears to be caused by the work on #47767. It looks like
TRAVIS_BRANCH
andTRAVIS_PULL_REQUEST
environment variables are not passed to the Docker container.Looking closer, the skip condition in
::skipOnAutomatedBranches()
could use some further correction. Per Travis documentation, if the current job is not a pull request,TRAVIS_PULL_REQUEST
contains a string"false"
, not booleanfalse
, sofalse !== $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: