2015-04-07 18:56:29 +00:00
|
|
|
<?php
|
|
|
|
// Copyright 2004-present Facebook. All Rights Reserved.
|
2015-08-10 20:58:55 +00:00
|
|
|
// This source code is licensed under the BSD-style license found in the
|
|
|
|
// LICENSE file in the root directory of this source tree. An additional grant
|
|
|
|
// of patent rights can be found in the PATENTS file in the same directory.
|
2016-06-21 18:38:54 +00:00
|
|
|
|
|
|
|
require('RocksDBCommonHelper.php');
|
|
|
|
|
|
|
|
define("DIFF_COMMAND", "diff");
|
|
|
|
|
2015-04-07 18:56:29 +00:00
|
|
|
class FacebookArcanistConfiguration extends ArcanistConfiguration {
|
2017-02-02 21:18:53 +00:00
|
|
|
public function getCustomArgumentsForCommand($command) {
|
|
|
|
if ($command == "land") {
|
|
|
|
return array(
|
|
|
|
'async' => array('help' => 'Just to make tools happy'));
|
|
|
|
}
|
|
|
|
return array();
|
|
|
|
}
|
2015-04-07 18:56:29 +00:00
|
|
|
|
|
|
|
public function didRunWorkflow($command,
|
2016-06-17 11:36:52 +00:00
|
|
|
ArcanistWorkflow $workflow,
|
2015-04-07 18:56:29 +00:00
|
|
|
$error_code) {
|
2016-06-21 18:38:54 +00:00
|
|
|
// Default options don't terminate on failure, but that's what we want. In
|
|
|
|
// the current case we use assertions intentionally as "terminate on failure
|
|
|
|
// invariants".
|
|
|
|
assert_options(ASSERT_BAIL, true);
|
|
|
|
|
|
|
|
assert($workflow);
|
|
|
|
assert(strlen($command) > 0);
|
|
|
|
|
|
|
|
if ($command == DIFF_COMMAND && !$workflow->isRawDiffSource()) {
|
|
|
|
$diffID = $workflow->getDiffId();
|
|
|
|
|
|
|
|
// When submitting a diff this code path gets executed multiple times in
|
|
|
|
// a row. We only care about the case when ID for the diff is provided
|
|
|
|
// because that's what we need to apply the diff and trigger the tests.
|
|
|
|
if (strlen($diffID) > 0) {
|
|
|
|
assert(is_numeric($diffID));
|
|
|
|
startTestsInSandcastle(true /* $applyDiff */, $workflow, $diffID);
|
|
|
|
}
|
2016-06-14 23:13:08 +00:00
|
|
|
}
|
2016-01-19 23:33:20 +00:00
|
|
|
}
|
2015-04-07 18:56:29 +00:00
|
|
|
}
|