Skip to content

Commit

Permalink
Merge branch 'WordPress:trunk' into covers-d
Browse files Browse the repository at this point in the history
  • Loading branch information
pbearne authored Oct 13, 2023
2 parents 576154f + 9d1c581 commit 91f0712
Show file tree
Hide file tree
Showing 156 changed files with 8,652 additions and 5,039 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/coding-standards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,6 @@ jobs:
contents: read
timeout-minutes: 20
if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
env:
PUPPETEER_SKIP_DOWNLOAD: ${{ true }}

steps:
- name: Checkout repository
Expand Down
27 changes: 26 additions & 1 deletion .github/workflows/end-to-end-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,13 @@ jobs:
# - Sets up Node.js.
# - Logs debug information about the GitHub Action runner.
# - Installs npm dependencies.
# - Install Playwright browsers.
# - Builds WordPress to run from the `build` directory.
# - Starts the WordPress Docker container.
# - Logs the running Docker containers.
# - Logs Docker debug information (about both the Docker installation within the runner and the WordPress container).
# - Install WordPress within the Docker container.
# - Install Gutenberg.
# - Run the E2E tests.
# - Ensures version-controlled files are not modified or deleted.
e2e-tests:
Expand Down Expand Up @@ -90,6 +92,9 @@ jobs:
- name: Install npm Dependencies
run: npm ci

- name: Install Playwright browsers
run: npx playwright install --with-deps

- name: Build WordPress
run: npm run build

Expand All @@ -115,6 +120,9 @@ jobs:
LOCAL_SCRIPT_DEBUG: ${{ matrix.LOCAL_SCRIPT_DEBUG }}
run: npm run env:install

- name: Install Gutenberg
run: npm run env:cli -- plugin install gutenberg --path=/var/www/${{ env.LOCAL_DIR }}

- name: Run E2E tests
run: npm run test:e2e

Expand All @@ -129,6 +137,22 @@ jobs:
- name: Ensure version-controlled files are not modified or deleted
run: git diff --exit-code

slack-notifications:
name: Slack Notifications
uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk
permissions:
actions: read
contents: read
needs: [ e2e-tests ]
if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }}
with:
calling_status: ${{ contains( needs.*.result, 'cancelled' ) && 'cancelled' || contains( needs.*.result, 'failure' ) && 'failure' || 'success' }}
secrets:
SLACK_GHA_SUCCESS_WEBHOOK: ${{ secrets.SLACK_GHA_SUCCESS_WEBHOOK }}
SLACK_GHA_CANCELLED_WEBHOOK: ${{ secrets.SLACK_GHA_CANCELLED_WEBHOOK }}
SLACK_GHA_FIXED_WEBHOOK: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }}
SLACK_GHA_FAILURE_WEBHOOK: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }}

failed-workflow:
name: Failed workflow tasks
runs-on: ubuntu-latest
Expand All @@ -141,7 +165,8 @@ jobs:
github.event_name != 'pull_request' &&
github.run_attempt < 2 &&
(
needs.e2e-tests.result == 'cancelled' || needs.e2e-tests.result == 'failure'
contains( needs.*.result, 'cancelled' ) ||
contains( needs.*.result, 'failure' )
)
steps:
- name: Dispatch workflow run
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/failed-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ jobs:
runs-on: ubuntu-latest
permissions:
actions: write
timeout-minutes: 5
timeout-minutes: 20

