Opened 6 weeks ago
Last modified 13 days ago
#61530 new task (blessed)
Test tool and unit test improvements for 6.7
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | 6.7 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Build/Test Tools | Keywords: | has-patch has-unit-tests |
Focuses: | Cc: |
Description (last modified by )
- #60705 (6.6)
- #59647 (6.5)
- #58955 (6.4)
- #57841 (6.3)
- #56793 (6.2)
- #55652 (6.1)
- #54725 (6.0)
- #53363 (5.9)
- #52625 (5.8)
- #51802 (5.7)
- #51344 (5.6)
This ticket is for various fixes and improvements in PHPUnit tests that don't have a more specific ticket, as well as general improvements to the GitHub Actions workflows that run automated testing.
Change History (27)
This ticket was mentioned in Slack in #core by jonsurrell. View the logs.
6 weeks ago
This ticket was mentioned in PR #6765 on WordPress/wordpress-develop by @jonsurrell.
6 weeks ago
#2
- Keywords has-patch has-unit-tests added
#3
@
6 weeks ago
- Component changed from HTML API to Build/Test Tools
- Description modified (diff)
- Summary changed from HTML API: Add more tests targeting 6.7 release to Test tool and unit test improvements for 6.7
- Type changed from enhancement to task (blessed)
@jonsurrell commented on PR #6765:
6 weeks ago
#4
Good suggestions, thanks @aaronjorbin. I've applied them.
This ticket was mentioned in PR #6765 on WordPress/wordpress-develop by @jonsurrell.
6 weeks ago
#5
Trac ticket: Core-61530
Add tests for comment handling.
These tests caught a regression during the 6.6 development cycle (with processing instruction comment tag name) that was fixed, but the tests were not merged.
This ticket was mentioned in PR #6765 on WordPress/wordpress-develop by @jonsurrell.
3 weeks ago
#7
Trac ticket: Core-61530
Add tests for comment handling.
These tests caught a regression during the 6.6 development cycle (with processing instruction comment tag name) that was fixed, but the tests were not merged.
@jonsurrell commented on PR #6765:
3 weeks ago
#8
Thanks @dmsnell, I applied those suggestions and cleaned things up. The signatures do become much simpler when we split the #comment
and #funky-comment
tests.
This ticket was mentioned in PR #6765 on WordPress/wordpress-develop by @jonsurrell.
3 weeks ago
#9
Trac ticket: Core-61530
Add tests for comment handling.
These tests caught a regression during the 6.6 development cycle (with processing instruction comment tag name) that was fixed, but the tests were not merged.
This ticket was mentioned in PR #6765 on WordPress/wordpress-develop by @jonsurrell.
3 weeks ago
#10
Trac ticket: Core-61530
Add tests for comment handling.
These tests caught a regression during the 6.6 development cycle (with processing instruction comment tag name) that was fixed, but the tests were not merged.
This ticket was mentioned in PR #6765 on WordPress/wordpress-develop by @jonsurrell.
3 weeks ago
#11
Trac ticket: Core-61530
Add tests for comment handling.
These tests caught a regression during the 6.6 development cycle (with processing instruction comment tag name) that was fixed, but the tests were not merged.
This ticket was mentioned in PR #7039 on WordPress/wordpress-develop by @jrf.
3 weeks ago
#12
The ${
syntax for string interpolation was deprecated in PHP 8.2 and should not be used anymore.
Ref: https://wiki.php.net/rfc/deprecate_dollar_brace_string_interpolation
Trac ticket: https://core.trac.wordpress.org/ticket/61530
Trac ticket: https://core.trac.wordpress.org/ticket/59654
#13
@
3 weeks ago
PR GH 7039 fixes a newly introduced PHP 8.2 deprecation notice.
This was not caught by running the tests as this is a deprecation notice which is thrown at compile time, not runtime.
#14
@
3 weeks ago
Patch: https://github.com/WordPress/wordpress-develop/pull/7039
Before this patch: the deprecation is thrown at the start of running the PHP 8.2+ tests ([see it here](https://github.com/WordPress/wordpress-develop/actions/runs/9957713967/job/27510405428#logs))
Not running external-http tests. To execute these, use --group external-http. Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /var/www/tests/phpunit/tests/html-api/wpHtmlProcessorHtml5lib.php on line 257 PHPUnit 9.6.20 by Sebastian Bergmann and contributors. Runtime: PHP 8.2.21
After this patch, the deprecation is no longer thrown ✅
Marking for and preparing the commit.
@hellofromTonya commented on PR #7039:
3 weeks ago
#16
Committed via https://core.trac.wordpress.org/changeset/58733.
This ticket was mentioned in PR #7040 on WordPress/wordpress-develop by @jrf.
3 weeks ago
#17
### Tests/wpInteractivityAPIFunctions: don't declare nested named function
Once the test_process_directives_when_block_is_filtered()
method has run, the named test_render_block_data()
function declared nested within becomes part of the global namespace, which could cause problems for other tests.
Quite apart from the fact that the name starting with test_
is confusing (as methods prefixed with test_
are supposed to be test methods to be run by PHPUnit).
Using a closure for this callback fixes the issue.
### Tests/test_wp_interactivity_data_wp_context_with_different_arrays(): use data provider
Refactor the test to use a data provider with named test cases.
This is better as:
- One failing test will not block the other tests from running.
- Each test is now referenced by name in any error message, making it more straight forward to see which test failed.
- The test no longer contains multiple assertions.
- It makes it more straight forward to add additional tests.
### Tests/test_wp_interactivity_data_wp_context_with_different_arrays_and_a_namespace(): use data provider
Refactor the test to use a data provider with named test cases.
This is better as:
- One failing test will not block the other tests from running.
- Each test is now referenced by name in any error message, making it more straight forward to see which test failed.
- The test no longer contains multiple assertions.
- It makes it more straight forward to add additional tests.
### Tests/test_wp_interactivity_data_wp_context_with_json_flags(): use data provider
Refactor the test to use a data provider with named test cases.
This is better as:
- One failing test will not block the other tests from running.
- Each test is now referenced by name in any error message, making it more straight forward to see which test failed.
- The test no longer contains multiple assertions.
- It makes it more straight forward to add additional tests.
Trac ticket: https://core.trac.wordpress.org/ticket/61530
#18
follow-up:
↓ 22
@
3 weeks ago
PR GH 7040 contains some stability and maintainability improvements for the InteractivityAPI tests.
This ticket was mentioned in PR #6765 on WordPress/wordpress-develop by @jonsurrell.
3 weeks ago
#21
Trac ticket: Core-61530
Add tests for comment handling.
These tests caught a regression during the 6.6 development cycle (with processing instruction comment tag name) that was fixed, but the tests were not merged.
Add tests for comment handling.
These tests caught a regression during the 6.6 development cycle (with processing instruction comment tag name) that was fixed, but the tests were not merged.
Trac ticket: https://core.trac.wordpress.org/ticket/61530