#52625 closed task (blessed) (fixed)
Test tool and unit test improvements for 5.8
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | 5.8 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Build/Test Tools | Keywords: | has-patch has-unit-tests |
Focuses: | Cc: |
Description (last modified by )
Change History (77)
This ticket was mentioned in โPR #1057 on โWordPress/wordpress-develop by โjohnbillion.
4 years ago
#4
- Keywords has-patch has-unit-tests added
โjohnbillion commented on โPR #1057:
4 years ago
#9
#10
@
4 years ago
- Description modified (diff)
- Summary changed from Unit test improvements for 5.8 to Test tool and unit test improvements for 5.8
I've been noticing a handful of small improvements that can be made for the GitHub Actions workflows.
A "catch all" ticket for those will help reduce a lot of noise and having to open new tickets. After chatting with @johnbillion, it seems this ticket could just be used. I've adjusted the title and description of this ticket to be a bit more broad to reflect this.
If anyone disagrees, we can split off a separate ticket specifically for tooling/GHA improvements.
This ticket was mentioned in โPR #1069 on โWordPress/wordpress-develop by โdesrosj.
4 years ago
#14
Trac ticket: https://core.trac.wordpress.org/ticket/52625
โdesrosj commented on โPR #1069:
4 years ago
#16
Merged into Core in https://core.trac.wordpress.org/changeset/50486.
This ticket was mentioned in โPR #1123 on โWordPress/wordpress-develop by โdesrosj.
4 years ago
#18
Trac ticket: https://core.trac.wordpress.org/ticket/52625.
โdesrosj commented on โPR #1123:
4 years ago
#42
Merged into Core in https://core.trac.wordpress.org/changeset/50579.
This ticket was mentioned in โPR #1211 on โWordPress/wordpress-develop by โdesrosj.
4 years ago
#45
The --
separator is missing from the grunt clean -- --dev
command in the test NPM workflow.
Trac ticket: https://core.trac.wordpress.org/ticket/52625
โdesrosj commented on โPR #1211:
4 years ago
#47
Merged into Core in https://core.trac.wordpress.org/changeset/50796.
This ticket was mentioned in โPR #1222 on โWordPress/wordpress-develop by โjrfnl.
4 years ago
#48
The PHPUnit 7.5+ method assertEqualsWithDelta()
is polyfilled for PHPUnit < 7.5, but also overloaded in PHPUnit 7.5 itself, which is not necessary and creates a higher chance of signature conflicts, especially when the WP test suite is used as a basis for integration tests with plugins/themes.
This small change fixes this, by:
- Changing the
version_compare()
for when to use whichWP_UnitTestCase
class to check for PHPUnit 7.5, not 7.0. - By removing the
assertEqualsWithDelta()
method overload for theTestCase
which will now only be loaded when on PHPUnit 7.5, where it is not needed as the method already exists in PHPUnit itself. - And simplifying the overloaded method which is loaded for PHPUnit < 7.5 in a way that namespaced vs non-namespaced classes in PHPUnit itself don't have to be taken into account, including removing the - now unnecessary - class alias declaration.
Trac ticket: https://core.trac.wordpress.org/ticket/52625
This ticket was mentioned in โPR #1223 on โWordPress/wordpress-develop by โjrfnl.
4 years ago
#49
Always test for newer class names first and fall back to the older. This improves compatibility when running PHPUnit via a phar while there is also a Composer installed version of PHPUnit on the system.
Trac ticket: https://core.trac.wordpress.org/ticket/52625
#50
@
4 years ago
Before I forget again... and as Trac doesn't send out notifications for GH PRs: I have opened two PRs with patches for this ticket. Review (and commit) would be very welcome ๐
PR 1222: Fixes a signature conflict issue for outside integration tests using their own PHPUnit polyfills: โhttps://github.com/WordPress/wordpress-develop/pull/1222
PR 1223: Improves compatibility with setups which run the tests via a Phar: โhttps://github.com/WordPress/wordpress-develop/pull/1223
#58
@
4 years ago
@SergeyBiryukov When you have a moment, I would really appreciate it if you could have a look at the two GitHub PRs I created for this ticket.... ๐๐ป๐
โjrfnl commented on โPR #1223:
4 years ago
#62
Closing as merged - changeset [50982]
โjrfnl commented on โPR #1222:
4 years ago
#63
Closing as merged - changeset [50986].
In 50448: