mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-24 06:20:56 +01:00
Skip Mercurial tests if hg
is not present
Summary: I don't have `hg` yet on my new laptop; we should just skip tests if the user is missing binaries. Add a convenience method to do this. Test Plan: Got clean `arc unit --everything` with no `hg` installed. Reviewers: btrahan Reviewed By: btrahan Subscribers: epriestley Differential Revision: https://secure.phabricator.com/D11051
This commit is contained in:
parent
cb63a4bb6e
commit
cea1432782
4 changed files with 12 additions and 0 deletions
|
@ -15,6 +15,8 @@ final class PhabricatorWorkingCopyDiscoveryTestCase
|
|||
}
|
||||
|
||||
public function testMercurialCommitDiscovery() {
|
||||
$this->requireBinaryForTest('hg');
|
||||
|
||||
$refs = $this->discoverRefs('HT');
|
||||
$this->assertEqual(
|
||||
array(
|
||||
|
|
|
@ -10,6 +10,7 @@ final class PhabricatorWorkingCopyPullTestCase
|
|||
}
|
||||
|
||||
public function testHgPullBasic() {
|
||||
$this->requireBinaryForTest('hg');
|
||||
$repo = $this->buildPulledRepository('HT');
|
||||
|
||||
$this->assertTrue(Filesystem::pathExists($repo->getLocalPath().'/.hg'));
|
||||
|
|
|
@ -203,6 +203,8 @@ final class PhabricatorChangeParserTestCase
|
|||
}
|
||||
|
||||
public function testMercurialParser() {
|
||||
$this->requireBinaryForTest('hg');
|
||||
|
||||
$repository = $this->buildDiscoveredRepository('CHB');
|
||||
$viewer = PhabricatorUser::getOmnipotentUser();
|
||||
|
||||
|
|
|
@ -218,5 +218,12 @@ abstract class PhabricatorTestCase extends ArcanistPhutilTestCase {
|
|||
}
|
||||
}
|
||||
|
||||
protected function requireBinaryForTest($binary) {
|
||||
if (!Filesystem::binaryExists($binary)) {
|
||||
$this->assertSkipped(
|
||||
pht('No binary "%s" found on this system, skipping test.', $binary));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue