15 Commits

Author SHA1 Message Date
Jonathan Desrosiers
3850ddca39 Build/Test Tools: Don’t run the performance workflow when branching.
When a branch is created, there is no previous commit to reference in the `github.event.before` context, which causes the performance workflow to fail because there is no previous commit to perform a comparison with.

This adds a condition to check that `github.event.before` is not set to `0000000000000000000000000000000000000000`, which is the default value when there are no previous commits.

Props swissspidy.
See #588867.

git-svn-id: https://develop.svn.wordpress.org/trunk@56972 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-19 13:59:01 +00:00
Pascal Birchler
f95ddbcee5 Build/Test Tools: Reinstate PUPPETEER_SKIP_DOWNLOAD for most CI workflows.
The `PUPPETEER_SKIP_DOWNLOAD` environment variable is used to prevent Puppeteer from automatically downloading browser binaries.
It was removed in [56926] due to the migration to Playwright. However, because of the QUnit tests, Puppeteer is actually still a dependency.

Until those tests change, we have to keep this environment variable to prevent unnecessary downloads on CI.

Props SergeyBiryukov.
Fixes #59517.

git-svn-id: https://develop.svn.wordpress.org/trunk@56954 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-17 11:27:24 +00:00
Pascal Birchler
5a838d1bb7 Build/Test Tools: Migrate Puppeteer tests to Playwright.
As per the migration plan shared last year, this migrates all browser-based tests in WordPress core to use Playwright.
This includes end-to-end, performance, and visual regression tests.

Props swissspidy, mamaduka, kevin940726, bartkalisz, desrosj, adamsilverstein.
Fixes #59517.

git-svn-id: https://develop.svn.wordpress.org/trunk@56926 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-13 08:11:41 +00:00
Jonathan Desrosiers
ba71767faf Build/Test Tools: Simplify some logic in GitHub Action workflows.
This simplifies the logic within the `slack-notifications` and `failed-workflow` steps in GitHub Action workflows to use the `contains()` function and object filtering.

This makes it simpler to perform the needed checks by removing the need to list out every single dependent job defined in `needs`.

See #58867.

git-svn-id: https://develop.svn.wordpress.org/trunk@56660 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-22 14:28:01 +00:00
Jonathan Desrosiers
34520001c5 Build/Test Tools: Update 3rd-party GitHub Actions.
This updates all 3rd-party GitHub actions to their latest versions. The following actions were updated:
- `actions/cache`
- `actions/checkout`
- `actions/setup-node`
- `codecov/codecov-action`
- `shivammathur/setup-php`
- `slackapi/slack-github-action`

In the latest version of `actions/checkout` (`4.0.0`), a new input was introduced to control the output of command progress. This change uses this new `show-progress` input to turn off displaying progress by default. Progress will be shown when a workflow is run with debug mode enabled, just in case it contains helpful information.

Props johnbillion, desrosj.
See #58867.

git-svn-id: https://develop.svn.wordpress.org/trunk@56537 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-07 16:49:18 +00:00
Pascal Birchler
b447190e4c Build/Test Tools: Compare results in performance measurement workflow.
This extends the performance test workflow added in [55459] to also run tests against the target branch (if running on a pull request) or the previous commit (if running on trunk).

Those results are then compared with the ones from the current commit, and the difference is displayed as a GitHub Actions workflow summary for convenience.

Props mukesh27, flixos90, desrosj, joemcgill, swissspidy.
Fixes #58358, #58359.
See #56150.

git-svn-id: https://develop.svn.wordpress.org/trunk@56506 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-01 17:24:56 +00:00
Jonathan Desrosiers
cc828e2619 Build/Test Tools: Simplify the required prerequisite jobs for the failed-workflow job.
Because `slack-notifications` job requires all preceding jobs in each workflow to complete, there’s no need to include the same jobs in the `needs` configuration for the `failed-workflow` one.

See #58867.

git-svn-id: https://develop.svn.wordpress.org/trunk@56402 602fd350-edb4-49c9-b593-d223f7449a82
2023-08-17 14:42:58 +00:00
Jonathan Desrosiers
8d56facbeb Build/Test Tools: Update 3rd-party GitHub Actions.
This updates all 3rd-party GitHub Actions to their latest versions.

