Changeset 49264
- Timestamp:
- 10/21/2020 02:05:39 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/includes/abstract-testcase.php
r49001 r49264 182 182 * Allow tests to be skipped on some automated runs. 183 183 * 184 * For test runs on Travis for something other than trunk/master185 * we want to skip tests thatonly need to run for master.184 * For test runs on Travis/GitHub Actions for something other than trunk/master, we want to skip tests that 185 * only need to run for master. 186 186 */ 187 187 public function skipOnAutomatedBranches() { … … 190 190 $travis_pull_request = getenv( 'TRAVIS_PULL_REQUEST' ); 191 191 192 if ( ! $travis_branch || ! $travis_pull_request ) { 192 // https://docs.github.com/en/free-pro-team@latest/actions/reference/environment-variables#default-environment-variables 193 $github_event_name = getenv( 'GITHUB_EVENT_NAME' ); 194 $github_ref = getenv( 'GITHUB_REF' ); 195 196 if ( ( ! $travis_branch || ! $travis_pull_request ) && ! $github_event_name ) { 193 197 return; 194 198 } 195 199 196 if ( 'master' !== $travis_branch || 'false' !== $travis_pull_request ) { 200 if ( ( 'master' !== $travis_branch || 'false' !== $travis_pull_request ) && empty( $github_event_name ) ) { 201 $this->markTestSkipped( 'For automated test runs, this test is only run on trunk/master' ); 202 } elseif ( in_array( $github_event_name, array( 'pull_request', 'pull_request_target' ), true ) || 'refs/heads/master' !== $github_ref ) { 197 203 $this->markTestSkipped( 'For automated test runs, this test is only run on trunk/master' ); 198 204 }
Note: See TracChangeset
for help on using the changeset viewer.