Introducing GitHub Actions for Automated Testing

As of [49162], CoreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. is now running automated tests using GitHubGitHub GitHub is a website that offers online implementation of git repositories that can can easily be shared, copied and modified by other developers. Public repositories are free to host, private repositories require a paid subscription. GitHub introduced the concept of the ‘pull request’ where code changes done in branches by contributors can be reviewed and discussed before being merged be the repository owner. https://github.com/ Actions as a runner, in addition to the existing Travis CI and Appveyor runs. This post is to publicize the change, document the reasoning, communicate next steps, and share how people contributing to WordPress Core will benefit.

GitHub Actions allows us to automate software workflows directly in GitHub, triggered by GitHub events. By switching, we are able to take advantage of a unified interface, inline annotations for linting issues in pull requests, the broader open sourceOpen Source Open Source denotes software for which the original source code is made freely available and may be redistributed and modified. Open Source **must be** delivered via a licensing model, see GPL. ecosystem building and using Actions including existing work in Gutenberg, and free availability for public repositories. Note that private repositories do use the monthly bucket of included minutes.

For contributors, this continues to refine the experience of working on Trac tickets using GitHub pull requests, most notably by showing linting errors inline in the diff view of the PR (known as annotations). This also consolidates external tooling into one place. If you have not already, please take a moment to associate your GitHub account with your WordPress.org profile.

Screenshot of inline annotation examples

These 6 workflows cover all current testing and analysis performed in Travis CI and Appveyor:

There is also an additional 7th workflow that is meant to leave a welcome message when it’s the contributor’s first pull request, letting them know how we use GitHub pull requests and how to link them to a TracTrac An open source project by Edgewall Software that serves as a bug tracker and project management tool for WordPress. ticketticket Created for both bug reports and feature development on the bug tracker.. There appears to be an issue concerning permissioning when PRs are sent from forks, so this is pending.

Currently, Travis CI and Appveyor will continue to run for a transition period (ending TBD) to allow for any issues to be ironed out, and so that real-world usage data can be collected. So far, even in early testing, runs appear to be completing more quickly and with fewer/no false negatives, e.g. when Travis CI does not see the commit in the mirror yet. @desrosj will be collating run data in a spreadsheet, including but not limited to: overall build time, run time comparison (where 1:1 comparisons can be made), and frequency of false negatives.

Known next steps

  • Add and configure SlackSlack Slack is a Collaborative Group Chat Platform https://slack.com/. The WordPress community has its own Slack Channel at https://make.wordpress.org/chat/. notifications. In addition to sending the results of the whole build of a core commit into #core, we may also want to consider a firehose channel for PRs.
  • Move to GitHub badges for build status indicators – note that these are per-workflow, which is different from the single badge for the entire Travis build for a given commit. However, GitHub does report an overall status for a commit/PR, so we may be able to use that information as well.
  • Report test results to the Host Test Results page.
  • Switch to ESLint from JSHint, as the latter does not appear to easily support inline annotations, and the former is in broader usage including in core for docs, GutenbergGutenberg The Gutenberg project is the new Editor Interface for WordPress. The editor improves the process and experience of creating new content, making writing rich content much simpler. It uses ‘blocks’ to add richness rather than shortcodes, custom HTML etc. https://wordpress.org/gutenberg/ and many community projects. See #31823 for more – volunteers very much appreciated here.
  • Backportbackport A port is when code from one branch (or trunk) is merged into another branch or trunk. Some changes in WordPress point releases are the result of backporting code from trunk to the release branch. the workflow files to actively maintained older branches.

As always, please report any issues you are seeing with our GitHub Actions, as well as further ideas for use you may have. Major thanks to @desrosj for all the heavy lifting he’s done in just a couple of weeks, and to @ocean90 and @ayeshrajans for their help along the way.

#5-6, #build-tools, #unit-tests

JavaScript Unit Tests for Core

Recently WordPress added QUnit as a JavaScriptJavaScript JavaScript or JS is an object-oriented computer programming language commonly used to create interactive effects within web browsers. WordPress makes extensive use of JS for a better user experience. While PHP is executed on the server, JS executes within a user’s browser. https://www.javascript.com/. unit testing framework and added its first JavaScript unit tests. I thought I would walk through how to run the tests and how to write tests so that we can increase our JavaScript test coverage. All of these are based upon using the develop.svn.wordpress.org checkout which is where the JSJS JavaScript, a web scripting language typically executed in the browser. Often used for advanced user interfaces and behaviors. unit tests live.
Continue reading

#javascript, #unit-tests

Housekeeping

I’ll be posting a summary soon that covers Wednesday’s marathon meeting to scope out features for 3.5. In the meantime, some housekeeping:

make/coreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress.

This P2P2 A free theme for WordPress, known for front-end posting, used by WordPress for development updates and project management. See our main development blog and other workgroup blogs. blogblog (versus network, site) has moved from wpdevel.wordpress.comWordPress.com An online implementation of WordPress code that lets you immediately access a new WordPress environment to publish your content. WordPress.com is a private company owned by Automattic that hosts the largest multisite in the world. This is arguably the best place to start blogging if you have never touched WordPress before. https://wordpress.com/ to make.wordpress.org/core. The “make” networknetwork (versus site, blog) is still very young, but there are other P2 blogs already underway, including ui, accessibility, themes, and plugins. wppolyglots.wordpress.com also moved to make/polyglots.

Everything was migrated, including email and jabber subscriptions (using Jetpack). Being on the WordPress.orgWordPress.org The community site where WordPress code is created and shared by the users. This is where you can download the source code for WordPress core, plugins and themes as well as the central location for community conversations and organization. https://wordpress.org/ network opens up some possibilities, including custom features, better integration, and single sign-on.

New test framework

There will definitely be more to come on this, but in the last two weeks, the test suite was converted to a new test runner. You can read more about the effort on @maxcutler‘s blog. Tests are now easier and more straightforward to write, and the runner is also faster, leaner, and more stable. We’ve been working to increase our test coverage with every core commit, so this move was really important.

Unit tests and mailing lists

With the new test framework, we’re also looking to raise the visibility of our tests. We do plan to merge them into core’s Subversion repository in the future, but for now, we’ve merged some mailing lists. The wp-svn mailing list (every core commit, right in your inbox) now receives commits to the unit-tests repository as well. And wp-trac (every TracTrac An open source project by Edgewall Software that serves as a bug tracker and project management tool for WordPress. ticketticket Created for both bug reports and feature development on the bug tracker. and comment — “the WordPress firehose”) now receives comments from the unit-tests Trac.

If you are mostly just interested in tests, the wp-unit-tests mailing list receives both commits and Trac notifications, as before. (Also, make yourself known!)

Daily Bug Scrubs

I’d like to continue having daily “office hours.” For now, we’ll continue them weekdays at 19:00 UTC (an hour before the dev chat usually is). A number of us are idling in IRCIRC Internet Relay Chat, a network where users can have conversations online. IRC channels are used widely by open source projects, and by WordPress. The primary WordPress channels are #wordpress and #wordpress-dev, on irc.freenode.net. throughout the week anyway, but I think it has worked well to have a set time where you can stop by to help comb through Trac, bring up tickets for discussion, and pitch patches.

 

 

#3-5, #housekeeping, #unit-tests