mirror of https://gitee.com/bigwinds/arangodb
remove old way to invoke unittests (#4648)
This commit is contained in:
parent
878ee09df9
commit
4edbcc58f0
|
@ -32,9 +32,6 @@ This is an overview of ArangoDB's HTTP interface for miscellaneous functions.
|
|||
<!-- lib/Admin/RestShutdownHandler.cpp -->
|
||||
@startDocuBlock JSF_get_api_initiate
|
||||
|
||||
<!-- js/actions/api-system.js -->
|
||||
@startDocuBlock JSF_post_admin_test
|
||||
|
||||
<!-- js/actions/api-system.js -->
|
||||
@startDocuBlock JSF_post_admin_execute
|
||||
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
|
||||
@startDocuBlock JSF_post_admin_test
|
||||
@brief show the available unittests on the server.
|
||||
|
||||
@RESTHEADER{POST /_admin/test, Runs tests on server}
|
||||
|
||||
@RESTALLBODYPARAM{body,object,required}
|
||||
A JSON object containing an attribute *tests* which lists the files
|
||||
containing the test suites.
|
||||
|
||||
@RESTDESCRIPTION
|
||||
|
||||
Executes the specified tests on the server and returns an object with the
|
||||
test results. The object has an attribute "error" which states whether
|
||||
any error occurred. The object also has an attribute "passed" which
|
||||
indicates which tests passed and which did not.
|
||||
@endDocuBlock
|
||||
|
|
@ -416,47 +416,6 @@ actions.defineHttp({
|
|||
}
|
||||
});
|
||||
|
||||
// //////////////////////////////////////////////////////////////////////////////
|
||||
// / @brief was docuBlock JSF_post_admin_test
|
||||
// //////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
actions.defineHttp({
|
||||
url: '_admin/test',
|
||||
prefix: false,
|
||||
|
||||
callback: function (req, res) {
|
||||
var body = actions.getJsonBody(req, res);
|
||||
|
||||
if (body === undefined) {
|
||||
return;
|
||||
}
|
||||
|
||||
var tests = body.tests;
|
||||
if (!Array.isArray(tests)) {
|
||||
actions.resultError(req, res,
|
||||
actions.HTTP_BAD, arangodb.ERROR_HTTP_BAD_PARAMETER,
|
||||
"expected attribute 'tests' is missing");
|
||||
return;
|
||||
}
|
||||
|
||||
var jsUnity = require('jsunity');
|
||||
var testResults = { passed: { }, error: false };
|
||||
|
||||
tests.forEach(function (test) {
|
||||
var result = false;
|
||||
try {
|
||||
result = jsUnity.runTest(test);
|
||||
} catch (err) {}
|
||||
testResults.passed[test] = result;
|
||||
if (!result) {
|
||||
testResults.error = true;
|
||||
}
|
||||
});
|
||||
|
||||
actions.resultOk(req, res, actions.HTTP_OK, testResults);
|
||||
}
|
||||
});
|
||||
|
||||
// //////////////////////////////////////////////////////////////////////////////
|
||||
// / @brief was docuBlock JSF_post_admin_execute
|
||||
// //////////////////////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Reference in New Issue