[wp-trac] [WordPress Trac] #50640: [PHPUnit] Mark test as skipped instead of failing if GD extension is not availble
WordPress Trac
noreply at wordpress.org
Sun Jul 12 21:15:21 UTC 2020
#50640: [PHPUnit] Mark test as skipped instead of failing if GD extension is not
availble
------------------------------+------------------------------
Reporter: ayeshrajans | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Build/Test Tools | Version:
Severity: normal | Resolution:
Keywords: has-patch close | Focuses:
------------------------------+------------------------------
Comment (by ayeshrajans):
With due respect, I would like to appeal for the ticket closure.
WordPress already has several tests being skipped due to extension
availability:
- mbstring
- xsl
- fileinfo
- openssl
- zip
Further, we already have `Tests_Image_Meta` class that skips the whole
test class if `gd` extension is not available, which is precisely what we
do in this test too. I agree about your point that this reduces test
reliability, but failing a test does not improve the system we are testing
anyway. Travis CI, for example, will have the `gd` extension in official
PHP builds (all versions WordPress officially supports have Travis tests
passing).
So on Travis, we will be running the exact same amount of assertions. We
just avoid marking a test as "failure", which should have been a "skipped"
test in a system that does not have necessary extensions to start the test
in the first place.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/50640#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list