Homec4science

In unit test environments, install all applications

Authored by epriestley <git@epriestley.com> on May 16 2013, 21:25.

Description

In unit test environments, install all applications

Summary:
Normalize the unit test environment by installing all applications.

The immediate issue this fixes is that testDropUnknownSenderMail depends on Maniphest being installed. Some possible fixes are:

  1. Don't rely on the Maniphest mail receiver for the test (e.g., write a stub/dummy/mock receiver).
  2. Explicitly make sure Maniphest is installed before running the test.
  3. Normalize the test environment to install all applications.

I don't like (1) much because it turns a pretty good 10 line test into a bunch of stub classes or mock junk. I'll do it if we have more uses after a few more diffs, but so far running these tests against real code hasn't created a dependency mess and we get more coverage.

I don't like (2) much because I think requiring tests to do this will do more harm than good. The number of issues we'll hypothetically uncover by exposing unrealized application interdependencies is probably very small or maybe zero, and they're probably all trivial. But tests with an undeclared but implicit dependency on an application (e.g., Differential tests depend on Differential) are common.

So here's (3), which I think is reasonable.

I also simplified some of this code a little bit, and moved the Application object cache one level down (this was sort of a bug -- installation status is variant across requests).

Test Plan: Added unit test.

Reviewers: wez, btrahan

Reviewed By: wez

CC: aran

Differential Revision: https://secure.phabricator.com/D5938

Details

Committed
epriestley <git@epriestley.com>May 16 2013, 21:25
Pushed
aubortJan 31 2017, 17:16
Parents
rPH37e28f38130a: Minor, correct more application class name spellings.
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPH0aa67025f25d: In unit test environments, install all applications (authored by epriestley <git@epriestley.com>).May 16 2013, 21:25