mirror of https://gitee.com/bigwinds/arangodb
Fix layers for results of config-, upgrade-test and arangob.
This commit is contained in:
parent
1c97ce900a
commit
ff259520c5
|
@ -1361,7 +1361,7 @@ testFuncs.config = function (options) {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
var topDir = findTopDir();
|
var topDir = findTopDir();
|
||||||
var results = {};
|
var results = { absolut: {status: true, total: 0}, relative: {status: true, total: 0}};
|
||||||
var ts = ["arangod",
|
var ts = ["arangod",
|
||||||
"arangob",
|
"arangob",
|
||||||
"arangodump",
|
"arangodump",
|
||||||
|
@ -1380,11 +1380,15 @@ testFuncs.config = function (options) {
|
||||||
"configuration" : fs.join(topDir,"etc","arangodb", test + ".conf"),
|
"configuration" : fs.join(topDir,"etc","arangodb", test + ".conf"),
|
||||||
"flatCommands" : ["--help"]
|
"flatCommands" : ["--help"]
|
||||||
};
|
};
|
||||||
results[test] = executeAndWait(fs.join(topDir, "bin", test),
|
results.absolut[test] = executeAndWait(fs.join(topDir, "bin", test),
|
||||||
toArgv(args));
|
toArgv(args));
|
||||||
|
if (!results.absolut[test].status) {
|
||||||
|
results.absolut.status = false;
|
||||||
|
}
|
||||||
|
results.absolut.total++;
|
||||||
print("Args for [" + test + "]:");
|
print("Args for [" + test + "]:");
|
||||||
print(yaml.safeDump(args));
|
print(yaml.safeDump(args));
|
||||||
print("Result: " + results[test].status);
|
print("Result: " + results.absolut[test].status);
|
||||||
}
|
}
|
||||||
print("--------------------------------------------------------------------------------");
|
print("--------------------------------------------------------------------------------");
|
||||||
print("relative config tests");
|
print("relative config tests");
|
||||||
|
@ -1397,11 +1401,15 @@ testFuncs.config = function (options) {
|
||||||
"flatCommands" : ["--help"]
|
"flatCommands" : ["--help"]
|
||||||
};
|
};
|
||||||
|
|
||||||
results[test + "_rel"] = executeAndWait(fs.join(topDir,"bin", test),
|
results.relative[test] = executeAndWait(fs.join(topDir,"bin", test),
|
||||||
toArgv(args));
|
toArgv(args));
|
||||||
|
if (!results.relative[test].status) {
|
||||||
|
results.relative.status = false;
|
||||||
|
}
|
||||||
|
results.relative.total++
|
||||||
print("Args for (relative) [" + test + "]:");
|
print("Args for (relative) [" + test + "]:");
|
||||||
print(yaml.safeDump(args));
|
print(yaml.safeDump(args));
|
||||||
print("Result: " + results[test + "_rel"].status);
|
print("Result: " + results.relative[test].status);
|
||||||
}
|
}
|
||||||
|
|
||||||
return results;
|
return results;
|
||||||
|
@ -1727,7 +1735,7 @@ testFuncs.upgrade = function (options) {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
var result = {};
|
var result = {upgrade: {status: true, total: 1}};
|
||||||
|
|
||||||
var tmpDataDir = fs.getTempFile();
|
var tmpDataDir = fs.getTempFile();
|
||||||
fs.makeDirectoryRecursive(tmpDataDir);
|
fs.makeDirectoryRecursive(tmpDataDir);
|
||||||
|
@ -1744,13 +1752,14 @@ testFuncs.upgrade = function (options) {
|
||||||
args["database.directory"] = fs.join(tmpDataDir,"data");
|
args["database.directory"] = fs.join(tmpDataDir,"data");
|
||||||
fs.makeDirectoryRecursive(fs.join(tmpDataDir,"data"));
|
fs.makeDirectoryRecursive(fs.join(tmpDataDir,"data"));
|
||||||
var argv = toArgv(args).concat(["--upgrade"]);
|
var argv = toArgv(args).concat(["--upgrade"]);
|
||||||
result.first = executeAndWait(fs.join("bin","arangod"), argv);
|
result.upgrade.first = executeAndWait(fs.join("bin","arangod"), argv);
|
||||||
|
|
||||||
if (result.first !== 0 && !options.force) {
|
if (result.upgrade.first !== 0 && !options.force) {
|
||||||
print("not removing " + tmpDataDir);
|
print("not removing " + tmpDataDir);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
result.second = executeAndWait(fs.join("bin","arangod"), argv);
|
result.upgrade.total ++;
|
||||||
|
result.upgrade.second = executeAndWait(fs.join("bin","arangod"), argv);
|
||||||
|
|
||||||
cleanupDirectories.push(tmpDataDir);
|
cleanupDirectories.push(tmpDataDir);
|
||||||
|
|
||||||
|
@ -1999,7 +2008,7 @@ testFuncs.arangob = function (options) {
|
||||||
if (instanceInfo === false) {
|
if (instanceInfo === false) {
|
||||||
return {status: false, message: "failed to start server!"};
|
return {status: false, message: "failed to start server!"};
|
||||||
}
|
}
|
||||||
var results = {};
|
var results = { arangob: {status: true, total: 0}};
|
||||||
var i;
|
var i;
|
||||||
var oneResult;
|
var oneResult;
|
||||||
var continueTesting = true;
|
var continueTesting = true;
|
||||||
|
@ -2017,7 +2026,7 @@ testFuncs.arangob = function (options) {
|
||||||
|
|
||||||
if (!continueTesting) {
|
if (!continueTesting) {
|
||||||
print("Skipping " + benchTodo[i] + ", server is gone.");
|
print("Skipping " + benchTodo[i] + ", server is gone.");
|
||||||
results[i] = {status: false, message: instanceInfo.exitStatus};
|
results.arangob[i] = {status: false, message: instanceInfo.exitStatus};
|
||||||
instanceInfo.exitStatus = "server is gone.";
|
instanceInfo.exitStatus = "server is gone.";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -2026,8 +2035,11 @@ testFuncs.arangob = function (options) {
|
||||||
args = _.extend(args, options.benchargs);
|
args = _.extend(args, options.benchargs);
|
||||||
}
|
}
|
||||||
oneResult = runArangoBenchmark(options, instanceInfo, args);
|
oneResult = runArangoBenchmark(options, instanceInfo, args);
|
||||||
results[i] = oneResult;
|
results.arangob[i] = oneResult;
|
||||||
|
results.arangob.total++;
|
||||||
|
if (!results.arangob[i].status) {
|
||||||
|
results.arangob.status = false;
|
||||||
|
}
|
||||||
continueTesting = checkInstanceAlive(instanceInfo, options);
|
continueTesting = checkInstanceAlive(instanceInfo, options);
|
||||||
|
|
||||||
if (oneResult.status !== true && !options.force) {
|
if (oneResult.status !== true && !options.force) {
|
||||||
|
|
Loading…
Reference in New Issue