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.

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
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; 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.