From db3dfb164e2fa84bfb75b3bf20eb19a965039c18 Mon Sep 17 00:00:00 2001 From: Adam Retter Date: Thu, 11 Aug 2016 18:09:43 +0100 Subject: [PATCH] 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 --- arcanist_util/__phutil_library_map__.php | 2 +- arcanist_util/config/RocksDBCommonHelper.php | 8 ++++++-- .../FacebookFbcodeUnitTestEngine.php | 2 +- .../FacebookOldFbcodeUnitTestEngine.php | 17 +++++++++++++++++ 4 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 arcanist_util/unit_engine/FacebookOldFbcodeUnitTestEngine.php diff --git a/arcanist_util/__phutil_library_map__.php b/arcanist_util/__phutil_library_map__.php index e3117382b..84ebc7b0a 100644 --- a/arcanist_util/__phutil_library_map__.php +++ b/arcanist_util/__phutil_library_map__.php @@ -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', diff --git a/arcanist_util/config/RocksDBCommonHelper.php b/arcanist_util/config/RocksDBCommonHelper.php index 28ee90a90..cc876c457 100644 --- a/arcanist_util/config/RocksDBCommonHelper.php +++ b/arcanist_util/config/RocksDBCommonHelper.php @@ -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); diff --git a/arcanist_util/unit_engine/FacebookFbcodeUnitTestEngine.php b/arcanist_util/unit_engine/FacebookFbcodeUnitTestEngine.php index 985bd68fc..62c275f6a 100644 --- a/arcanist_util/unit_engine/FacebookFbcodeUnitTestEngine.php +++ b/arcanist_util/unit_engine/FacebookFbcodeUnitTestEngine.php @@ -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 diff --git a/arcanist_util/unit_engine/FacebookOldFbcodeUnitTestEngine.php b/arcanist_util/unit_engine/FacebookOldFbcodeUnitTestEngine.php new file mode 100644 index 000000000..985bd68fc --- /dev/null +++ b/arcanist_util/unit_engine/FacebookOldFbcodeUnitTestEngine.php @@ -0,0 +1,17 @@ +setName("dummy_placeholder_entry"); + $result->setResult(ArcanistUnitTestResult::RESULT_PASS); + return array($result); + } +}