steps:
- name: Rerun a workflow
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1
with:
retries: 2
retries: 10
retry-exempt-status-codes: 418
script: |
const workflow_run = await github.rest.actions.getWorkflowRun({
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/install-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
# - Creates a `wp-config.php` file.
# - Installs WordPress.
install-tests-mysql:
name: WP ${{ inputs.new-version || 'latest' }} / PHP ${{ matrix.php }} / ${{ 'mariadb' == matrix.db-type && 'MariaDB' || 'MySQL' }} ${{ matrix.db-version }}${{ matrix.multisite && ' multisite' || '' }}
name: WP ${{ inputs.wp-version || 'latest' }} / PHP ${{ matrix.php }} / ${{ 'mariadb' == matrix.db-type && 'MariaDB' || 'MySQL' }} ${{ matrix.db-version }}${{ matrix.multisite && ' multisite' || '' }}
permissions:
contents: read
runs-on: ubuntu-latest
Expand Down
32 changes: 24 additions & 8 deletions .github/workflows/performance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ permissions: {}

env:
# Performance testing should be performed in an environment reflecting a standard production environment.
WP_DEBUG: false
SCRIPT_DEBUG: false
SAVEQUERIES : false
WP_DEVELOPMENT_MODE: ''
LOCAL_WP_DEBUG: false
LOCAL_SCRIPT_DEBUG: false
LOCAL_SAVEQUERIES: false
LOCAL_WP_DEVELOPMENT_MODE: "''"

# This workflow takes two sets of measurements — one for the current commit,
# and another against a consistent version that is used as a baseline measurement.
Expand All @@ -56,6 +56,7 @@ jobs:
# - Set up Node.js.
# - Log debug information.
# - Install npm dependencies.
# - Install Playwright browsers.
# - Build WordPress.
# - Start Docker environment.
# - Log running Docker containers.
Expand All @@ -73,6 +74,7 @@ jobs:
# - Run performance tests (previous/target commit).
# - Print target performance tests results.
# - Reset to original commit.
# - Install npm dependencies.
# - Set the environment to the baseline version.
# - Run baseline performance tests.
# - Print baseline performance tests results.
Expand Down Expand Up @@ -119,6 +121,9 @@ jobs:
- name: Install npm dependencies
run: npm ci

- name: Install Playwright browsers
run: npx playwright install --with-deps

- name: Build WordPress
run: npm run build

Expand Down Expand Up @@ -182,24 +187,35 @@ jobs:
run: npm run build

- name: Run target performance tests (base/previous commit)
run: npm run test:performance -- --prefix=before
env:
TEST_RESULTS_PREFIX: before
run: npm run test:performance

- name: Print target performance tests results
run: node ./tests/performance/results.js --prefix=before
env:
TEST_RESULTS_PREFIX: before
run: node ./tests/performance/results.js

- name: Reset to original commit
run: git reset --hard $GITHUB_SHA

- name: Install npm dependencies
run: npm ci

- name: Set the environment to the baseline version
run: |
npm run env:cli -- core update --version=${{ env.BASE_TAG }} --force --path=/var/www/${{ env.LOCAL_DIR }}
npm run env:cli -- core version --path=/var/www/${{ env.LOCAL_DIR }}
- name: Run baseline performance tests
run: npm run test:performance -- --prefix=base
env:
TEST_RESULTS_PREFIX: base
run: npm run test:performance

- name: Print baseline performance tests results
run: node ./tests/performance/results.js --prefix=base
env:
TEST_RESULTS_PREFIX: base
run: node ./tests/performance/results.js

- name: Compare results with base
run: node ./tests/performance/compare-results.js ${{ runner.temp }}/summary.md
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/phpunit-tests-run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ env:
LOCAL_DB_VERSION: ${{ inputs.db-version }}
LOCAL_PHP_MEMCACHED: ${{ inputs.memcached }}
PHPUNIT_CONFIG: ${{ inputs.phpunit-config }}
PUPPETEER_SKIP_DOWNLOAD: ${{ true }}

jobs:
# Runs the PHPUnit tests for WordPress.
Expand Down Expand Up @@ -159,11 +158,11 @@ jobs:

- name: Run ms-files tests as a multisite install
if: ${{ inputs.multisite }}
run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c tests/phpunit/multisite.xml --group ms-files
run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c ${{ env.PHPUNIT_CONFIG }} --group ms-files

- name: Run external HTTP tests
if: ${{ ! inputs.multisite }}
run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c phpunit.xml.dist --group external-http
run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c ${{ env.PHPUNIT_CONFIG }} --group external-http

# __fakegroup__ is excluded to force PHPUnit to ignore the <exclude> settings in phpunit.xml.dist.
- name: Run (Xdebug) tests
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/slack-notifications.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,10 @@ jobs:
return 'first-failure';
}
// When a workflow has been restarted to fix a failure, check the previous run attempt.
if ( workflow_run.data.run_attempt > 1 ) {
// When a workflow has been restarted, check the previous run attempt. Because workflows are automatically
// restarted once and a failure on the first run is not reported, failures on the second run should not be
// considered.
if ( workflow_run.data.run_attempt > 2 ) {
const previous_run = await github.rest.actions.getWorkflowRunAttempt({
owner: context.repo.owner,
repo: context.repo.repo,
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/test-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ on:
permissions: {}

env:
PUPPETEER_SKIP_DOWNLOAD: ${{ true }}
LOCAL_PHP: '7.4-fpm'
LOCAL_PHP_XDEBUG: true
LOCAL_PHP_XDEBUG_MODE: 'coverage'
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/test-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ concurrency:
# Any needed permissions should be configured at the job level.
permissions: {}

env:
PUPPETEER_SKIP_DOWNLOAD: ${{ true }}

jobs:
# Verifies that installing npm dependencies and building WordPress works as expected.
#
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,4 @@ wp-tests-config.php
/docker-compose.override.yml

# Visual regression test diffs
tests/visual-regression/specs/__image_snapshots__
tests/visual-regression/specs/__snapshots__
Loading

0 comments on commit 91f0712

Please sign in to comment.