diff --git a/.arcconfig b/.arcconfig index 886b4437b..f06f31472 100644 --- a/.arcconfig +++ b/.arcconfig @@ -3,10 +3,12 @@ "conduit_uri" : "https://reviews.facebook.net/", "copyright_holder" : "Facebook", "load" : [ - "linters" + "arcanist_util" ], "lint.engine" : "FacebookFbcodeLintEngine", "lint.engine.single.linter" : "FbcodeCppLinter", + "unit.engine" : "FacebookFbcodeUnitTestEngine", + "arcanist_configuration" : "FacebookArcanistConfiguration", "base" : "git:HEAD^, hg:.^", "git.default-relative-commit" : "HEAD^", "git:arc.feature.start.default" : "origin/master", diff --git a/arcanist_util/__phutil_library_init__.php b/arcanist_util/__phutil_library_init__.php new file mode 100644 index 000000000..bc732cad6 --- /dev/null +++ b/arcanist_util/__phutil_library_init__.php @@ -0,0 +1,3 @@ + 2, 'class' => array( + 'ArcanistCpplintLinter' => 'cpp_linter/ArcanistCpplintLinter.php', + 'FacebookArcanistConfiguration' => 'config/FacebookArcanistConfiguration.php', 'FacebookFbcodeLintEngine' => 'lint_engine/FacebookFbcodeLintEngine.php', + 'FacebookFbcodeUnitTestEngine' => 'unit_engine/FacebookFbcodeUnitTestEngine.php', 'FbcodeCppLinter' => 'cpp_linter/FbcodeCppLinter.php', 'PfffCppLinter' => 'cpp_linter/PfffCppLinter.php', - 'ArcanistCpplintLinter' => 'cpp_linter/ArcanistCpplintLinter.php', ), 'function' => array( ), 'xmap' => array( + 'ArcanistCpplintLinter' => 'ArcanistLinter', + 'FacebookArcanistConfiguration' => 'ArcanistConfiguration', 'FacebookFbcodeLintEngine' => 'ArcanistLintEngine', + 'FacebookFbcodeUnitTestEngine' => 'ArcanistBaseUnitTestEngine', 'FbcodeCppLinter' => 'ArcanistLinter', 'PfffCppLinter' => 'ArcanistLinter', ), diff --git a/arcanist_util/config/FacebookArcanistConfiguration.php b/arcanist_util/config/FacebookArcanistConfiguration.php new file mode 100644 index 000000000..10c5767fa --- /dev/null +++ b/arcanist_util/config/FacebookArcanistConfiguration.php @@ -0,0 +1,32 @@ +isRawDiffSource()) { + $this->maybePushToJenkins($workflow); + } + } + + ////////////////////////////////////////////////////////////////////// + /* Send off builds to jenkins */ + function maybePushToJenkins($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/linters/cpp_linter/ArcanistCpplintLinter.php b/arcanist_util/cpp_linter/ArcanistCpplintLinter.php similarity index 100% rename from linters/cpp_linter/ArcanistCpplintLinter.php rename to arcanist_util/cpp_linter/ArcanistCpplintLinter.php diff --git a/linters/cpp_linter/FbcodeCppLinter.php b/arcanist_util/cpp_linter/FbcodeCppLinter.php similarity index 100% rename from linters/cpp_linter/FbcodeCppLinter.php rename to arcanist_util/cpp_linter/FbcodeCppLinter.php diff --git a/linters/cpp_linter/PfffCppLinter.php b/arcanist_util/cpp_linter/PfffCppLinter.php similarity index 100% rename from linters/cpp_linter/PfffCppLinter.php rename to arcanist_util/cpp_linter/PfffCppLinter.php diff --git a/linters/cpp_linter/cpplint.py b/arcanist_util/cpp_linter/cpplint.py similarity index 100% rename from linters/cpp_linter/cpplint.py rename to arcanist_util/cpp_linter/cpplint.py diff --git a/linters/lint_engine/FacebookFbcodeLintEngine.php b/arcanist_util/lint_engine/FacebookFbcodeLintEngine.php similarity index 100% rename from linters/lint_engine/FacebookFbcodeLintEngine.php rename to arcanist_util/lint_engine/FacebookFbcodeLintEngine.php diff --git a/arcanist_util/unit_engine/FacebookFbcodeUnitTestEngine.php b/arcanist_util/unit_engine/FacebookFbcodeUnitTestEngine.php new file mode 100644 index 000000000..3639f11fc --- /dev/null +++ b/arcanist_util/unit_engine/FacebookFbcodeUnitTestEngine.php @@ -0,0 +1,18 @@ +setName("jenkins_async_test"); + $result->setResult(ArcanistUnitTestResult::RESULT_POSTPONED); + return array($result); + } +} diff --git a/build_tools/trigger_jenkins_test.sh b/build_tools/trigger_jenkins_test.sh deleted file mode 100755 index 52658f9d2..000000000 --- a/build_tools/trigger_jenkins_test.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash -# usage: -# * trigger_jenkins_test.sh -- without parameters, submits the current patch to Jenkins for testing -# * trigger_jenkins_test.sh D12345 -- submits diff D12345 -if [[ $# == 0 ]]; then - diff=$(git log -1 --pretty=%b | perl -nle \ - 'm!^Differential Revision: https://reviews\.facebook\.net/(D\d+)$! and print $1') -else - diff=$1 -fi - -diff_len=`expr length "$diff"` -if [[ $diff_len < 6 ]] ; then - echo "I don't think your diff ID ($diff) is correct" - exit 1 -fi - -echo "Submitting build of diff $diff to Jenkins" -curl "https://ci-builds.fb.com/view/rocksdb/job/rocksdb_diff_check/buildWithParameters?token=AUTH&DIFF=$diff" diff --git a/linters/__phutil_library_init__.php b/linters/__phutil_library_init__.php deleted file mode 100644 index 4b8d3d131..000000000 --- a/linters/__phutil_library_init__.php +++ /dev/null @@ -1,3 +0,0 @@ -