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