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)
Sat, Dec 21, 12:29 AM
Unknown Object (File)
Sun, Dec 15, 3:27 PM
Unknown Object (File)
Mon, Dec 9, 5:09 AM
Unknown Object (File)
Fri, Dec 6, 12:16 PM
Unknown Object (File)
Sat, Nov 23, 6:33 PM
Unknown Object (File)
Nov 4 2024, 3:25 AM
Unknown Object (File)
Nov 4 2024, 3:24 AM
Unknown Object (File)
Oct 22 2024, 9:57 AM
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.