Skip to content

Commit

Permalink
Bug fix/pass up cleanup set cluster (arangodb#13400)
Browse files Browse the repository at this point in the history
Co-authored-by: Michael Hackstein <michael@arangodb.com>
  • Loading branch information
dothebart and mchacki authored Jan 19, 2021
1 parent 23591a3 commit 7b19acb
Show file tree
Hide file tree
Showing 10 changed files with 77 additions and 32 deletions.
25 changes: 20 additions & 5 deletions js/client/modules/@arangodb/testsuites/aql.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ function shellClient (options) {

testCases = tu.splitBuckets(options, testCases);

return tu.performTests(ensureServers(options, 3), testCases, 'shell_client', tu.runInLocalArangosh);
let opts = ensureServers(options, 3);
let rc = tu.performTests(opts, testCases, 'shell_client', tu.runInLocalArangosh);
options.cleanup = options.cleanup && opts.cleanup;
return rc;
}

// //////////////////////////////////////////////////////////////////////////////
Expand All @@ -81,7 +84,10 @@ function shellServer (options) {

testCases = tu.splitBuckets(options, testCases);

return tu.performTests(ensureServers(options, 3), testCases, 'shell_server', tu.runThere);
let opts = ensureServers(options, 3);
let rc = tu.performTests(opts, testCases, 'shell_server', tu.runThere);
options.cleanup = options.cleanup && opts.cleanup;
return rc;
}

// //////////////////////////////////////////////////////////////////////////////
Expand All @@ -93,7 +99,10 @@ function shellServerOnly (options) {

testCases = tu.splitBuckets(options, testCases);

return tu.performTests(ensureServers(options, 3), testCases, 'shell_server_only', tu.runThere);
let opts = ensureServers(options, 3);
let rc = tu.performTests(opts, testCases, 'shell_server_only', tu.runThere);
options.cleanup = options.cleanup && opts.cleanup;
return rc;
}

// //////////////////////////////////////////////////////////////////////////////
Expand All @@ -114,7 +123,10 @@ function shellServerAql (options) {

testCases = tu.splitBuckets(options, testCases);

return tu.performTests(ensureServers(options, 3), testCases, name, tu.runThere);
let opts = ensureServers(options, 3);
let rc = tu.performTests(opts, testCases, name, tu.runThere);
options.cleanup = options.cleanup && opts.cleanup;
return rc;
}

return {
Expand Down Expand Up @@ -143,7 +155,10 @@ function shellClientAql (options) {

testCases = tu.splitBuckets(options, testCases);

return tu.performTests(ensureServers(options, 3), testCases, name, tu.runInLocalArangosh);
let opts = ensureServers(options, 3);
let rc = tu.performTests(opts, testCases, name, tu.runInLocalArangosh);
options.cleanup = options.cleanup && opts.cleanup;
return rc;
}

return {
Expand Down
4 changes: 3 additions & 1 deletion js/client/modules/@arangodb/testsuites/go.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,9 @@ function goDriver (options) {
}
localOptions['server.jwt-secret'] = 'haxxmann';

return tu.performTests(localOptions, [ 'go_test.js'], 'go_test', runInGoTest);
let rc = tu.performTests(localOptions, [ 'go_test.js'], 'go_test', runInGoTest);
options.cleanup = options.cleanup && localOptions.cleanup;
return rc;
}


Expand Down
4 changes: 3 additions & 1 deletion js/client/modules/@arangodb/testsuites/java.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,9 @@ function javaDriver (options) {
}
localOptions['server.jwt-secret'] = 'haxxmann';

return tu.performTests(localOptions, [ 'java_test.js'], 'java_test', runInJavaTest);
let rc = tu.performTests(localOptions, [ 'java_test.js'], 'java_test', runInJavaTest);
options.cleanup = options.cleanup && localOptions.cleanup;
return rc;
}


Expand Down
4 changes: 3 additions & 1 deletion js/client/modules/@arangodb/testsuites/js.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,9 @@ function jsDriver (options) {
}
localOptions['server.jwt-secret'] = 'haxxmann';

return tu.performTests(localOptions, [ 'js_test.js'], 'js_test', runInJsTest);
let rc = tu.performTests(localOptions, [ 'js_test.js'], 'js_test', runInJsTest);
options.cleanup = options.cleanup && localOptions.cleanup;
return rc;
}


