From fe8f0aea9cd5179e28ea033433837c375ce3bc20 Mon Sep 17 00:00:00 2001 From: epriestley Date: Thu, 27 Sep 2018 10:39:23 -0700 Subject: [PATCH] [Wilds] Make "Bundle" test cases pass Summary: Ref T13098. Continue to chip away at unit tests. I stubbed out the read of configuration directly from `RepositoryAPI` and would like to remove it later. This is the only configuration value that `RepositoryAPI` reads directly. Instead, I suspect this will be cleaner if higher-level callers are responsible for reading and applying commit range rules and the actual `RepositorAPI` object does not know about them. (In this particular case it's pretty moot anyway since unit tests shouldn't depend on `.arcconfig` settings.) Test Plan: Ran unit tests, got slightly fewer failures. Reviewers: amckinley Reviewed By: amckinley Maniphest Tasks: T13098 Differential Revision: https://secure.phabricator.com/D19713 --- src/parser/__tests__/ArcanistBundleTestCase.php | 9 ++++----- src/repository/api/ArcanistRepositoryAPI.php | 3 +-- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/parser/__tests__/ArcanistBundleTestCase.php b/src/parser/__tests__/ArcanistBundleTestCase.php index 0b183324..4ddf32a3 100644 --- a/src/parser/__tests__/ArcanistBundleTestCase.php +++ b/src/parser/__tests__/ArcanistBundleTestCase.php @@ -111,14 +111,13 @@ EODIFF; execx('git reset --hard %s --', $commit_hash); $fixture_path = $fixture->getPath(); - $working_copy = ArcanistWorkingCopyIdentity::newFromPath($fixture_path); + $working_copy = ArcanistWorkingCopy::newFromWorkingDirectory( + $fixture_path); - $configuration_manager = new ArcanistConfigurationManager(); - $configuration_manager->setWorkingCopyIdentity($working_copy); - $repository_api = ArcanistRepositoryAPI::newAPIFromConfigurationManager( - $configuration_manager); + $repository_api = $working_copy->newRepositoryAPI(); $repository_api->setBaseCommitArgumentRules('arc:this'); + $diff = $repository_api->getFullGitDiff( $repository_api->getBaseCommit(), $repository_api->getHeadCommit()); diff --git a/src/repository/api/ArcanistRepositoryAPI.php b/src/repository/api/ArcanistRepositoryAPI.php index 41b7840f..7774670d 100644 --- a/src/repository/api/ArcanistRepositoryAPI.php +++ b/src/repository/api/ArcanistRepositoryAPI.php @@ -657,9 +657,8 @@ abstract class ArcanistRepositoryAPI extends Phobject { 'user' => '', 'system' => '', ); - $all_sources = $this->configurationManager->getConfigFromAllSources('base'); - $base_commit_rules = $all_sources + $base_commit_rules; + // TOOLSETS: Handle "base" configuration. $parser = new ArcanistBaseCommitParser($this); $commit = $parser->resolveBaseCommit($base_commit_rules);