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