HomePhabricator

In unit test environments, install all applications

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

Provenance
epriestleyAuthored on May 16 2013, 7:25 PM
Reviewer
wez
Differential Revision
Restricted Differential Revision
Parents
rP37e28f38130a: Minor, correct more application class name spellings.
Branches
Unknown
Tags
Unknown

Event Timeline