Expand Down
29 changes: 18 additions & 11 deletions js/client/modules/@arangodb/testsuites/loadBalancing.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const optionsDocumentation = [
' - `skipLoadBalancing : testing load_balancing will be skipped.'
];

const _ = require('lodash');
const tu = require('@arangodb/testutils/test-utils');

// const BLUE = require('internal').COLORS.COLOR_BLUE;
Expand Down Expand Up @@ -65,15 +66,18 @@ function loadBalancingClient (options) {
print(CYAN + 'Load Balancing tests...' + RESET);
const excludeAuth = (fn) => { return (fn.indexOf('-auth') === -1); };
let testCases = tu.scanTestPaths(testPaths.load_balancing, options)
.filter(excludeAuth);
//options.cluster = true;
if (options.coordinators < 2) {
options.coordinators = 2;
.filter(excludeAuth);
let opts = _.clone(options);
opts.cluster = true;
if (opts.coordinators < 2) {
opts.coordinators = 2;
}

return tu.performTests(options, testCases, 'load_balancing', tu.runInArangosh, {
let rc = tu.performTests(opts, testCases, 'load_balancing', tu.runInArangosh, {
'server.authentication': 'false'
});
options.cleanup = options.cleanup && opts.cleanup;
return rc;
}

////////////////////////////////////////////////////////////////////////////////
Expand All @@ -95,17 +99,20 @@ function loadBalancingAuthClient (options) {
const excludeNoAuth = (fn) => { return (fn.indexOf('-noauth') === -1); };
let testCases = tu.scanTestPaths(testPaths.load_balancing, options)
.filter(excludeNoAuth);
//options.cluster = true;
if (options.coordinators < 2) {
options.coordinators = 2;
let opts = _.clone(options);
opts.cluster = true;
if (opts.coordinators < 2) {
opts.coordinators = 2;
}
options.username = 'root';
options.password = '';
opts.username = 'root';
opts.password = '';

return tu.performTests(options, testCases, 'load_balancing', tu.runInArangosh, {
let rc = tu.performTests(opts, testCases, 'load_balancing', tu.runInArangosh, {
'server.authentication': 'true',
'server.jwt-secret': 'haxxmann'
});
options.cleanup = options.cleanup && opts.cleanup;
return rc;
}

exports.setup = function (testFns, defaultFns, opts, fnDocs, optionsDoc, allTestPaths) {
Expand Down
1 change: 1 addition & 0 deletions js/client/modules/@arangodb/testsuites/paths_server.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ function paths_server(options) {
process.env.TMPDIR = tmpPath;
process.env.TEMP = tmpPath;
process.env.TMP = tmpPath;
options.cleanup = options.cleanup && opts.cleanup;
return rc;
}

Expand Down
4 changes: 3 additions & 1 deletion js/client/modules/@arangodb/testsuites/php.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,9 @@ function phpDriver (options) {
localOptions.test = '';
localOptions['server.jwt-secret'] = 'haxxmann';

return tu.performTests(localOptions, [ 'php_test.js'], 'php_test', runInPhpTest);
let rc = tu.performTests(localOptions, [ 'php_test.js'], 'php_test', runInPhpTest);
options.cleanup = options.cleanup && localOptions.cleanup;
return rc;
}


Expand Down
25 changes: 16 additions & 9 deletions js/client/modules/@arangodb/testsuites/resilience.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ const testPaths = {
var _resilience = function(path) {
this.func = function resilience (options) {
let suiteName = path;
let testCases = tu.scanTestPaths(testPaths[path], options);
let localOptions = _.clone(options);
localOptions.cluster = true;
localOptions.propagateInstanceInfo = true;
Expand All @@ -78,11 +77,14 @@ var _resilience = function(path) {
if (localOptions.dbServers < 5) {
localOptions.dbServers = 5;
}
return tu.performTests(localOptions, testCases, suiteName, tu.runThere, {
let testCases = tu.scanTestPaths(testPaths[path], localOptions);
let rc = tu.performTests(localOptions, testCases, suiteName, tu.runThere, {
'javascript.allow-external-process-control': 'true',
'javascript.allow-port-testing': 'true',
'javascript.allow-admin-execute': 'true',
});
options.cleanup = options.cleanup && localOptions.cleanup;
return rc;
};
};

Expand All @@ -101,17 +103,20 @@ const resilienceAnalyzers = (new _resilience('resilience_analyzers')).func;
// //////////////////////////////////////////////////////////////////////////////

function clientResilience (options) {
let testCases = tu.scanTestPaths(testPaths.client_resilience, options);
options.cluster = true;
if (options.coordinators < 2) {
options.coordinators = 2;
let localOptions = _.clone(options);
localOptions.cluster = true;
if (localOptions.coordinators < 2) {
localOptions.coordinators = 2;
}

return tu.performTests(options, testCases, 'client_resilience', tu.runInArangosh, {
let testCases = tu.scanTestPaths(testPaths.client_resilience, localOptions);
let rc = tu.performTests(localOptions, testCases, 'client_resilience', tu.runInArangosh, {
'javascript.allow-external-process-control': 'true',
'javascript.allow-port-testing': 'true',
'javascript.allow-admin-execute': 'true',
});
options.cleanup = options.cleanup && localOptions.cleanup;
return rc;
}

// //////////////////////////////////////////////////////////////////////////////
Expand All @@ -128,19 +133,21 @@ function activeFailover (options) {
}
};
}
let testCases = tu.scanTestPaths(testPaths.active_failover, options);
let localOptions = _.clone(options);
localOptions.activefailover = true;
localOptions.singles = 4;
localOptions.disableMonitor = true;
localOptions.Agency = true;
return tu.performTests(localOptions, testCases, 'client_resilience', tu.runInArangosh, {
let testCases = tu.scanTestPaths(testPaths.active_failover, localOptions);
let rc = tu.performTests(localOptions, testCases, 'client_resilience', tu.runInArangosh, {
'server.authentication': 'true',
'server.jwt-secret': 'haxxmann',
'javascript.allow-external-process-control': 'true',
'javascript.allow-port-testing': 'true',
'javascript.allow-admin-execute': 'true',
});
options.cleanup = options.cleanup && localOptions.cleanup;
return rc;
}

exports.setup = function (testFns, defaultFns, opts, fnDocs, optionsDoc, allTestPaths) {
Expand Down
4 changes: 3 additions & 1 deletion js/client/modules/@arangodb/testsuites/restart.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,11 @@ function restart (options) {
clonedOpts.skipLogAnalysis = true;
clonedOpts.skipReconnect = true;
let testCases = tu.scanTestPaths(testPaths.restart, clonedOpts);
return tu.performTests(clonedOpts, testCases, 'restart', runTest, {
let rc = tu.performTests(clonedOpts, testCases, 'restart', runTest, {
'server.jwt-secret': 'haxxmann',
});
options.cleanup = options.cleanup && clonedOpts.cleanup;
return rc;
}

exports.setup = function (testFns, defaultFns, opts, fnDocs, optionsDoc, allTestPaths) {
Expand Down
9 changes: 7 additions & 2 deletions js/client/modules/@arangodb/testsuites/wal.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const functionsDocumentation = {
'wal_cleanup': 'wal file cleanup tests'
};

const _ = require('lodash');
const tu = require('@arangodb/testutils/test-utils');

// const BLUE = require('internal').COLORS.COLOR_BLUE;
Expand All @@ -52,12 +53,16 @@ function walCleanup (options) {
print(CYAN + 'WAL cleanup tests...' + RESET);
let testCases = tu.scanTestPaths(testPaths.walCleanup, options);

options.extraArgs['rocksdb.wal-file-timeout-initial'] = '3';
let opts = _.clone(options);
opts.extraArgs['rocksdb.wal-file-timeout-initial'] = '3';
opts.cluster = true;

return tu.performTests(options, testCases, 'wal_cleanup', tu.runInArangosh, {
let rc = tu.performTests(opts, testCases, 'wal_cleanup', tu.runInArangosh, {
'server.authentication': 'false',
'rocksdb.wal-file-timeout-initial': '3'
});
options.cleanup = options.cleanup && opts.cleanup;
return rc;
}

exports.setup = function (testFns, defaultFns, opts, fnDocs, optionsDoc, allTestPaths) {
Expand Down

0 comments on commit 7b19acb

Please sign in to comment.