1
0
Fork 0

Add the logfile name to the output so we can know which cluster node gave us the messages.

This commit is contained in:
Willi Goesgens 2015-02-02 15:24:54 +01:00
parent 0aaec15c66
commit 6514bc0215
1 changed files with 31 additions and 18 deletions

View File

@ -369,9 +369,10 @@ function startInstance (protocol, options, addArgs, testname) {
function readImportantLogLines(logPath) {
var i, j;
var importantLines = [];
var importantLines = {};
var list=fs.list(logPath);
for (i = 0; i < list.length; i++) {
var fnLines = [];
if (list[i].slice(0,3) === 'log') {
var buf = fs.readBuffer(fs.join(logPath,list[i]));
var lineStart = 0;
@ -382,12 +383,15 @@ function readImportantLogLines(logPath) {
// filter out regular INFO lines, and test related messages
if ((line.search(" INFO ") < 0) &&
(line.search("WARNING about to execute:") < 0)) {
importantLines.push(line);
fnLines.push(line);
}
lineStart = j + 1;
}
}
}
if (fnLines.length > 0) {
importantLines[list[i]] = fnLines;
}
}
return importantLines;
}
@ -818,7 +822,8 @@ function performTests(options, testList, testname, remote) {
shutdownInstance(instanceInfo,options);
}
print("done.");
if (instanceInfo.hasOwnProperty('importantLogLines') && instanceInfo.importantLogLines.length > 0) {
if (instanceInfo.hasOwnProperty('importantLogLines') &&
Object.keys(instanceInfo.importantLogLines).length > 0) {
print("Found messages in the server logs: \n" + yaml.safeDump(instanceInfo.importantLogLines));
}
return results;
@ -857,8 +862,8 @@ testFuncs.single_server = function (options) {
}
shutdownInstance(instanceInfo,options);
print("done.");
if (instanceInfo.hasOwnProperty('importantLogLines') && instanceInfo.importantLogLines.length > 0) {
if (instanceInfo.hasOwnProperty('importantLogLines') &&
Object.keys(instanceInfo.importantLogLines).length > 0) {
print("Found messages in the server logs: \n" + yaml.safeDump(instanceInfo.importantLogLines));
}
return result;
@ -905,7 +910,8 @@ testFuncs.single_client = function (options) {
}
shutdownInstance(instanceInfo,options);
print("done.");
if (instanceInfo.hasOwnProperty('importantLogLines') && instanceInfo.importantLogLines.length > 0) {
if (instanceInfo.hasOwnProperty('importantLogLines') &&
Object.keys(instanceInfo.importantLogLines).length > 0) {
print("Found messages in the server logs: \n" + yaml.safeDump(instanceInfo.importantLogLines));
}
return result;
@ -1025,7 +1031,8 @@ testFuncs.shell_client = function(options) {
print("Shutting down...");
shutdownInstance(instanceInfo, options);
print("done.");
if (instanceInfo.hasOwnProperty('importantLogLines') && instanceInfo.importantLogLines.length > 0) {
if (instanceInfo.hasOwnProperty('importantLogLines') &&
Object.keys(instanceInfo.importantLogLines).length > 0) {
print("Found messages in the server logs: \n" + yaml.safeDump(instanceInfo.importantLogLines));
}
return results;
@ -1153,7 +1160,8 @@ function rubyTests (options, ssl) {
fs.remove(tmpname);
shutdownInstance(instanceInfo,options);
print("done.");
if (instanceInfo.hasOwnProperty('importantLogLines') && instanceInfo.importantLogLines.length > 0) {
if (instanceInfo.hasOwnProperty('importantLogLines') &&
Object.keys(instanceInfo.importantLogLines).length > 0) {
print("Found messages in the server logs: \n" + yaml.safeDump(instanceInfo.importantLogLines));
}
return result;
@ -1298,7 +1306,8 @@ testFuncs.importing = function (options) {
print("Shutting down...");
shutdownInstance(instanceInfo,options);
print("done.");
if (instanceInfo.hasOwnProperty('importantLogLines') && instanceInfo.importantLogLines.length > 0) {
if (instanceInfo.hasOwnProperty('importantLogLines') &&
Object.keys(instanceInfo.importantLogLines).length > 0) {
print("Found messages in the server logs: \n" + yaml.safeDump(instanceInfo.importantLogLines));
}
return result;
@ -1360,7 +1369,8 @@ testFuncs.foxx_manager = function (options) {
print("Shutting down...");
shutdownInstance(instanceInfo,options);
print("done.");
if (instanceInfo.hasOwnProperty('importantLogLines') && instanceInfo.importantLogLines.length > 0) {
if (instanceInfo.hasOwnProperty('importantLogLines') &&
Object.keys(instanceInfo.importantLogLines).length > 0) {
print("Found messages in the server logs: \n" + yaml.safeDump(instanceInfo.importantLogLines));
}
return results;
@ -1397,7 +1407,8 @@ testFuncs.dump = function (options) {
print("Shutting down...");
shutdownInstance(instanceInfo,options);
print("done.");
if (instanceInfo.hasOwnProperty('importantLogLines') && instanceInfo.importantLogLines.length > 0) {
if (instanceInfo.hasOwnProperty('importantLogLines') &&
Object.keys(instanceInfo.importantLogLines).length > 0) {
print("Found messages in the server logs: \n" + yaml.safeDump(instanceInfo.importantLogLines));
}
return results;
@ -1460,7 +1471,8 @@ testFuncs.arangob = function (options) {
print("Shutting down...");
shutdownInstance(instanceInfo,options);
print("done.");
if (instanceInfo.hasOwnProperty('importantLogLines') && instanceInfo.importantLogLines.length > 0) {
if (instanceInfo.hasOwnProperty('importantLogLines') &&
Object.keys(instanceInfo.importantLogLines).length > 0) {
print("Found messages in the server logs: \n" + yaml.safeDump(instanceInfo.importantLogLines));
}
return results;
@ -1480,7 +1492,8 @@ testFuncs.authentication = function (options) {
print("Shutting down...");
shutdownInstance(instanceInfo,options);
print("done.");
if (instanceInfo.hasOwnProperty('importantLogLines') && instanceInfo.importantLogLines.length > 0) {
if (instanceInfo.hasOwnProperty('importantLogLines') &&
Object.keys(instanceInfo.importantLogLines).length > 0) {
print("Found messages in the server logs: \n" + yaml.safeDump(instanceInfo.importantLogLines));
}
return results;