8000 added option configDir · sleepycat/arangodb@78a53d1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 78a53d1

Browse files
committed
added option configDir
1 parent fa91793 commit 78a53d1

File tree

1 file changed

+20
-12
lines changed

1 file changed

+20
-12
lines changed

js/client/modules/@arangodb/testing.js

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -115,13 +115,15 @@ const optionsDocumentation = [
115115
'',
116116
' - `build`: the directory containing the binaries',
117117
' - `buildType`: Windows build type (Debug, Release), leave empty on linux',
118+
' - `configDir`: the directory containing the config files, defaults to',
119+
' etc/testing',
118120
' - `rspec`: the location of rspec program',
119121
' - `ruby`: the location of ruby program; if empty start rspec directly',
120122
'',
121123
' - `rr`: if set to true arangod instances are run with rr',
122124
'',
123125
' - `sanitizer`: if set the programs are run with enabled sanitizer',
124-
' and need longer tomeouts',
126+
' and need longer timeouts',
125127
'',
126128
' - `valgrind`: if set the programs are run with the valgrind',
127129
' memory checker; should point to the valgrind executable',
@@ -148,6 +150,7 @@ const optionsDefaults = {
148150
'cleanup': true,
149151
'cluster': false,
150152
'concurrency': 3,
153+
'configDir': 'etc/testing',
151154
'coordinators': 1,
152155
'coreDirectory': '/var/tmp',
153156
'dbServers': 2,
@@ -235,19 +238,20 @@ const TOP_DIR = (function findTopDir () {
235238
}());
236239

237240
let BIN_DIR;
238-
let CONFIG_DIR;
239241
let ARANGOBENCH_BIN;
240242
let ARANGODUMP_BIN;
241243
let ARANGOD_BIN;
242244
let ARANGOIMP_BIN;
243245
let ARANGORESTORE_BIN;
244246
let ARANGOSH_BIN;
247+
let CONFIG_ARANGODB_DIR;
245248
let CONFIG_RELATIVE_DIR;
249+
let CONFIG_DIR;
246250
let JS_DIR;
247251
let JS_ENTERPRISE_DIR;
248252
let LOGS_DIR;
249253
let UNITTESTS_DIR;
250-
let GDB_OUTPUT="";
254+
let GDB_OUTPUT = "";
251255

252256
function makeResults (testname, instanceInfo) {
253257
const startTime = time();
@@ -311,7 +315,7 @@ function makeArgsArangod (options, appDir, role) {
311315
}
312316

313317
return {
314-
'configuration': 'etc/testing/' + config,
318+
'configuration': fs.join(CONFIG_DIR, config),
315319
'define': 'TOP_DIR=' + TOP_DIR,
316320
'wal.flush-timeout': options.walFlushTimeout,
317321
'javascript.app-path': appDir,
@@ -325,7 +329,7 @@ function makeArgsArangod (options, appDir, role) {
325329

326330
function makeArgsArangosh (options) {
327331
return {
328-
'configuration': 'etc/testing/arangosh.conf',
332+
'configuration': fs.join(CONFIG_DIR, 'arangosh.conf'),
329333
'javascript.startup-directory': JS_DIR,
330334
'javascript.module-directory': JS_ENTERPRISE_DIR,
331335
'server.username': options.username,
@@ -1161,7 +1165,7 @@ function runArangoImp (options, instanceInfo, what) {
11611165

11621166
function runArangoDumpRestore (options, instanceInfo, which, database) {
11631167
let args = {
1164-
'configuration': (which === 'dump' ? 'etc/testing/arangodump.conf' : 'etc/testing/arangorestore.conf'),
1168+
'configuration': fs.join(CONFIG_DIR, (which === 'dump' ? 'arangodump.conf' : 'arangorestore.conf')),
11651169
'server.username': options.username,
11661170
'server.password': options.password,
11671171
'server.endpoint': instanceInfo.endpoint,
@@ -1189,7 +1193,7 @@ function runArangoDumpRestore (options, instanceInfo, which, database) {
11891193

11901194
function runArangoBenchmark (options, instanceInfo, cmds) {
11911195
let args = {
1192-
'configuration': 'etc/testing/arangobench.conf',
1196+
'configuration': fs.join(CONFIG_DIR, 'arangobench.conf'),
11931197
'server.username': options.username,
11941198
'server.password': options.password,
11951199
'server.endpoint': instanceInfo.endpoint,
@@ -2698,7 +2702,7 @@ testFuncs.config = function (options) {
26982702
print(CYAN + "checking '" + test + "'" + RESET);
26992703

27002704
const args = {
2701-
'configuration': fs.join(CONFIG_DIR, test + '.conf'),
2705+
'configuration': fs.join(CONFIG_ARANGODB_DIR, test + '.conf'),
27022706
'flatCommands': ['--check-configuration']
27032707
};
27042708

@@ -2766,7 +2770,7 @@ testFuncs.config = function (options) {
27662770

27672771
testFuncs.dfdb = function (options) {
27682772
const dataDir = fs.getTempFile();
2769-
const args = ['-c', 'etc/testing/arango-dfdb.conf', dataDir];
2773+
const args = ['-c', fs.join(CONFIG_DIR, 'arango-dfdb.conf'), dataDir];
27702774

27712775
fs.makeDirectoryRecursive(dataDir);
27722776
let results = {};
@@ -2971,12 +2975,12 @@ testFuncs.foxx_manager = function (options) {
29712975
let results = {};
29722976

29732977
results.update = runArangoshCmd(options, instanceInfo, {
2974-
'configuration': 'etc/testing/foxx-manager.conf'
2978+
'configuration': fs.join(CONFIG_DIR, 'foxx-manager.conf')
29752979
}, ['update']);
29762980

29772981
if (results.update.status === true || options.force) {
29782982
results.search = runArangoshCmd(options, instanceInfo, {
2979-
'configuration': 'etc/testing/foxx-manager.conf'
2983+
'configuration': fs.join(CONFIG_DIR, 'foxx-manager.conf')
29802984
}, ['search', 'itzpapalotl']);
29812985
}
29822986

@@ -4231,16 +4235,20 @@ function unitTest (cases, options) {
42314235
UNITTESTS_DIR = fs.join(UNITTESTS_DIR, options.buildType);
42324236
}
42334237

4234-
CONFIG_DIR = fs.join(TOP_DIR, builddir, 'etc', 'arangodb3');
42354238
ARANGOBENCH_BIN = fs.join(BIN_DIR, 'arangobench');
42364239
ARANGODUMP_BIN = fs.join(BIN_DIR, 'arangodump');
42374240
ARANGOD_BIN = fs.join(BIN_DIR, 'arangod');
42384241
ARANGOIMP_BIN = fs.join(BIN_DIR, 'arangoimp');
42394242
ARANGORESTORE_BIN = fs.join(BIN_DIR, 'arangorestore');
42404243
ARANGOSH_BIN = fs.join(BIN_DIR, 'arangosh');
4244+
4245+
CONFIG_ARANGODB_DIR = fs.join(TOP_DIR, builddir, 'etc', 'arangodb3');
42414246
CONFIG_RELATIVE_DIR = fs.join(TOP_DIR, 'etc', 'relative');
4247+
CONFIG_DIR = fs.join(TOP_DIR, options.configDir);
4248+
42424249
JS_DIR = fs.join(TOP_DIR, 'js');
42434250
JS_ENTERPRISE_DIR = fs.join(TOP_DIR, 'enterprise/js');
4251+
42444252
LOGS_DIR = fs.join(TOP_DIR, 'logs');
42454253

42464254
let checkFiles = [

0 commit comments

Comments
 (0)
0