Make WordPress Core

Opened 7 weeks ago

Closed 10 days ago

#66203 closed task (blessed) (fixed)

Upgrade jQuery MIgrate to 3.6.0

Reported by: peterwilsoncc Owned by: peterwilsoncc
Priority: normal Milestone: 7.2
Component: External Libraries Version:
Severity: normal Keywords: has-patch has-unit-tests needs-dev-note
Cc: Focuses: javascript

Description

Related #60478.

Upgrade jQuery Migrate to 3.6.0 as part of the upgrade path for jQuery 4.0.

See ​PR#13787.

Change History (8)

#1 @peterwilsoncc
7 weeks ago

  • Type defect (bug) → task (blessed)

#2 @peterwilsoncc
7 weeks ago

  • Resolution → fixed
  • Status assigned → closed

In 63983:

External Libraries: Update jQuery Migrate to 3.6.0.

Updates jQuery Migrate from 3.4.1 to 3.6.0. This also removes the library from the committed src/js/_enqueues/vendor/jquery/ directory in favour of updating via NPM.

This is the first step in the upgrade path for jQuery 4.0.

Developed in ​https://github.com/WordPress/wordpress-develop/pull/13787.

Props clorith, jorbin, mukesh27, westonruter.
Fixes #66203.
See #60478.

#3 @peterwilsoncc
5 weeks ago

#62498 was marked as a duplicate.

#4 @SergeyBiryukov
4 weeks ago

  • Resolution fixed
  • Status closed → reopened

The tests added in r63983 fail when running from src, which is the default, see r50441 / #51734.

1) Tests_Dependencies_jQuery::test_jquery_files_exist with data set "jquery" ('jquery.js')
Failed asserting that file "/home/dev-test-s12/tmp/wp-test-runner/src//wp-includes/js/jquery/jquery.js" exists.

/home/dev-test-s12/tmp/wp-test-runner/tests/phpunit/tests/dependencies/jquery.php:52

2) Tests_Dependencies_jQuery::test_jquery_files_exist with data set "jquery-min" ('jquery.min.js')
Failed asserting that file "/home/dev-test-s12/tmp/wp-test-runner/src//wp-includes/js/jquery/jquery.min.js" exists.

/home/dev-test-s12/tmp/wp-test-runner/tests/phpunit/tests/dependencies/jquery.php:52

3) Tests_Dependencies_jQuery::test_jquery_files_exist with data set "jquery-migrate" ('jquery-migrate.js')
Failed asserting that file "/home/dev-test-s12/tmp/wp-test-runner/src//wp-includes/js/jquery/jquery-migrate.js" exists.

/home/dev-test-s12/tmp/wp-test-runner/tests/phpunit/tests/dependencies/jquery.php:52

4) Tests_Dependencies_jQuery::test_jquery_files_exist with data set "jquery-migrate-min" ('jquery-migrate.min.js')
Failed asserting that file "/home/dev-test-s12/tmp/wp-test-runner/src//wp-includes/js/jquery/jquery-migrate.min.js" exists.

/home/dev-test-s12/tmp/wp-test-runner/tests/phpunit/tests/dependencies/jquery.php:52

This can also be seen in recent failures on Host Test Results:

It appears that these aim to test the npm run build functionality, which might seem a bit redundant, but if we want to keep them, maybe we could add a check to only run them from the build directory and skip otherwise?

Last edited 4 weeks ago by SergeyBiryukov (previous) (diff)

This ticket was mentioned in ​PR #15435 on ​WordPress/wordpress-develop by ​@peterwilsoncc.


11 days ago
#5

Remove tests ensuring existence of jQuery and jQuery migrate tests in PHP Unit test suite as this may report false failures if the JavaScript build has not been run prior to running the test suite.

Use of AI Tools

​@peterwilsoncc commented on ​PR #15435:


11 days ago
#6

@propsbot add @SergeyBiryukov

#7 @peterwilsoncc
11 days ago

@SergeyBiryukov In ​PR#15435 I've removed test_jquery_files_exist and the associated data provider. I'll commit tomorrow AM my time once I confirm the test suite passes.

#8 @peterwilsoncc
10 days ago

  • Resolution → fixed
  • Status reopened → closed

In 65264:

External Libraries: Remove build dependent jQuery file tests.

Removes PHPUnit tests introduced in r63983 to ensure the jQuery and jQuery Migrate files are present.

These tests are causing false failures if the test suite is run without running the build step.

Follow-up to r63983.
Developed in ​https://github.com/WordPress/wordpress-develop/pull/15435.

Props sergeybiryukov.
Fixes #66203.

Note: See TracTickets for help on using tickets.