Page MenuHomePhabricator

Don't require the "gd" extension be installed in order to run unit tests
ClosedPublic

Authored by epriestley on Nov 30 2017, 9:47 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Feb 29, 3:42 PM
Unknown Object (File)
Feb 9 2024, 2:50 AM
Unknown Object (File)
Feb 3 2024, 5:12 PM
Unknown Object (File)
Jan 16 2024, 12:56 PM
Unknown Object (File)
Dec 25 2023, 10:49 PM
Unknown Object (File)
Dec 21 2023, 10:42 PM
Unknown Object (File)
Dec 21 2023, 10:41 PM
Unknown Object (File)
Dec 21 2023, 10:41 PM
Subscribers
None

Details

Summary

Ref T10405. If gd is not installed, a number of unit tests currently fail because they generate synthetic users and try to composite profile pictures for them.

Instead, just fall back to a static default if gd is not available.

Test Plan

Faked this pathway, created a new user, saw a default profile picture.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision is now accepted and ready to land.Nov 30 2017, 9:49 PM

I see a handful of other places where we use imagecreatefromstring(); should we be fixing those as well?

This revision was automatically updated to reflect the committed changes.

Ideally, yeah -- I merged everything I could remember/find into T10405 as a sort of umbrella for these. In this case, Lyuba was just hitting a narrow issue with getting arc diff to make it through the workflow.

These can be kind of a pain to hunt down and not having gd is rare, and some of them already get guarded in other ways, and in other cases we're probably reasonable already (we can't really do anything about actual thumbnailing, for example, I think) or the issue is entangled with other stuff (T13016 / T5258). So I didn't go on a hunting expedition, but it's definitely desirable that we're more robust against gd being missing than we currently are.