mirror of https://gitee.com/bigwinds/arangodb
added option configDir
This commit is contained in:
parent
fa917937c4
commit
78a53d1db1
|
@ -115,13 +115,15 @@ const optionsDocumentation = [
|
||||||
'',
|
'',
|
||||||
' - `build`: the directory containing the binaries',
|
' - `build`: the directory containing the binaries',
|
||||||
' - `buildType`: Windows build type (Debug, Release), leave empty on linux',
|
' - `buildType`: Windows build type (Debug, Release), leave empty on linux',
|
||||||
|
' - `configDir`: the directory containing the config files, defaults to',
|
||||||
|
' etc/testing',
|
||||||
' - `rspec`: the location of rspec program',
|
' - `rspec`: the location of rspec program',
|
||||||
' - `ruby`: the location of ruby program; if empty start rspec directly',
|
' - `ruby`: the location of ruby program; if empty start rspec directly',
|
||||||
'',
|
'',
|
||||||
' - `rr`: if set to true arangod instances are run with rr',
|
' - `rr`: if set to true arangod instances are run with rr',
|
||||||
'',
|
'',
|
||||||
' - `sanitizer`: if set the programs are run with enabled sanitizer',
|
' - `sanitizer`: if set the programs are run with enabled sanitizer',
|
||||||
' and need longer tomeouts',
|
' and need longer timeouts',
|
||||||
'',
|
'',
|
||||||
' - `valgrind`: if set the programs are run with the valgrind',
|
' - `valgrind`: if set the programs are run with the valgrind',
|
||||||
' memory checker; should point to the valgrind executable',
|
' memory checker; should point to the valgrind executable',
|
||||||
|
@ -148,6 +150,7 @@ const optionsDefaults = {
|
||||||
'cleanup': true,
|
'cleanup': true,
|
||||||
'cluster': false,
|
'cluster': false,
|
||||||
'concurrency': 3,
|
'concurrency': 3,
|
||||||
|
'configDir': 'etc/testing',
|
||||||
'coordinators': 1,
|
'coordinators': 1,
|
||||||
'coreDirectory': '/var/tmp',
|
'coreDirectory': '/var/tmp',
|
||||||
'dbServers': 2,
|
'dbServers': 2,
|
||||||
|
@ -235,19 +238,20 @@ const TOP_DIR = (function findTopDir () {
|
||||||
}());
|
}());
|
||||||
|
|
||||||
let BIN_DIR;
|
let BIN_DIR;
|
||||||
let CONFIG_DIR;
|
|
||||||
let ARANGOBENCH_BIN;
|
let ARANGOBENCH_BIN;
|
||||||
let ARANGODUMP_BIN;
|
let ARANGODUMP_BIN;
|
||||||
let ARANGOD_BIN;
|
let ARANGOD_BIN;
|
||||||
let ARANGOIMP_BIN;
|
let ARANGOIMP_BIN;
|
||||||
let ARANGORESTORE_BIN;
|
let ARANGORESTORE_BIN;
|
||||||
let ARANGOSH_BIN;
|
let ARANGOSH_BIN;
|
||||||
|
let CONFIG_ARANGODB_DIR;
|
||||||
let CONFIG_RELATIVE_DIR;
|
let CONFIG_RELATIVE_DIR;
|
||||||
|
let CONFIG_DIR;
|
||||||
let JS_DIR;
|
let JS_DIR;
|
||||||
let JS_ENTERPRISE_DIR;
|
let JS_ENTERPRISE_DIR;
|
||||||
let LOGS_DIR;
|
let LOGS_DIR;
|
||||||
let UNITTESTS_DIR;
|
let UNITTESTS_DIR;
|
||||||
let GDB_OUTPUT="";
|
let GDB_OUTPUT = "";
|
||||||
|
|
||||||
function makeResults (testname, instanceInfo) {
|
function makeResults (testname, instanceInfo) {
|
||||||
const startTime = time();
|
const startTime = time();
|
||||||
|
@ -311,7 +315,7 @@ function makeArgsArangod (options, appDir, role) {
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'configuration': 'etc/testing/' + config,
|
'configuration': fs.join(CONFIG_DIR, config),
|
||||||
'define': 'TOP_DIR=' + TOP_DIR,
|
'define': 'TOP_DIR=' + TOP_DIR,
|
||||||
'wal.flush-timeout': options.walFlushTimeout,
|
'wal.flush-timeout': options.walFlushTimeout,
|
||||||
'javascript.app-path': appDir,
|
'javascript.app-path': appDir,
|
||||||
|
@ -325,7 +329,7 @@ function makeArgsArangod (options, appDir, role) {
|
||||||
|
|
||||||
function makeArgsArangosh (options) {
|
function makeArgsArangosh (options) {
|
||||||
return {
|
return {
|
||||||
'configuration': 'etc/testing/arangosh.conf',
|
'configuration': fs.join(CONFIG_DIR, 'arangosh.conf'),
|
||||||
'javascript.startup-directory': JS_DIR,
|
'javascript.startup-directory': JS_DIR,
|
||||||
'javascript.module-directory': JS_ENTERPRISE_DIR,
|
'javascript.module-directory': JS_ENTERPRISE_DIR,
|
||||||
'server.username': options.username,
|
'server.username': options.username,
|
||||||
|
@ -1161,7 +1165,7 @@ function runArangoImp (options, instanceInfo, what) {
|
||||||
|
|
||||||
function runArangoDumpRestore (options, instanceInfo, which, database) {
|
function runArangoDumpRestore (options, instanceInfo, which, database) {
|
||||||
let args = {
|
let args = {
|
||||||
'configuration': (which === 'dump' ? 'etc/testing/arangodump.conf' : 'etc/testing/arangorestore.conf'),
|
'configuration': fs.join(CONFIG_DIR, (which === 'dump' ? 'arangodump.conf' : 'arangorestore.conf')),
|
||||||
'server.username': options.username,
|
'server.username': options.username,
|
||||||
'server.password': options.password,
|
'server.password': options.password,
|
||||||
'server.endpoint': instanceInfo.endpoint,
|
'server.endpoint': instanceInfo.endpoint,
|
||||||
|
@ -1189,7 +1193,7 @@ function runArangoDumpRestore (options, instanceInfo, which, database) {
|
||||||
|
|
||||||
function runArangoBenchmark (options, instanceInfo, cmds) {
|
function runArangoBenchmark (options, instanceInfo, cmds) {
|
||||||
let args = {
|
let args = {
|
||||||
'configuration': 'etc/testing/arangobench.conf',
|
'configuration': fs.join(CONFIG_DIR, 'arangobench.conf'),
|
||||||
'server.username': options.username,
|
'server.username': options.username,
|
||||||
'server.password': options.password,
|
'server.password': options.password,
|
||||||
'server.endpoint': instanceInfo.endpoint,
|
'server.endpoint': instanceInfo.endpoint,
|
||||||
|
@ -2698,7 +2702,7 @@ testFuncs.config = function (options) {
|
||||||
print(CYAN + "checking '" + test + "'" + RESET);
|
print(CYAN + "checking '" + test + "'" + RESET);
|
||||||
|
|
||||||
const args = {
|
const args = {
|
||||||
'configuration': fs.join(CONFIG_DIR, test + '.conf'),
|
'configuration': fs.join(CONFIG_ARANGODB_DIR, test + '.conf'),
|
||||||
'flatCommands': ['--check-configuration']
|
'flatCommands': ['--check-configuration']
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -2766,7 +2770,7 @@ testFuncs.config = function (options) {
|
||||||
|
|
||||||
testFuncs.dfdb = function (options) {
|
testFuncs.dfdb = function (options) {
|
||||||
const dataDir = fs.getTempFile();
|
const dataDir = fs.getTempFile();
|
||||||
const args = ['-c', 'etc/testing/arango-dfdb.conf', dataDir];
|
const args = ['-c', fs.join(CONFIG_DIR, 'arango-dfdb.conf'), dataDir];
|
||||||
|
|
||||||
fs.makeDirectoryRecursive(dataDir);
|
fs.makeDirectoryRecursive(dataDir);
|
||||||
let results = {};
|
let results = {};
|
||||||
|
@ -2971,12 +2975,12 @@ testFuncs.foxx_manager = function (options) {
|
||||||
let results = {};
|
let results = {};
|
||||||
|
|
||||||
results.update = runArangoshCmd(options, instanceInfo, {
|
results.update = runArangoshCmd(options, instanceInfo, {
|
||||||
'configuration': 'etc/testing/foxx-manager.conf'
|
'configuration': fs.join(CONFIG_DIR, 'foxx-manager.conf')
|
||||||
}, ['update']);
|
}, ['update']);
|
||||||
|
|
||||||
if (results.update.status === true || options.force) {
|
if (results.update.status === true || options.force) {
|
||||||
results.search = runArangoshCmd(options, instanceInfo, {
|
results.search = runArangoshCmd(options, instanceInfo, {
|
||||||
'configuration': 'etc/testing/foxx-manager.conf'
|
'configuration': fs.join(CONFIG_DIR, 'foxx-manager.conf')
|
||||||
}, ['search', 'itzpapalotl']);
|
}, ['search', 'itzpapalotl']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4231,16 +4235,20 @@ function unitTest (cases, options) {
|
||||||
UNITTESTS_DIR = fs.join(UNITTESTS_DIR, options.buildType);
|
UNITTESTS_DIR = fs.join(UNITTESTS_DIR, options.buildType);
|
||||||
}
|
}
|
||||||
|
|
||||||
CONFIG_DIR = fs.join(TOP_DIR, builddir, 'etc', 'arangodb3');
|
|
||||||
ARANGOBENCH_BIN = fs.join(BIN_DIR, 'arangobench');
|
ARANGOBENCH_BIN = fs.join(BIN_DIR, 'arangobench');
|
||||||
ARANGODUMP_BIN = fs.join(BIN_DIR, 'arangodump');
|
ARANGODUMP_BIN = fs.join(BIN_DIR, 'arangodump');
|
||||||
ARANGOD_BIN = fs.join(BIN_DIR, 'arangod');
|
ARANGOD_BIN = fs.join(BIN_DIR, 'arangod');
|
||||||
ARANGOIMP_BIN = fs.join(BIN_DIR, 'arangoimp');
|
ARANGOIMP_BIN = fs.join(BIN_DIR, 'arangoimp');
|
||||||
ARANGORESTORE_BIN = fs.join(BIN_DIR, 'arangorestore');
|
ARANGORESTORE_BIN = fs.join(BIN_DIR, 'arangorestore');
|
||||||
ARANGOSH_BIN = fs.join(BIN_DIR, 'arangosh');
|
ARANGOSH_BIN = fs.join(BIN_DIR, 'arangosh');
|
||||||
|
|
||||||
|
CONFIG_ARANGODB_DIR = fs.join(TOP_DIR, builddir, 'etc', 'arangodb3');
|
||||||
CONFIG_RELATIVE_DIR = fs.join(TOP_DIR, 'etc', 'relative');
|
CONFIG_RELATIVE_DIR = fs.join(TOP_DIR, 'etc', 'relative');
|
||||||
|
CONFIG_DIR = fs.join(TOP_DIR, options.configDir);
|
||||||
|
|
||||||
JS_DIR = fs.join(TOP_DIR, 'js');
|
JS_DIR = fs.join(TOP_DIR, 'js');
|
||||||
JS_ENTERPRISE_DIR = fs.join(TOP_DIR, 'enterprise/js');
|
JS_ENTERPRISE_DIR = fs.join(TOP_DIR, 'enterprise/js');
|
||||||
|
|
||||||
LOGS_DIR = fs.join(TOP_DIR, 'logs');
|
LOGS_DIR = fs.join(TOP_DIR, 'logs');
|
||||||
|
|
||||||
let checkFiles = [
|
let checkFiles = [
|
||||||
|
|
Loading…
Reference in New Issue