From 97fd2a6383e5836ffa8a09071a27f13e0fc3b7a3 Mon Sep 17 00:00:00 2001 From: Gunnar Kudrjavets Date: Mon, 13 Jun 2016 16:20:15 -0700 Subject: [PATCH] Remove dead Jenkins code and support `arc diff --preview` in RocksDB Summary: Two changes here: - Remove dead Jenkins related code which is no longer relevant. - Support `arc diff --preview`. Currently it doesn't work because a step which applies a diff assumes that a revision has been created. Which in case of `--preview` isn't. Therefore diff can't be applied and validation fails. Solution is to use `--nocommit` because for validation purposes performing a commit isn't necessary. Test Plan: - Current changes are submitted using `arc diff --preview`. - All the pre-commit verification tests passed. Reviewers: kradhakrishnan, sdong Reviewed By: sdong Subscribers: leveldb, andrewkr, jtolmer, dhruba Differential Revision: https://reviews.facebook.net/D59571 --- .../config/FacebookArcanistConfiguration.php | 21 +------------------ .../FacebookFbcodeUnitTestEngine.php | 16 ++++++-------- 2 files changed, 7 insertions(+), 30 deletions(-) diff --git a/arcanist_util/config/FacebookArcanistConfiguration.php b/arcanist_util/config/FacebookArcanistConfiguration.php index 5266eea55..4e936ce7e 100644 --- a/arcanist_util/config/FacebookArcanistConfiguration.php +++ b/arcanist_util/config/FacebookArcanistConfiguration.php @@ -10,7 +10,6 @@ class FacebookArcanistConfiguration extends ArcanistConfiguration { ArcanistBaseWorkflow $workflow, $error_code) { if ($command == 'diff' && !$workflow->isRawDiffSource()) { - $this->startTestsInJenkins($workflow); $this->startTestsInSandcastle($workflow); } } @@ -72,7 +71,7 @@ class FacebookArcanistConfiguration extends ArcanistConfiguration { $patch = array( "name" => "Patch " . $diffID, "shell" => "HTTPS_PROXY=fwdproxy:8080 arc --arcrc-file ~/.arcrc " - . "patch --diff " . $diffID, + . "patch --nocommit --diff " . $diffID, "user" => "root" ); @@ -185,22 +184,4 @@ class FacebookArcanistConfiguration extends ArcanistConfiguration { // Ask phabricator to display it on the diff UI $this->postURL($diffID, $sandcastle_url[1]); } - - ////////////////////////////////////////////////////////////////////// - /* Send off builds to jenkins */ - function startTestsInJenkins($workflow) { - $diffID = $workflow->getDiffID(); - if ($diffID === null) { - return; - } - - $results = $workflow->getTestResults(); - if (!$results) { - return; - } - - $url = "https://ci-builds.fb.com/view/rocksdb/job/rocksdb_diff_check/" - ."buildWithParameters?token=AUTH&DIFF_ID=$diffID"; - system("curl --noproxy '*' \"$url\" > /dev/null 2>&1"); - } } diff --git a/arcanist_util/unit_engine/FacebookFbcodeUnitTestEngine.php b/arcanist_util/unit_engine/FacebookFbcodeUnitTestEngine.php index f9a9e70e5..985bd68fc 100644 --- a/arcanist_util/unit_engine/FacebookFbcodeUnitTestEngine.php +++ b/arcanist_util/unit_engine/FacebookFbcodeUnitTestEngine.php @@ -7,15 +7,11 @@ class FacebookFbcodeUnitTestEngine extends ArcanistBaseUnitTestEngine { public function run() { - // Here we create a new unit test "jenkins_async_test" and promise we'll - // update the results later. - // Jenkins updates the results using `arc call-conduit - // differential.updateunitresults` call. If you change the name here, also - // make sure to change the name in Jenkins script that updates the test - // result -- they have to be the same. - $result = new ArcanistUnitTestResult(); - $result->setName("jenkins_async_test"); - $result->setResult(ArcanistUnitTestResult::RESULT_POSTPONED); - return array($result); + // 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); } }