Fixes for arcanist config (#1271)

* Update arc config for ArcanistBaseUnitTestEngine -> ArcanistUnitTestEngine

Test Plan: Execute Java test suite

Reviewers: yhchiang

Differential Revision: https://reviews.facebook.net/D61911

* Fix for arc use of base64 command on Max OS X

Test Plan: Run on `arc diff` on Mac OS X and Linux

Reviewers: yhchiang

Differential Revision: https://reviews.facebook.net/D61917
This commit is contained in:
Adam Retter 2016-08-11 18:09:43 +01:00 committed by Yueh-Hsuan Chiang
parent 87c91bd876
commit db3dfb164e
4 changed files with 25 additions and 4 deletions

View File

@ -46,7 +46,7 @@ if (class_exists('ArcanistWorkflow')) {
'BaseDirectoryScopedFormatLinter' => 'cpp_linter/BaseDirectoryScopedFormatLinter.php',
'FacebookArcanistConfiguration' => 'config/FacebookOldArcanistConfiguration.php',
'FacebookFbcodeLintEngine' => 'lint_engine/FacebookFbcodeLintEngine.php',
'FacebookFbcodeUnitTestEngine' => 'unit_engine/FacebookFbcodeUnitTestEngine.php',
'FacebookFbcodeUnitTestEngine' => 'unit_engine/FacebookOldFbcodeUnitTestEngine.php',
'FacebookHowtoevenLintEngine' => 'lint_engine/FacebookHowtoevenLintEngine.php',
'FacebookHowtoevenLinter' => 'cpp_linter/FacebookHowtoevenLinter.php',
'FbcodeClangFormatLinter' => 'cpp_linter/FbcodeClangFormatLinter.php',

View File

@ -62,7 +62,9 @@ function getSteps($applyDiff, $diffID, $username, $test) {
assert(strlen($diffID) > 0);
assert(is_numeric($diffID));
$arcrc_content = exec("cat ~/.arcrc | gzip -f | base64 -w0");
$arcrc_content = (PHP_OS == "Darwin" ?
exec("cat ~/.arcrc | gzip -f | base64") :
exec("cat ~/.arcrc | gzip -f | base64 -w0"));
assert(strlen($arcrc_content) > 0);
// Sandcastle machines don't have arc setup. We copy the user certificate
@ -257,7 +259,9 @@ function getSandcastleConfig() {
// execute. Why compress the job definitions? Otherwise we run over the max
// string size.
$cmd = "echo " . base64_encode(json_encode($arg))
. " | gzip -f | base64 -w0";
. (PHP_OS == "Darwin" ?
" | gzip -f | base64" :
" | gzip -f | base64 -w0");
assert(strlen($cmd) > 0);
$arg_encoded = shell_exec($cmd);

View File

@ -4,7 +4,7 @@
// 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.
class FacebookFbcodeUnitTestEngine extends ArcanistBaseUnitTestEngine {
class FacebookFbcodeUnitTestEngine extends ArcanistUnitTestEngine {
public function run() {
// For a call to `arc call-conduit differential.updateunitresults` to

View File

@ -0,0 +1,17 @@
<?php
// Copyright 2004-present Facebook. All Rights Reserved.
// 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.
class FacebookFbcodeUnitTestEngine extends ArcanistBaseUnitTestEngine {
public function run() {
// For a call to `arc call-conduit differential.updateunitresults` to
// succeed we need at least one entry here.
$result = new ArcanistUnitTestResult();
$result->setName("dummy_placeholder_entry");
$result->setResult(ArcanistUnitTestResult::RESULT_PASS);
return array($result);
}
}