@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Improve performance of Phabricator unit tests

Summary: Build one fixture total, not one per test case. Depends on D5258.

Test Plan: `arc unit --everything`

Reviewers: vrana

Reviewed By: vrana

CC: aran

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

+18 -12
+18 -12
src/infrastructure/testing/PhabricatorTestCase.php
··· 56 56 return $config; 57 57 } 58 58 59 - protected function willRunTests() { 59 + public function willRunTestCases(array $test_cases) { 60 60 $root = dirname(phutil_get_library_root('phabricator')); 61 61 require_once $root.'/scripts/__init_script__.php'; 62 62 63 63 $config = $this->getComputedConfiguration(); 64 64 65 - if ($config[self::PHABRICATOR_TESTCONFIG_ISOLATE_LISK]) { 66 - LiskDAO::beginIsolateAllLiskEffectsToCurrentProcess(); 67 - } 68 - 69 65 if ($config[self::PHABRICATOR_TESTCONFIG_BUILD_STORAGE_FIXTURES]) { 70 66 ++self::$storageFixtureReferences; 71 67 if (!self::$storageFixture) { 72 68 self::$storageFixture = $this->newStorageFixture(); 73 69 } 74 70 } 71 + } 72 + 73 + public function didRunTestCases(array $test_cases) { 74 + if (self::$storageFixture) { 75 + self::$storageFixtureReferences--; 76 + if (!self::$storageFixtureReferences) { 77 + self::$storageFixture = null; 78 + } 79 + } 80 + } 81 + 82 + protected function willRunTests() { 83 + $config = $this->getComputedConfiguration(); 84 + 85 + if ($config[self::PHABRICATOR_TESTCONFIG_ISOLATE_LISK]) { 86 + LiskDAO::beginIsolateAllLiskEffectsToCurrentProcess(); 87 + } 75 88 76 89 $this->env = PhabricatorEnv::beginScopedEnv(); 77 90 } ··· 81 94 82 95 if ($config[self::PHABRICATOR_TESTCONFIG_ISOLATE_LISK]) { 83 96 LiskDAO::endIsolateAllLiskEffectsToCurrentProcess(); 84 - } 85 - 86 - if (self::$storageFixture) { 87 - self::$storageFixtureReferences--; 88 - if (!self::$storageFixtureReferences) { 89 - self::$storageFixture = null; 90 - } 91 97 } 92 98 93 99 try {