See #58867.

git-svn-id: https://develop.svn.wordpress.org/trunk@56388 602fd350-edb4-49c9-b593-d223f7449a82
2023-08-11 13:03:21 +00:00
Joe McGill
a0b15f354a Build/Test Tools: Run performance tests using production env vars.
This sets the following environment variables when running automated performance tests to avoid side effects that can skew performance data when the default development environment variables are used:

* `SAVEQUERIES`: `false`
* `SCRIPT_DEBUG`: `false`
* `WP_DEBUG`: `false`
* `WP_DEVELOPMENT_MODE`: `''`

Props rajinsharwar, desrosj, mukesh27, joemcgill.
Fixes #58825.


git-svn-id: https://develop.svn.wordpress.org/trunk@56313 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-26 19:11:44 +00:00
Peter Wilson
b638c20014 Build/Test Tools: Update URL of theme unit test data.
Update the performance tests to account for the relocation of the theme unit test data repository to the WordPress organisation on GitHub.

Props costdev, kafleg, williampatton, dd32, otto42, poena, jrf, joemcgill, peterwilsoncc, mukesh27.
Fixes #58569.


git-svn-id: https://develop.svn.wordpress.org/trunk@55976 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-22 04:19:59 +00:00
John Blackbourn
b54303cd82 Build/Test Tools: Fix the permissions that are granted to the Slack notifications workflow.
Follow-up to [55715].

See #57865


git-svn-id: https://develop.svn.wordpress.org/trunk@55717 602fd350-edb4-49c9-b593-d223f7449a82
2023-05-03 23:20:40 +00:00
John Blackbourn
3bfc6611ad Build/Test Tools: Restrict the permissions granted to jobs on GitHub Actions
The `permissions` key in a job declares the GitHub permissions that are granted to the token that's used by the job. Restricting the permissions reduces the impact that a vulnerability in the CI system can have.

Props desrosj, johnbillion

See #57865


git-svn-id: https://develop.svn.wordpress.org/trunk@55715 602fd350-edb4-49c9-b593-d223f7449a82
2023-05-03 22:15:27 +00:00
Jonathan Desrosiers
b2ec9f050e Build/Test Tools: Add the workflow_dispatch event to the performance workflow.
This allows workflow runs to be initiated through the GitHub API.

Follow up to [55507].

See #57687.

git-svn-id: https://develop.svn.wordpress.org/trunk@55508 602fd350-edb4-49c9-b593-d223f7449a82
2023-03-10 00:15:07 +00:00
Joe McGill
95703e3de5 Build/Test Tools: Update the URL for logging performance workflows.
This is a follow up to r55459, which fixes the hostname used for logging performance metrics by adding the correct www subdomain.

See #57687.


git-svn-id: https://develop.svn.wordpress.org/trunk@55479 602fd350-edb4-49c9-b593-d223f7449a82
2023-03-07 16:58:56 +00:00
Joe McGill
8417a97deb Build/Test Tools: Add a performance measurement workflow.
This adds a new GitHub Action workflow that measures a set of performance metrics on every commit, so we can track changes in the performance of WordPress over time and more easily identify changes that are responsible for significant performance improvements or regressions during development cycles.

The workflow measures the homepage of a classic theme (Twenty Twenty-One) and a block theme (Twenty Twenty-Three) set up with demo content from the Theme Test Data project. Using the e2e testing framework, it makes 20 requests and records the median value of the following Server Timing metrics, generated by an mu-plugin installed as part of this workflow:

- Total server response time
- Server time before templates are loaded
- Server time during template rendering

In addition to measuring the performance metrics of the current commit, it also records performance metrics of a consistent version of WordPress (6.1.1) to be used as a baseline measurement in order to remove variance caused by the GitHub workers themselves from our reporting.

The measurements are collected and displayed at https://www.codevitals.run/project/wordpress.

Props adamsilverstein, mukesh27, flixos90, youknowriad, oandregal, desrosj, costdev, swissspidy.
Fixes #57687.


git-svn-id: https://develop.svn.wordpress.org/trunk@55459 602fd350-edb4-49c9-b593-d223f7449a82
2023-03-03 20:37:10 +00:00