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
main
Gunnar Kudrjavets 8 years ago
parent 7c919deccc
commit 97fd2a6383
  1. 21
      arcanist_util/config/FacebookArcanistConfiguration.php
  2. 16
      arcanist_util/unit_engine/FacebookFbcodeUnitTestEngine.php

@ -10,7 +10,6 @@ class FacebookArcanistConfiguration extends ArcanistConfiguration {
ArcanistBaseWorkflow $workflow, ArcanistBaseWorkflow $workflow,
$error_code) { $error_code) {
if ($command == 'diff' && !$workflow->isRawDiffSource()) { if ($command == 'diff' && !$workflow->isRawDiffSource()) {
$this->startTestsInJenkins($workflow);
$this->startTestsInSandcastle($workflow); $this->startTestsInSandcastle($workflow);
} }
} }
@ -72,7 +71,7 @@ class FacebookArcanistConfiguration extends ArcanistConfiguration {
$patch = array( $patch = array(
"name" => "Patch " . $diffID, "name" => "Patch " . $diffID,
"shell" => "HTTPS_PROXY=fwdproxy:8080 arc --arcrc-file ~/.arcrc " "shell" => "HTTPS_PROXY=fwdproxy:8080 arc --arcrc-file ~/.arcrc "
. "patch --diff " . $diffID, . "patch --nocommit --diff " . $diffID,
"user" => "root" "user" => "root"
); );
@ -185,22 +184,4 @@ class FacebookArcanistConfiguration extends ArcanistConfiguration {
// Ask phabricator to display it on the diff UI // Ask phabricator to display it on the diff UI
$this->postURL($diffID, $sandcastle_url[1]); $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");
}
} }

@ -7,15 +7,11 @@
class FacebookFbcodeUnitTestEngine extends ArcanistBaseUnitTestEngine { class FacebookFbcodeUnitTestEngine extends ArcanistBaseUnitTestEngine {
public function run() { public function run() {
// Here we create a new unit test "jenkins_async_test" and promise we'll // For a call to `arc call-conduit differential.updateunitresults` to
// update the results later. // succeed we need at least one entry here.
// Jenkins updates the results using `arc call-conduit $result = new ArcanistUnitTestResult();
// differential.updateunitresults` call. If you change the name here, also $result->setName("dummy_placeholder_entry");
// make sure to change the name in Jenkins script that updates the test $result->setResult(ArcanistUnitTestResult::RESULT_PASS);
// result -- they have to be the same. return array($result);
$result = new ArcanistUnitTestResult();
$result->setName("jenkins_async_test");
$result->setResult(ArcanistUnitTestResult::RESULT_POSTPONED);
return array($result);
} }
} }

Loading…
Cancel
Save