mirror of https://gitee.com/bigwinds/arangodb
Check for files to actually exist before we execute them.
This commit is contained in:
parent
65d9370615
commit
13255937ca
|
@ -4015,6 +4015,19 @@ function unitTest(cases, options) {
|
|||
LOGS_DIR = fs.join(TOP_DIR, "logs");
|
||||
PEM_FILE = fs.join(TOP_DIR, "UnitTests", "server.pem");
|
||||
|
||||
let checkFiles = [
|
||||
ARANGOBENCH_BIN,
|
||||
ARANGODUMP_BIN,
|
||||
ARANGOD_BIN,
|
||||
ARANGOIMP_BIN,
|
||||
ARANGORESTORE_BIN,
|
||||
ARANGOSH_BIN];
|
||||
for (let b = 0; b < checkFiles.length; ++b) {
|
||||
if (! fs.isFile(checkFiles[b])) {
|
||||
throw "unable to locate " + checkFiles[b];
|
||||
}
|
||||
}
|
||||
|
||||
const jsonReply = options.jsonReply;
|
||||
delete options.jsonReply;
|
||||
|
||||
|
|
|
@ -34,8 +34,25 @@ const scriptArguments = {
|
|||
let ARANGOD;
|
||||
let ARANGOSH;
|
||||
|
||||
ARANGOD = fs.join(fs.join(fs.makeAbsolute('')), "build/bin/arangod");
|
||||
ARANGOSH = fs.join(fs.join(fs.makeAbsolute('')), "build/bin/arangosh");
|
||||
function locateArangod() {
|
||||
ARANGOD = fs.join(fs.join(fs.makeAbsolute('')), "build/bin/arangod");
|
||||
if(!fs.isFile(ARANGOD)) {
|
||||
ARANGOD = fs.join(fs.join(fs.makeAbsolute('')), "bin/arangod");
|
||||
}
|
||||
if(!fs.isFile(ARANGOD)) {
|
||||
throw "Cannot find Aarangod to execute tests against";
|
||||
}
|
||||
}
|
||||
|
||||
function locateArangosh() {
|
||||
ARANGOSH = fs.join(fs.join(fs.makeAbsolute('')), "build/bin/arangosh");
|
||||
if(!fs.isFile(ARANGOSH)) {
|
||||
ARANGOSH = fs.join(fs.join(fs.makeAbsolute('')), "bin/arangosh");
|
||||
}
|
||||
if(!fs.isFile(ARANGOSH)) {
|
||||
throw "Cannot find arangosh to run tests with";
|
||||
}
|
||||
}
|
||||
|
||||
function endpointToURL(endpoint) {
|
||||
if (endpoint.substr(0, 6) === "ssl://") {
|
||||
|
@ -131,7 +148,9 @@ function main(argv) {
|
|||
serverArgs["server.threads"] = "3";
|
||||
|
||||
print("================================================================================");
|
||||
print(ARANGOD);
|
||||
print(toArgv(serverArgs));
|
||||
locateArangod();
|
||||
instanceInfo.pid = executeExternal(ARANGOD, toArgv(serverArgs)).pid;
|
||||
|
||||
// Wait until the server is up:
|
||||
|
@ -166,6 +185,10 @@ function main(argv) {
|
|||
'javascript.execute': scriptArguments.outputFile
|
||||
};
|
||||
|
||||
locateArangosh();
|
||||
print("--------------------------------------------------------------------------------");
|
||||
print(ARANGOSH);
|
||||
print(internal.toArgv(arangoshArgs));
|
||||
res = executeExternalAndWait(ARANGOSH, internal.toArgv(arangoshArgs));
|
||||
|
||||
if (startServer) {
|
||||
|
|
Loading…
Reference in New Issue