mirror of https://gitee.com/bigwinds/arangodb
Merge branch 'devel' of https://github.com/arangodb/arangodb into aql-jmmh-conditions
Conflicts: arangod/Aql/ExecutionNode.cpp
This commit is contained in:
commit
1c990b7324
|
@ -931,11 +931,11 @@ void ExecutionNode::RegisterPlan::after (ExecutionNode *en) {
|
|||
|
||||
auto ep = static_cast<EnumerateCollectionNode const*>(en);
|
||||
TRI_ASSERT(ep != nullptr);
|
||||
varInfo.emplace(ep->_outVariable->id, VarInfo(depth, totalNrRegs));
|
||||
varInfo.emplace(ep->outVariable()->id, VarInfo(depth, totalNrRegs));
|
||||
totalNrRegs++;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
case ExecutionNode::INDEX_RANGE: {
|
||||
depth++;
|
||||
nrRegsHere.emplace_back(1);
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
var FoxxManager = require("org/arangodb/foxx/manager");
|
||||
var fs = require("fs");
|
||||
var db = require("internal").db;
|
||||
var basePath = fs.makeAbsolute(fs.join(module.startupPath(), "common", "test-data", "apps"));
|
||||
var basePath = fs.makeAbsolute(fs.join(require("internal").startupPath, "common", "test-data", "apps"));
|
||||
var arango = require("org/arangodb").arango;
|
||||
var originalEndpoint = arango.getEndpoint().replace(/localhost/, '127.0.0.1');
|
||||
|
|
@ -180,7 +180,7 @@ function Done (suiteName) {
|
|||
/// @brief runs a JSUnity test file
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
function RunTest (path) {
|
||||
function RunTest (path, outputReply) {
|
||||
var content;
|
||||
var f;
|
||||
|
||||
|
@ -193,7 +193,13 @@ function RunTest (path) {
|
|||
throw "cannot create context function";
|
||||
}
|
||||
|
||||
return f(path);
|
||||
var rc = f(path);
|
||||
if (outputReply === true) {
|
||||
return rc;
|
||||
}
|
||||
else {
|
||||
return rc.status;
|
||||
}
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
|
|
@ -14,13 +14,13 @@ function runJSUnityTests(tests) {
|
|||
var allResults = [];
|
||||
var res;
|
||||
|
||||
// find out whether we're on server or client...
|
||||
var runenvironment = "arangod";
|
||||
if (typeof(require('internal').arango) === 'object') {
|
||||
runenvironment = "arangosh";
|
||||
}
|
||||
|
||||
_.each(tests, function (file) {
|
||||
// find out whether we're on server or client...
|
||||
var runenvironment = "arangod";
|
||||
if (typeof(require('internal').arango) === 'object') {
|
||||
runenvironment = "arangosh";
|
||||
}
|
||||
|
||||
if (result) {
|
||||
print("\n" + Date() + " " + runenvironment + ": Running JSUnity test from file '" + file + "'");
|
||||
} else {
|
||||
|
@ -29,7 +29,7 @@ function runJSUnityTests(tests) {
|
|||
}
|
||||
|
||||
try {
|
||||
res = runTest(file);
|
||||
res = runTest(file, true);
|
||||
allResults.push(res);
|
||||
result = result && res.status;
|
||||
} catch (err) {
|
||||
|
@ -69,7 +69,7 @@ function runCommandLineTests(opts) {
|
|||
options = opts || {},
|
||||
jasmineReportFormat = options.jasmineReportFormat || 'progress',
|
||||
unitTests = internal.unitTests(),
|
||||
isSpecRegEx = /.+spec\.js/,
|
||||
isSpecRegEx = /.+-spec.*\.js/,
|
||||
isSpec = function (unitTest) {
|
||||
return isSpecRegEx.test(unitTest);
|
||||
},
|
||||
|
|
|
@ -141,7 +141,8 @@ var optionsDefaults = { "cluster": false,
|
|||
"valgrindargs": [],
|
||||
"valgrindXmlFileBase" : "",
|
||||
"extraargs": [],
|
||||
"coreDirectory": "/var/tmp"
|
||||
"coreDirectory": "/var/tmp",
|
||||
"writeXmlReport": true
|
||||
|
||||
};
|
||||
var allTests =
|
||||
|
@ -866,7 +867,7 @@ function runThere (options, instanceInfo, file) {
|
|||
var t;
|
||||
if (file.indexOf("-spec") === -1) {
|
||||
t = 'var runTest = require("jsunity").runTest; '+
|
||||
'return runTest(' + JSON.stringify(file) + ');';
|
||||
'return runTest(' + JSON.stringify(file) + ', true);';
|
||||
}
|
||||
else {
|
||||
var jasmineReportFormat = options.jasmineReportFormat || 'progress';
|
||||
|
@ -911,7 +912,7 @@ function runHere (options, instanceInfo, file) {
|
|||
try {
|
||||
if (file.indexOf("-spec") === -1) {
|
||||
var runTest = require("jsunity").runTest;
|
||||
result = runTest(file);
|
||||
result = runTest(file, true);
|
||||
}
|
||||
else {
|
||||
var jasmineReportFormat = options.jasmineReportFormat || 'progress';
|
||||
|
@ -1109,6 +1110,7 @@ function single_usage (testsuite, list) {
|
|||
|
||||
testFuncs.single_server = function (options) {
|
||||
var result = { };
|
||||
options.writeXmlReport = false;
|
||||
if (options.test !== undefined) {
|
||||
var instanceInfo = startInstance("tcp", options, [], "single_server");
|
||||
if (instanceInfo === false) {
|
||||
|
@ -1146,6 +1148,7 @@ testFuncs.single_server = function (options) {
|
|||
|
||||
testFuncs.single_localserver = function (options) {
|
||||
var result = { };
|
||||
options.writeXmlReport = false;
|
||||
if (options.test !== undefined) {
|
||||
var instanceInfo;
|
||||
var te = options.test;
|
||||
|
@ -1165,6 +1168,7 @@ testFuncs.single_localserver = function (options) {
|
|||
|
||||
testFuncs.single_client = function (options) {
|
||||
var result = { };
|
||||
options.writeXmlReport = false;
|
||||
if (options.test !== undefined) {
|
||||
var instanceInfo = startInstance("tcp", options, [], "single_client");
|
||||
if (instanceInfo === false) {
|
||||
|
@ -2080,7 +2084,19 @@ testFuncs.authentication_parameters = function (options) {
|
|||
return results;
|
||||
};
|
||||
|
||||
var internalMembers = ["code", "error", "status", "duration", "failed", "total", "crashed", "all_ok", "ok", "message"];
|
||||
var internalMembers = [
|
||||
"code",
|
||||
"error",
|
||||
"status",
|
||||
"duration",
|
||||
"failed",
|
||||
"total",
|
||||
"crashed",
|
||||
"all_ok",
|
||||
"ok",
|
||||
"message",
|
||||
"suiteName"
|
||||
];
|
||||
|
||||
function unitTestPrettyPrintResults(r) {
|
||||
var testrun;
|
||||
|
|
23
scripts/run
23
scripts/run
|
@ -1,6 +1,5 @@
|
|||
#!/bin/bash
|
||||
export PID=$$
|
||||
mkdir data-$PID
|
||||
|
||||
self=$0
|
||||
if test -f "${self}.js"; then
|
||||
|
@ -19,6 +18,10 @@ else
|
|||
PS='/'
|
||||
fi;
|
||||
|
||||
LOGFILE="out${PS}log-$PID"
|
||||
DBDIR="out${PS}data-$PID"
|
||||
mkdir -p ${DBDIR}
|
||||
|
||||
export PORT=`expr 1024 + $RANDOM`
|
||||
declare -a ARGS
|
||||
export VG=''
|
||||
|
@ -36,9 +39,9 @@ for i in "$@"; do
|
|||
ARGS+=("$i")
|
||||
fi
|
||||
done
|
||||
mkdir out
|
||||
echo Database has its data in out${PS}data-$PID
|
||||
echo Logfile is in out${PS}log-$PID
|
||||
|
||||
echo Database has its data in ${DBDIR}
|
||||
echo Logfile is in ${LOGFILE}
|
||||
$VG bin/arangod \
|
||||
--configuration none \
|
||||
--cluster.agent-path bin${PS}etcd-arango${EXT} \
|
||||
|
@ -49,8 +52,8 @@ $VG bin/arangod \
|
|||
--cluster.disable-dispatcher-kickstarter false \
|
||||
--cluster.data-path cluster \
|
||||
--cluster.log-path cluster \
|
||||
--database.directory out${PS}data-$PID \
|
||||
--log.file out${PS}log-$PID \
|
||||
--database.directory ${DBDIR} \
|
||||
--log.file ${LOGFILE} \
|
||||
--server.endpoint tcp://127.0.0.1:$PORT \
|
||||
--javascript.startup-directory js \
|
||||
--javascript.app-path js${PS}apps \
|
||||
|
@ -61,11 +64,11 @@ $VG bin/arangod \
|
|||
$VXML
|
||||
|
||||
if test $? -eq 0; then
|
||||
echo removing out${PS}log-$PID out${PS}data-$PID
|
||||
rm -rf out${PS}log-$PID out${PS}data-$PID
|
||||
echo "removing ${LOGFILE} ${DBDIR}"
|
||||
rm -rf ${LOGFILE} ${DBDIR}
|
||||
else
|
||||
echo "failed - don't remove out${PS}log-$PID out${PS}data-$PID - heres the logfile:"
|
||||
cat out${PS}log-$PID
|
||||
echo "failed - don't remove ${LOGFILE} ${DBDIR} - heres the logfile:"
|
||||
cat ${LOGFILE}
|
||||
fi
|
||||
|
||||
echo Server has terminated.
|
||||
|
|
|
@ -156,18 +156,21 @@ function main (argv) {
|
|||
print(JSON.stringify(r));
|
||||
}
|
||||
|
||||
fs.write("out/UNITTEST_RESULT.json", JSON.stringify(r));
|
||||
fs.write("out/UNITTEST_RESULT_SUMMARY.txt", JSON.stringify(! r.crashed));
|
||||
if (options.writeXmlReport) {
|
||||
|
||||
try {
|
||||
resultsToXml(r, "UNITTEST_RESULT_", (options.hasOwnProperty('cluster') && options.cluster));
|
||||
}
|
||||
catch (x) {
|
||||
print("exception while serializing status xml!");
|
||||
print(x.message);
|
||||
print(JSON.stringify(r));
|
||||
}
|
||||
fs.write("out/UNITTEST_RESULT.json", JSON.stringify(r));
|
||||
fs.write("out/UNITTEST_RESULT_SUMMARY.txt", JSON.stringify(! r.crashed));
|
||||
|
||||
try {
|
||||
resultsToXml(r, "UNITTEST_RESULT_", (options.hasOwnProperty('cluster') && options.cluster));
|
||||
}
|
||||
catch (x) {
|
||||
print("exception while serializing status xml!");
|
||||
print(x.message);
|
||||
print(x.stack);
|
||||
print(JSON.stringify(r));
|
||||
}
|
||||
}
|
||||
UnitTest.unitTestPrettyPrintResults(r);
|
||||
|
||||
if (r.hasOwnProperty("crashed") && r.crashed) {
|
||||
|
|
Loading…
Reference in New Issue