Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tag Processor: Fix a problem backing up too far after updating HTML #46597

Closed
wants to merge 99 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
31942aa
Add a small change to create a PR.
anton-vlasenko Dec 13, 2022
10ee41d
Add multiple php versions.
anton-vlasenko Dec 13, 2022
6f497cf
Add multiple php versions.
anton-vlasenko Dec 13, 2022
2344baa
Define phpVersion as environment variable.
anton-vlasenko Dec 13, 2022
e3b0b72
Add phpunit tags for PHP 8.1 and 8.2.
anton-vlasenko Dec 13, 2022
82c43e7
Remove hyphen.
anton-vlasenko Dec 13, 2022
bbb224c
Nove PHPUnit tests to a separate file.
anton-vlasenko Dec 13, 2022
da347a5
Disable `fail-fast`.
anton-vlasenko Dec 13, 2022
3448a87
Update matrix.os.
anton-vlasenko Dec 13, 2022
e433d83
Install composer dependencies.
anton-vlasenko Dec 13, 2022
5e13c24
Revert "Install composer dependencies."
anton-vlasenko Dec 13, 2022
42cf698
Revert "Revert "Install composer dependencies.""
anton-vlasenko Dec 13, 2022
ee42215
Fixing "no phpunit found" error.
aaroncampbell Dec 13, 2022
6005cfe
Revert "Fixing "no phpunit found" error."
anton-vlasenko Dec 13, 2022
8f172e3
Add phpunit tags for PHP 8.1 and 8.2.
anton-vlasenko Dec 13, 2022
d3e318a
Debug the phpunitImage.
anton-vlasenko Dec 14, 2022
86d333c
Use correct composer version.
anton-vlasenko Dec 14, 2022
7142d88
Fix container name.
anton-vlasenko Dec 14, 2022
4088360
Don't modify package.json.
anton-vlasenko Dec 14, 2022
a131412
Don't install composer dependencies twice.
anton-vlasenko Dec 14, 2022
f68354f
Need to prefix commands with npm run.
anton-vlasenko Dec 14, 2022
f28fa55
Add double dashes to pass flags to wp-env.
anton-vlasenko Dec 14, 2022
47b5e2d
Fix name of the environment.
anton-vlasenko Dec 14, 2022
a452cd7
Add additional debug information.
anton-vlasenko Dec 14, 2022
adc8d0a
Composer dependencies should be installed after wp-env is intialised.
anton-vlasenko Dec 14, 2022
ab8352d
Fix wrong command.
anton-vlasenko Dec 14, 2022
4d994c9
Since the tests are currently run within the Docker containers where …
anton-vlasenko Dec 14, 2022
c3d41b4
Fix path to the multisite.xml.
anton-vlasenko Dec 14, 2022
e03c418
Fix the test class to be compatible with PHP < 7.3.
anton-vlasenko Dec 14, 2022
c70ae03
Fix bug in WP_REST_Block_Pattern_Categories_Controller_Test::wpTearDo…
anton-vlasenko Dec 14, 2022
04abb45
Remove incompatible PHP packages.
anton-vlasenko Dec 15, 2022
9adab90
Remove incompatible PHP packages.
anton-vlasenko Dec 15, 2022
3573f40
Update description.
anton-vlasenko Dec 15, 2022
8e086aa
Remove incompatible PHP packages.
anton-vlasenko Dec 15, 2022
d110d2e
Remove incompatible PHP packages.
anton-vlasenko Dec 15, 2022
650a035
Fix wrong matrix value.
anton-vlasenko Dec 15, 2022
b729451
Remove incompatible PHP packages.
anton-vlasenko Dec 15, 2022
5e34405
Don't remove polyfills.
anton-vlasenko Dec 15, 2022
f3bbf21
Don't remove spathie package on PHP 7.2.
anton-vlasenko Dec 15, 2022
a1936fb
Fix bug in WP_HTML_Tag_Processor::get_updated_html
anton-vlasenko Dec 15, 2022
b0a6870
// strpos() doesn't support negative offset values on PHP prior to ve…
anton-vlasenko Dec 15, 2022
154e3a0
// strpos() doesn't support negative offset values on PHP prior to ve…
anton-vlasenko Dec 15, 2022
53aa66f
Revert the changes.
anton-vlasenko Dec 15, 2022
1a73cd9
Add cliPhpVersion config parameter.
anton-vlasenko Dec 15, 2022
6007bea
Don't use custom commands to run the tests.
anton-vlasenko Dec 15, 2022
ecc1232
Revert "Add cliPhpVersion config parameter."
anton-vlasenko Dec 15, 2022
8bee8c8
Don't use the phpunit docker-compose service.
anton-vlasenko Dec 15, 2022
8b89b36
Fix dynamic properties. PHP 8.2 doesn't support dynamic properties.
anton-vlasenko Dec 15, 2022
7550ed9
Fix dynamic properties. PHP 8.2 doesn't support dynamic properties.
anton-vlasenko Dec 15, 2022
fd9a0a2
Fix dynamic properties. PHP 8.2 doesn't support dynamic properties.
anton-vlasenko Dec 15, 2022
83ffd44
Check for NULL value in block_type asset handles
noahtallen Dec 13, 2022
cad7c17
Use isset instead of is_null
noahtallen Dec 13, 2022
5c89ed2
Use isset in if-statement instead of ternary
noahtallen Dec 13, 2022
c477020
Add comment
noahtallen Dec 13, 2022
bfc05b0
Add is_array check
noahtallen Dec 14, 2022
2a4e4f9
Don't block merging both if only one is unavailable
noahtallen Dec 14, 2022
4a385c4
Add variable assignment back
noahtallen Dec 14, 2022
cedd4a2
Bump plugin version to 14.7.2
gutenbergplugin Dec 14, 2022
94ddd12
Update Changelog for 14.7.2
gutenbergplugin Dec 14, 2022
076b826
Ensure drag handle matches cursor position when resizing a center ali…
talldan Dec 14, 2022
20883f5
ESLint: Fix warnings in the data package (#46499)
tyxla Dec 14, 2022
5eeb83a
Site Editor: Keep edited entity in sync when Editor canvas isn't moun…
Mamaduka Dec 14, 2022
ac2b3bf
Query: Add migration of colors to v2 deprecation (#46522)
aaronrobertshaw Dec 14, 2022
af4b562
Add selector and test (#46531)
getdave Dec 14, 2022
da79632
Site Editor: Fix the top bar 'exist' animation (#46533)
Mamaduka Dec 14, 2022
ef28fbe
Fix typing performance issue for container blocks (#46527)
youknowriad Dec 14, 2022
5b475a6
Add page list to Link UI transforms in Nav block (#46426)
getdave Dec 14, 2022
230e1f4
Lodash: Refactor edit-site away from _.find() (#46539)
tyxla Dec 14, 2022
edec24b
Lodash: Refactor block library away from _.find() (#46430)
tyxla Dec 14, 2022
77ca69b
Bump plugin version to 14.7.3
gutenbergplugin Dec 14, 2022
ba10498
[Mobile] - Disable Unsupported Block Editor Tests (Android) (#46542)
Dec 14, 2022
d4e4576
Update Changelog for 14.7.3
gutenbergplugin Dec 14, 2022
9837a0d
Bump plugin version to 14.8.0-rc.1
gutenbergplugin Dec 14, 2022
ccf6e2b
Update Nav OffCanvas Editor to use clientids tree (#46541)
scruffian Dec 14, 2022
fefdd30
Nav offcanvas - handle non-direct insert block inserter (#46503)
getdave Dec 14, 2022
dd72ca6
Page List: Update the icon to demonstrate that the pages are automati…
scruffian Dec 14, 2022
166ea3c
Update Changelog for 14.8.0-rc.1
gutenbergplugin Dec 14, 2022
afe91fe
Clarifying the npm package release process for the RC release. (#46555)
ryanwelcher Dec 14, 2022
fb788fa
[`customize-widgets/utils/widgetToBlock`] Initialize a widget's `raw_…
fullofcaffeine Dec 14, 2022
9972a2c
Add rough animation to navigation and links (#46342)
artemiomorales Dec 14, 2022
b696aa7
Global Styles REST API endpoint: check custom CSS is included before …
andrewserong Dec 15, 2022
18ca179
Template Parts: Add an option to import widgets from the sidebars (#4…
Mamaduka Dec 15, 2022
9172923
Change SpacingSizesControl ARIA from region to group (#46530)
Mamaduka Dec 15, 2022
3f2861d
Update copy of add submenu item option (#46564)
talldan Dec 15, 2022
9edb84e
Fix Off Canvas Editor add submenu item option (#46562)
talldan Dec 15, 2022
3db29d6
Try controlled page list block (#46416)
talldan Dec 15, 2022
23d240d
Style Engine: Add support for text columns (column-count) (#46566)
aaronrobertshaw Dec 15, 2022
2afb34a
Paste: reuse file transforms for file pasting (#45891)
ellatrix Dec 15, 2022
d5fe5e0
Add a performance metric to measure typing within containers (#46529)
youknowriad Dec 15, 2022
c275c7a
Lodash: Refactor components away from `_.find()` (#46537)
tyxla Dec 15, 2022
9a7f599
Fix accessing potentially undefined block editor setting __experiment…
getdave Dec 15, 2022
0e38e64
Update the update icon (#46575)
scruffian Dec 15, 2022
60bd548
Block editor: iframe/writing flow: change tab index to 0 (#46323)
ellatrix Dec 15, 2022
ba4a40b
Page List: Add typography supports (#43316)
aaronrobertshaw Dec 15, 2022
6d629f5
Remove clearable from link ColorPanel item (#46507)
richtabor Dec 15, 2022
b4bfe4f
Migrate quote e2e tests to playwright (#46549)
t-hamano Dec 15, 2022
04158bc
Fix region navigation in the site editor (#46525)
youknowriad Dec 15, 2022
e414af0
DOM: fix findNext/Previous tabbable if target is not in findFocusable…
ellatrix Dec 15, 2022
bdea1f3
Tag Processor: Fix a problem backing up too far after updating HTML
dmsnell Dec 15, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
128 changes: 128 additions & 0 deletions .github/workflows/phpunit-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
name: PHPUnit Tests

# Since Unit Tests are required to pass for each PR,
# we cannot disable them for documentation-only changes.
on:
pull_request:
push:
branches:
- trunk
- 'release/**'
- 'wp/**'

# Cancels all previous workflow runs for pull requests that have not completed.
concurrency:
# The concurrency group contains the workflow name and the branch name for pull requests
# or the commit hash for any other events.
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true

jobs:
test-php:
name: ${{ matrix.php }}${{ matrix.multisite && ' multisite' || '' }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 20
if: ${{ github.repository == 'WordPress/gutenberg' || github.event_name == 'pull_request' }}
strategy:
fail-fast: false
matrix:
php:
[
'5.6',
'7.0',
'7.1',
'7.2',
'7.3',
'7.4',
'8.0',
'8.1',
'8.2',
]
os: [ubuntu-latest]
multisite: [false, true]

env:
WP_ENV_PHP_VERSION: ${{ matrix.php }}

steps:
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0

- name: Set up Node.js
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1
with:
node-version-file: '.nvmrc'
cache: npm

##
# This allows Composer dependencies to be installed using a single step.
#
# Since the tests are currently run within the Docker containers where the PHP version varies,
# the same PHP version needs to be configured for the action runner machine so that the correct
# dependency versions are installed and cached.
##
- name: Set up PHP
uses: shivammathur/setup-php@1a18b2267f80291a81ca1d33e7c851fe09e7dfc4 # v2.22.0
with:
php-version: '${{ matrix.php }}'
coverage: none

# Ensure that Composer installs the correct versions of packages.
- name: Override PHP version in composer.json
run: composer config platform.php ${{ matrix.php }}

# The spatie/phpunit-watcher package is not compatible with PHP < 7.2.
# It must be removed before running the tests.
- name: Remove incompatible Composer packages
if: ${{ matrix.php < '7.2' }}
run: composer remove spatie/phpunit-watcher --dev --no-update

# Since Composer dependencies are installed using `composer update` and no lock file is in version control,
# passing a custom cache suffix ensures that the cache is flushed at least once per week.
- name: Install Composer dependencies
uses: ramsey/composer-install@83af392bf5f031813d25e6fe4cd626cdba9a2df6 # v2.2.0
with:
custom-cache-suffix: $(/bin/date -u --date='last Mon' "+%F")

- name: Install npm dependencies
run: |
npm ci
npm run build

- name: Docker debug information
run: |
docker -v
docker-compose -v

- name: General debug information
run: |
php --version
npm --version
node --version
curl --version
git --version
svn --version
composer --version
locale -a

- name: Start Docker environment
run: npm run wp-env start

- name: Log running Docker containers
run: docker ps -a

- name: Docker container debug information
run: |
npm run wp-env run tests-mysql "mysql --version"
npm run wp-env run tests-wordpress "php --version"
npm run wp-env run tests-wordpress "php -m"
npm run wp-env run tests-wordpress "php -i"
npm run wp-env run tests-wordpress "/var/www/html/wp-content/plugins/gutenberg/vendor/bin/phpunit --version"
npm run wp-env run tests-wordpress "locale -a"

- name: Running single site unit tests
run: npm run test:unit:php
if: ${{ ! matrix.multisite }}

- name: Running multisite unit tests
run: npm run test:unit:php:multisite
if: ${{ matrix.multisite }}
34 changes: 0 additions & 34 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,40 +51,6 @@ jobs:
- name: Running the date tests
run: npm run test:unit:date -- --ci --maxWorkers=2 --cacheDirectory="$HOME/.jest-cache"

unit-php:
name: PHP
runs-on: ubuntu-latest
if: ${{ github.repository == 'WordPress/gutenberg' || github.event_name == 'pull_request' }}

steps:
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0

- name: Use desired version of NodeJS
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1
with:
node-version-file: '.nvmrc'
cache: npm

- name: Npm install and build
run: |
npm ci
npm run build

- name: Install WordPress
run: |
npm run wp-env start

- name: Running lint check
run: npm run lint:php

- name: Running single site unit tests
run: npm run test:unit:php
if: ${{ success() || failure() }}

- name: Running multisite unit tests
run: npm run test:unit:php:multisite
if: ${{ success() || failure() }}

mobile-unit-js:
name: Mobile
runs-on: ubuntu-latest
Expand Down
16 changes: 16 additions & 0 deletions bin/plugin/commands/performance.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ const config = require( '../config' );
* @property {number[]} firstContentfulPaint Represents the time when the browser first renders any text or media.
* @property {number[]} firstBlock Represents the time when Puppeteer first sees a block selector in the DOM.
* @property {number[]} type Average type time.
* @property {number[]} typeContainer Average type time within a container.
* @property {number[]} focus Average block selection time.
* @property {number[]} inserterOpen Average time to open global inserter.
* @property {number[]} inserterSearch Average time to search the inserter.
Expand All @@ -56,6 +57,9 @@ const config = require( '../config' );
* @property {number=} type Average type time.
* @property {number=} minType Minimum type time.
* @property {number=} maxType Maximum type time.
* @property {number=} typeContainer Average type time within a container.
* @property {number=} minTypeContainer Minimum type time within a container.
* @property {number=} maxTypeContainer Maximum type time within a container.
* @property {number=} focus Average block selection time.
* @property {number=} minFocus Min block selection time.
* @property {number=} maxFocus Max block selection time.
Expand Down Expand Up @@ -129,6 +133,9 @@ function curateResults( results ) {
type: average( results.type ),
minType: Math.min( ...results.type ),
maxType: Math.max( ...results.type ),
typeContainer: average( results.typeContainer ),
minTypeContainer: Math.min( ...results.typeContainer ),
maxTypeContainer: Math.max( ...results.typeContainer ),
focus: average( results.focus ),
minFocus: Math.min( ...results.focus ),
maxFocus: Math.max( ...results.focus ),
Expand Down Expand Up @@ -393,6 +400,15 @@ async function runPerformanceTests( branches, options ) {
type: rawResults.map( ( r ) => r[ branch ].type ),
minType: rawResults.map( ( r ) => r[ branch ].minType ),
maxType: rawResults.map( ( r ) => r[ branch ].maxType ),
typeContainer: rawResults.map(
( r ) => r[ branch ].typeContainer
),
minTypeContainer: rawResults.map(
( r ) => r[ branch ].minTypeContainer
),
maxTypeContainer: rawResults.map(
( r ) => r[ branch ].maxTypeContainer
),
focus: rawResults.map( ( r ) => r[ branch ].focus ),
minFocus: rawResults.map( ( r ) => r[ branch ].minFocus ),
maxFocus: rawResults.map( ( r ) => r[ branch ].maxFocus ),
Expand Down
Loading