mirror of https://gitee.com/bigwinds/arangodb
Merge branch 'devel' of https://github.com/arangodb/arangodb into devel
This commit is contained in:
commit
fdf0b557e5
35
.travis.yml
35
.travis.yml
|
@ -1,3 +1,18 @@
|
|||
branches:
|
||||
only:
|
||||
- master
|
||||
- 1.0
|
||||
- 1.1
|
||||
- 1.2
|
||||
- 1.3
|
||||
- 1.4
|
||||
- 2.0
|
||||
- 2.1
|
||||
- 2.2
|
||||
- 2.3
|
||||
- 2.4
|
||||
- devel
|
||||
|
||||
language: cpp
|
||||
compiler: g++
|
||||
|
||||
|
@ -27,20 +42,8 @@ install:
|
|||
- sudo apt-get -y install gdb
|
||||
|
||||
before_script: "bash -c Installation/travisCI/before_script.sh"
|
||||
script: "bash -c Installation/travisCI/script.sh"
|
||||
script:
|
||||
- "bash -c Installation/travisCI/build.sh"
|
||||
- "bash -c Installation/travisCI/jslint.sh"
|
||||
- "bash -c Installation/travisCI/tests.sh"
|
||||
after_failure: "bash -c Installation/travisCI/after_failure.sh"
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- 1.0
|
||||
- 1.1
|
||||
- 1.2
|
||||
- 1.3
|
||||
- 1.4
|
||||
- 2.0
|
||||
- 2.1
|
||||
- 2.2
|
||||
- 2.3
|
||||
- 2.4
|
||||
- devel
|
||||
|
||||
|
|
|
@ -165,14 +165,15 @@ instead.
|
|||
*false*, any return value of the visitor function will be ignored. Instead, the visitor
|
||||
function can modify its *result* parameter value in-place. At the end of the traversal,
|
||||
*result* is expected to be an array.
|
||||
|
||||
- *data*: only useful in combination with a custom AQL visitor function. This attribute can
|
||||
|
||||
- *data*: only useful in combination with custom AQL visitor or filter functions. This attribute can
|
||||
be used to pass arbitrary data into the custom visitor function. The value contained in the
|
||||
*data* attribute will be made available to the *visitor* function in the *config.data*
|
||||
*data* attribute will be made available to the *visitor* and *filterVertices* functions in the *config.data*
|
||||
attribute.
|
||||
|
||||
By default, the result of the TRAVERSAL function is an array of traversed points. Each point
|
||||
is an object consisting of the following attributes:
|
||||
|
||||
- *vertex*: The vertex at the traversal point
|
||||
- *path*: The path history for the traversal point. The path is a document with the
|
||||
attributes *vertices* and *edges*, which are both arrays. Note that *path* is only present
|
||||
|
@ -239,7 +240,10 @@ instead.
|
|||
order: "preorder-expander"
|
||||
})
|
||||
|
||||
// registering the custom leaf node visitor function
|
||||
// to register the custom AQL function visitor that only returns leaf nodes, run
|
||||
// the following commands in arangosh once:
|
||||
var aqlfunctions = require("org/arangodb/aql/functions");
|
||||
|
||||
aqlfunctions.register("myfunctions::leafnodevisitor", function (config, vertex, edge, path, connections) {
|
||||
if (connected && connected.length === 0) {
|
||||
// will put the vertex into the result if it does not have any further connections
|
||||
|
@ -269,6 +273,19 @@ instead.
|
|||
}, false);
|
||||
|
||||
|
||||
// using one of the predefined visitor functions
|
||||
TRAVERSAL(friends, friendrelations, "friends/john", "outbound", {
|
||||
visitor: "_AQL::COUNTINGVISITOR"
|
||||
})
|
||||
|
||||
|
||||
// passing data into a visitor
|
||||
TRAVERSAL(friends, friendrelations, "friends/john", "outbound", {
|
||||
visitor: "_AQL::PROJECTINGVISITOR",
|
||||
data: { attributes: [ "_id", "_key", "name" ] }
|
||||
})
|
||||
|
||||
|
||||
- *TRAVERSAL_TREE(vertexcollection, edgecollection, startVertex, direction, connectName, options)*:
|
||||
Traverses the graph described by *vertexcollection* and *edgecollection*,
|
||||
starting at the vertex identified by id *startVertex* and creates a hierarchical result.
|
||||
|
@ -343,6 +360,7 @@ instead.
|
|||
function (config, vertex, path)
|
||||
|
||||
If a custom AQL function is used, it is expected to return one of the following values:
|
||||
|
||||
- *[ ]*: Include the vertex in the result and descend into its connected edges
|
||||
- *[ "prune" ]*: Will include the vertex in the result but not descend into its connected edges
|
||||
- *[ "exclude" ]*: Will not include the vertex in the result but descend into its connected edges
|
||||
|
@ -372,6 +390,10 @@ instead.
|
|||
function can modify its *result* parameter value in-place. At the end of the traversal,
|
||||
*result* is expected to be an array.
|
||||
|
||||
- *data*: only useful in combination with custom AQL visitor or filter functions. This attribute can
|
||||
be used to pass arbitrary data into the custom visitor function. The value contained in the
|
||||
*data* attribute will be made available to the *visitor* and *filterVertices* functions in the *config.data*
|
||||
attribute.
|
||||
|
||||
By default, the result of the SHORTEST_PATH function is an array with the components of the
|
||||
shortest path. Each component is a document consisting of the following attributes:
|
||||
|
|
|
@ -313,6 +313,24 @@ function GET_FILTER (name, config) {
|
|||
};
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief create a user-defined expand filter from a function name
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
function GET_EXPANDFILTER (name, config) {
|
||||
var func = GET_USERFUNCTION(name, config);
|
||||
|
||||
return function (config, vertex, edge, path) {
|
||||
try {
|
||||
var filterResult = func.apply(null, arguments);
|
||||
return FIX_VALUE(filterResult);
|
||||
}
|
||||
catch (err) {
|
||||
WARN(name, INTERNAL.errors.ERROR_QUERY_FUNCTION_RUNTIME_ERROR, AQL_TO_STRING(err));
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief normalise a function name
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -5118,10 +5136,7 @@ function TRAVERSAL_FUNC (func,
|
|||
|
||||
if (params.followEdges) {
|
||||
if (typeof params.followEdges === 'string') {
|
||||
var f1 = params.followEdges.toUpperCase();
|
||||
config.expandFilter = function (config, vertex, edge, path) {
|
||||
return FCALL_USER(f1, [ config, vertex, edge, path ]);
|
||||
};
|
||||
config.expandFilter = GET_EXPANDFILTER(params.followEdges, params);
|
||||
}
|
||||
else {
|
||||
config.expandFilter = TRAVERSAL_EDGE_EXAMPLE_FILTER;
|
||||
|
@ -5135,10 +5150,7 @@ function TRAVERSAL_FUNC (func,
|
|||
|
||||
if (params.filterVertices) {
|
||||
if (typeof params.filterVertices === 'string') {
|
||||
var f2 = params.filterVertices.toUpperCase();
|
||||
config.filter = function (config, vertex, edge, path) {
|
||||
return FCALL_USER(f2, [ config, vertex, path ]);
|
||||
};
|
||||
config.filter = GET_FILTER(params.filterVertices, params);
|
||||
}
|
||||
else {
|
||||
config.filter = TRAVERSAL_VERTEX_FILTER;
|
||||
|
@ -5512,11 +5524,6 @@ function SHORTEST_PATH_PARAMS (params) {
|
|||
params.visitor = TRAVERSAL_VISITOR;
|
||||
}
|
||||
|
||||
// add user-defined filter, if specified
|
||||
if (typeof params.filter === "string") {
|
||||
params.filter = GET_FILTER(params.filter, params);
|
||||
}
|
||||
|
||||
if (typeof params.distance === "string") {
|
||||
var name = params.distance.toUpperCase();
|
||||
|
||||
|
@ -5742,11 +5749,6 @@ function TRAVERSAL_PARAMS (params) {
|
|||
params.visitor = TRAVERSAL_VISITOR;
|
||||
}
|
||||
|
||||
// add user-defined filter, if specified
|
||||
if (typeof params.filter === "string") {
|
||||
params.filter = GET_FILTER(params.filter, params);
|
||||
}
|
||||
|
||||
return params;
|
||||
}
|
||||
|
||||
|
@ -6101,11 +6103,6 @@ function TRAVERSAL_TREE_PARAMS (params, connectName, func) {
|
|||
params.visitor = TRAVERSAL_TREE_VISITOR;
|
||||
}
|
||||
|
||||
// add user-defined filter, if specified
|
||||
if (typeof params.filter === "string") {
|
||||
params.filter = GET_FILTER(params.filter, params);
|
||||
}
|
||||
|
||||
params.connect = AQL_TO_STRING(connectName);
|
||||
|
||||
if (params.connect === "") {
|
||||
|
|
|
@ -367,6 +367,25 @@ function startInstance (protocol, options, addArgs, testname) {
|
|||
return instanceInfo;
|
||||
}
|
||||
|
||||
function readImportantLogLines(logFilename) {
|
||||
var importantLines = [];
|
||||
var buf = fs.readBuffer(logFilename);
|
||||
var i;
|
||||
var lineStart = 0;
|
||||
var maxBuffer = buf.length;
|
||||
for (i = 0; i < maxBuffer; i++) {
|
||||
if (buf[i] === 10) { // \n
|
||||
var line = buf.asciiSlice(lineStart, i - 1);
|
||||
// filter out regular INFO lines, and test related messages
|
||||
if ((line.search(" INFO ") < 0) &&
|
||||
(line.search("WARNING about to execute:") < 0) {
|
||||
importantLines.push(line);
|
||||
}
|
||||
lineStart = i + 1;
|
||||
}
|
||||
}
|
||||
return importantLines;
|
||||
}
|
||||
|
||||
function copy (src, dst) {
|
||||
var fs = require("fs");
|
||||
|
@ -503,6 +522,8 @@ function shutdownInstance (instanceInfo, options) {
|
|||
}
|
||||
|
||||
}
|
||||
instanceInfo.importantLogLines = readImportantLogLines(fs.join(instanceInfo.tmpDataDir, "log"));
|
||||
|
||||
cleanupDirectories = cleanupDirectories.concat([instanceInfo.tmpDataDir, instanceInfo.flatTmpDataDir]);
|
||||
}
|
||||
|
||||
|
@ -792,6 +813,9 @@ function performTests(options, testList, testname, remote) {
|
|||
shutdownInstance(instanceInfo,options);
|
||||
}
|
||||
print("done.");
|
||||
if (instanceInfo.hasOwnProperty('importantLogLines') && instanceInfo.importantLogLines.length > 0) {
|
||||
print("Found messages in the server logs: \n" + yaml.safeDump(instanceInfo.importantLogLines));
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
|
@ -828,6 +852,10 @@ testFuncs.single_server = function (options) {
|
|||
}
|
||||
shutdownInstance(instanceInfo,options);
|
||||
print("done.");
|
||||
|
||||
if (instanceInfo.hasOwnProperty('importantLogLines') && instanceInfo.importantLogLines.length > 0) {
|
||||
print("Found messages in the server logs: \n" + yaml.safeDump(instanceInfo.importantLogLines));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
else {
|
||||
|
@ -872,6 +900,9 @@ testFuncs.single_client = function (options) {
|
|||
}
|
||||
shutdownInstance(instanceInfo,options);
|
||||
print("done.");
|
||||
if (instanceInfo.hasOwnProperty('importantLogLines') && instanceInfo.importantLogLines.length > 0) {
|
||||
print("Found messages in the server logs: \n" + yaml.safeDump(instanceInfo.importantLogLines));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
else {
|
||||
|
@ -989,6 +1020,9 @@ testFuncs.shell_client = function(options) {
|
|||
print("Shutting down...");
|
||||
shutdownInstance(instanceInfo, options);
|
||||
print("done.");
|
||||
if (instanceInfo.hasOwnProperty('importantLogLines') && instanceInfo.importantLogLines.length > 0) {
|
||||
print("Found messages in the server logs: \n" + yaml.safeDump(instanceInfo.importantLogLines));
|
||||
}
|
||||
return results;
|
||||
};
|
||||
|
||||
|
@ -1114,6 +1148,9 @@ function rubyTests (options, ssl) {
|
|||
fs.remove(tmpname);
|
||||
shutdownInstance(instanceInfo,options);
|
||||
print("done.");
|
||||
if (instanceInfo.hasOwnProperty('importantLogLines') && instanceInfo.importantLogLines.length > 0) {
|
||||
print("Found messages in the server logs: \n" + yaml.safeDump(instanceInfo.importantLogLines));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -1256,6 +1293,9 @@ testFuncs.importing = function (options) {
|
|||
print("Shutting down...");
|
||||
shutdownInstance(instanceInfo,options);
|
||||
print("done.");
|
||||
if (instanceInfo.hasOwnProperty('importantLogLines') && instanceInfo.importantLogLines.length > 0) {
|
||||
print("Found messages in the server logs: \n" + yaml.safeDump(instanceInfo.importantLogLines));
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
|
@ -1315,6 +1355,9 @@ testFuncs.foxx_manager = function (options) {
|
|||
print("Shutting down...");
|
||||
shutdownInstance(instanceInfo,options);
|
||||
print("done.");
|
||||
if (instanceInfo.hasOwnProperty('importantLogLines') && instanceInfo.importantLogLines.length > 0) {
|
||||
print("Found messages in the server logs: \n" + yaml.safeDump(instanceInfo.importantLogLines));
|
||||
}
|
||||
return results;
|
||||
};
|
||||
|
||||
|
@ -1349,6 +1392,9 @@ testFuncs.dump = function (options) {
|
|||
print("Shutting down...");
|
||||
shutdownInstance(instanceInfo,options);
|
||||
print("done.");
|
||||
if (instanceInfo.hasOwnProperty('importantLogLines') && instanceInfo.importantLogLines.length > 0) {
|
||||
print("Found messages in the server logs: \n" + yaml.safeDump(instanceInfo.importantLogLines));
|
||||
}
|
||||
return results;
|
||||
};
|
||||
|
||||
|
@ -1409,6 +1455,9 @@ testFuncs.arangob = function (options) {
|
|||
print("Shutting down...");
|
||||
shutdownInstance(instanceInfo,options);
|
||||
print("done.");
|
||||
if (instanceInfo.hasOwnProperty('importantLogLines') && instanceInfo.importantLogLines.length > 0) {
|
||||
print("Found messages in the server logs: \n" + yaml.safeDump(instanceInfo.importantLogLines));
|
||||
}
|
||||
return results;
|
||||
};
|
||||
|
||||
|
@ -1426,6 +1475,9 @@ testFuncs.authentication = function (options) {
|
|||
print("Shutting down...");
|
||||
shutdownInstance(instanceInfo,options);
|
||||
print("done.");
|
||||
if (instanceInfo.hasOwnProperty('importantLogLines') && instanceInfo.importantLogLines.length > 0) {
|
||||
print("Found messages in the server logs: \n" + yaml.safeDump(instanceInfo.importantLogLines));
|
||||
}
|
||||
return results;
|
||||
};
|
||||
|
||||
|
@ -1493,6 +1545,9 @@ testFuncs.authentication_parameters = function (options) {
|
|||
|
||||
print("Shutting down Full test...");
|
||||
shutdownInstance(instanceInfo,options);
|
||||
if (instanceInfo.hasOwnProperty('importantLogLines') && instanceInfo.importantLogLines.length > 0) {
|
||||
print("Found messages in the server logs: \n" + yaml.safeDump(instanceInfo.importantLogLines));
|
||||
}
|
||||
print("done with Full test.");
|
||||
// Only system authentication:
|
||||
continueTesting = true;
|
||||
|
@ -1533,6 +1588,9 @@ testFuncs.authentication_parameters = function (options) {
|
|||
|
||||
print("Shutting down System test...");
|
||||
shutdownInstance(instanceInfo,options);
|
||||
if (instanceInfo.hasOwnProperty('importantLogLines') && instanceInfo.importantLogLines.length > 0) {
|
||||
print("Found messages in the server logs: \n" + yaml.safeDump(instanceInfo.importantLogLines));
|
||||
}
|
||||
print("done with System test.");
|
||||
// No authentication:
|
||||
instanceInfo = startInstance("tcp", options,
|
||||
|
@ -1574,6 +1632,9 @@ testFuncs.authentication_parameters = function (options) {
|
|||
|
||||
print("Shutting down None test...");
|
||||
shutdownInstance(instanceInfo,options);
|
||||
if (instanceInfo.hasOwnProperty('importantLogLines') && instanceInfo.importantLogLines.length > 0) {
|
||||
print("Found messages in the server logs: \n" + yaml.safeDump(instanceInfo.importantLogLines));
|
||||
}
|
||||
print("done with None test.");
|
||||
return results;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue