Changeset 50697 for trunk/tests/phpunit/includes/abstract-testcase.php
- Timestamp:
- 04/10/2021 12:05:50 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/includes/abstract-testcase.php
r50441 r50697 182 182 * Allow tests to be skipped on some automated runs. 183 183 * 184 * For test runs on Travis/GitHub Actions for something other than trunk/master,184 * For test runs on GitHub Actions for something other than trunk/master, 185 185 * we want to skip tests that only need to run for master. 186 186 */ 187 187 public function skipOnAutomatedBranches() { 188 // https://docs.travis-ci.com/user/environment-variables/#Default-Environment-Variables189 $travis_branch = getenv( 'TRAVIS_BRANCH' );190 $travis_pull_request = getenv( 'TRAVIS_PULL_REQUEST' );191 192 188 // https://docs.github.com/en/free-pro-team@latest/actions/reference/environment-variables#default-environment-variables 193 189 $github_event_name = getenv( 'GITHUB_EVENT_NAME' ); … … 199 195 200 196 if ( in_array( $github_event_name, $skipped, true ) || 'refs/heads/master' !== $github_ref ) { 201 $this->markTestSkipped( 'For automated test runs, this test is only run on trunk/master' );202 }203 } elseif ( $travis_branch && 'false' !== $travis_branch ) {204 // We're on Travis CI.205 if ( 'master' !== $travis_branch || 'false' !== $travis_pull_request ) {206 197 $this->markTestSkipped( 'For automated test runs, this test is only run on trunk/master' ); 207 198 }
Note: See TracChangeset
for help on using the changeset viewer.