- Timestamp:
- 07/01/2024 07:17:07 PM (5 months ago)
- Location:
- branches/5.4
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/5.4
- Property svn:mergeinfo changed
/trunk merged: 49264,51673,52179,53552,53895,56464,57124-57125,57249,57918,58157
- Property svn:mergeinfo changed
-
branches/5.4/tests/phpunit/includes/abstract-testcase.php
r50604 r58611 181 181 182 182 /** 183 * Allow tests to be skipped on some automated runs.184 * 185 * For test runs on Travis for something other than trunk/master186 * we want to skip tests that only need to run for master.183 * Allows tests to be skipped on some automated runs. 184 * 185 * For test runs on GitHub Actions for something other than trunk, 186 * we want to skip tests that only need to run for trunk. 187 187 */ 188 188 public function skipOnAutomatedBranches() { 189 // https://docs.travis-ci.com/user/environment-variables/#Default-Environment-Variables 190 $travis_branch = getenv( 'TRAVIS_BRANCH' ); 191 $travis_pull_request = getenv( 'TRAVIS_PULL_REQUEST' ); 192 193 if ( ! $travis_branch || ! $travis_pull_request ) { 194 return; 195 } 196 197 if ( 'master' !== $travis_branch || 'false' !== $travis_pull_request ) { 198 $this->markTestSkipped( 'For automated test runs, this test is only run on trunk/master' ); 189 // https://docs.github.com/en/actions/learn-github-actions/environment-variables#default-environment-variables 190 $github_event_name = getenv( 'GITHUB_EVENT_NAME' ); 191 $github_ref = getenv( 'GITHUB_REF' ); 192 193 if ( $github_event_name ) { 194 // We're on GitHub Actions. 195 $skipped = array( 'pull_request', 'pull_request_target' ); 196 197 if ( in_array( $github_event_name, $skipped, true ) || 'refs/heads/trunk' !== $github_ref ) { 198 $this->markTestSkipped( 'For automated test runs, this test is only run on trunk' ); 199 } 199 200 } 200 201 }
Note: See TracChangeset
for help on using the changeset viewer.