Skip to content

Commit

Permalink
Build/Test Tools: Remove remaining Travis CI references.
Browse files Browse the repository at this point in the history
* Remove `travis:` tasks in Gruntfile.js.
* Remove status badge in README.md that comes from Travis CI via shields.io.
* Remove Travis CI related skipping in the `WP_UnitTestCase_Base::skipOnAutomatedBranches()` test method and related Docker environment variables.

Props johnbillion, SergeyBiryukov, ocean90.
See #52161.
Fixes #52666.

git-svn-id: https://develop.svn.wordpress.org/trunk@50697 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
ocean90 committed Apr 10, 2021
1 parent b394d5a commit 87fc38e
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 29 deletions.
17 changes: 3 additions & 14 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -1639,15 +1639,9 @@ module.exports = function(grunt) {
var done = this.async();
var flags = this.flags;
var args = changedFiles.php;
if ( flags.travisErrors ) {
// We can check the entire codebase for coding standards errors.
args = [ 'lint:errors' ];
} else if ( flags.travisWarnings ) {
// We can check the tests directory for errors and warnings.
args = [ 'lint', 'tests' ];
} else {
args.unshift( 'lint' );
}

args.unshift( 'lint' );

grunt.util.spawn( {
cmd: 'composer',
args: args,
Expand All @@ -1661,11 +1655,6 @@ module.exports = function(grunt) {
} );
} );

// Travis CI tasks.
grunt.registerTask('travis:js', 'Runs JavaScript Travis CI tasks.', [ 'jshint:corejs', 'qunit:compiled' ]);
grunt.registerTask('travis:phpunit', 'Runs PHPUnit Travis CI tasks.', [ 'build', 'phpunit' ]);
grunt.registerTask('travis:phpcs', 'Runs PHP Coding Standards Travis CI tasks.', [ 'format:php:error', 'lint:php:travisErrors:error', 'lint:php:travisWarnings:error' ]);

// Patch task.
grunt.renameTask('patch_wordpress', 'patch');

Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# WordPress

[![Build Status](https://img.shields.io/travis/com/WordPress/wordpress-develop/master.svg)](https://travis-ci.com/WordPress/wordpress-develop)

Welcome to the WordPress development repository! Please check out the [contributor handbook](https://make.wordpress.org/core/handbook/) for information about how to open bug reports, contribute patches, test changes, write documentation, or get involved in any way you can.

* [Getting Started](#getting-started)
Expand Down
2 changes: 0 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,6 @@ services:
WP_MULTISITE: ${WP_MULTISITE-false}
PHP_FPM_UID: ${PHP_FPM_UID-1000}
PHP_FPM_GID: ${PHP_FPM_GID-1000}
TRAVIS_BRANCH: ${TRAVIS_BRANCH-false}
TRAVIS_PULL_REQUEST: ${TRAVIS_PULL_REQUEST-false}
GITHUB_REF: ${GITHUB_REF-false}
GITHUB_EVENT_NAME: ${GITHUB_EVENT_NAME-false}

Expand Down
2 changes: 1 addition & 1 deletion phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
</properties>
</rule>

<!-- Exclude the build folder in the current directory, as Travis puts the checkout in a build directory. -->
<!-- Exclude the build folder in the current directory. -->
<exclude-pattern type="relative">^build/*</exclude-pattern>

<!-- Directories and third party library exclusions. -->
Expand Down
11 changes: 1 addition & 10 deletions tests/phpunit/includes/abstract-testcase.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,14 +181,10 @@ public function clean_up_global_scope() {
/**
* Allow tests to be skipped on some automated runs.
*
* For test runs on Travis/GitHub Actions for something other than trunk/master,
* For test runs on GitHub Actions for something other than trunk/master,
* we want to skip tests that only need to run for master.
*/
public function skipOnAutomatedBranches() {
// https://docs.travis-ci.com/user/environment-variables/#Default-Environment-Variables
$travis_branch = getenv( 'TRAVIS_BRANCH' );
$travis_pull_request = getenv( 'TRAVIS_PULL_REQUEST' );

// https://docs.github.com/en/free-pro-team@latest/actions/reference/environment-variables#default-environment-variables
$github_event_name = getenv( 'GITHUB_EVENT_NAME' );
$github_ref = getenv( 'GITHUB_REF' );
Expand All @@ -200,11 +196,6 @@ public function skipOnAutomatedBranches() {
if ( in_array( $github_event_name, $skipped, true ) || 'refs/heads/master' !== $github_ref ) {
$this->markTestSkipped( 'For automated test runs, this test is only run on trunk/master' );
}
} elseif ( $travis_branch && 'false' !== $travis_branch ) {
// We're on Travis CI.
if ( 'master' !== $travis_branch || 'false' !== $travis_pull_request ) {
$this->markTestSkipped( 'For automated test runs, this test is only run on trunk/master' );
}
}
}

Expand Down

0 comments on commit 87fc38e

Please sign in to comment.