diff --git a/js/client/modules/@arangodb/testing.js b/js/client/modules/@arangodb/testing.js index 2386707fc7..3e15365012 100644 --- a/js/client/modules/@arangodb/testing.js +++ b/js/client/modules/@arangodb/testing.js @@ -1733,99 +1733,55 @@ let testsCases = { }; function findTests () { + function doOnePathInner(path) { + return _.filter(fs.list(makePathUnix(path)), + function (p) { + return p.substr(-3) === '.js'; + }) + .map(function (x) { + return fs.join(makePathUnix(path), x); + }).sort(); + } + + function doOnePath(path) { + var community = doOnePathInner(path); + if (global.ARANGODB_CLIENT_VERSION(true)['enterprise-version']) { + return community.concat(doOnePathInner('enterprise/Enterprise/' + path)); + } else { + return community; + } + } + + if (testsCases.setup) { return; } - testsCases.common = _.filter(fs.list(makePathUnix('js/common/tests/shell')), - function (p) { - return p.substr(-3) === '.js'; - }).map( - function (x) { - return fs.join(makePathUnix('js/common/tests/shell'), x); - }).sort(); + testsCases.common = doOnePath('js/common/tests/shell'); - testsCases.server_only = _.filter(fs.list(makePathUnix('js/server/tests/shell')), - function (p) { - return p.substr(-3) === '.js'; - }).map( - function (x) { - return fs.join(makePathUnix('js/server/tests/shell'), x); - }).sort(); + testsCases.server_only = doOnePath('js/server/tests/shell'); - testsCases.client_only = _.filter(fs.list(makePathUnix('js/client/tests/shell')), - function (p) { - return p.substr(-3) === '.js'; - }).map( - function (x) { - return fs.join(makePathUnix('js/client/tests/shell'), x); - }).sort(); + testsCases.client_only = doOnePath('js/client/tests/shell'); - testsCases.server_aql = _.filter(fs.list(makePathUnix('js/server/tests/aql')), - function (p) { - return p.substr(-3) === '.js' && p.indexOf('ranges-combined') === -1; - }).map( - function (x) { - return fs.join(makePathUnix('js/server/tests/aql'), x); - }).sort(); + testsCases.server_aql = doOnePath('js/server/tests/aql'); + testsCases.server_aql = _.filter(testsCases.server_aql, + function(p) { return p.indexOf('ranges-combined') === -1; }); - testsCases.server_aql_extended = - _.filter(fs.list(makePathUnix('js/server/tests/aql')), - function (p) { - return p.substr(-3) === '.js' && p.indexOf('ranges-combined') !== -1; - }).map( - function (x) { - return fs.join(makePathUnix('js/server/tests/aql'), x); - }).sort(); + testsCases.server_aql_extended = doOnePath('js/server/tests/aql'); + testsCases.server_aql_extended = _.filter(testsCases.server_aql_extended, + function(p) { return p.indexOf('ranges-combined') !== -1; }); - testsCases.server_aql_performance = - _.filter(fs.list(makePathUnix('js/server/perftests')), - function (p) { - return p.substr(-3) === '.js'; - }).map( - function (x) { - return fs.join(makePathUnix('js/server/perftests'), x); - }).sort(); + testsCases.server_aql_performance = doOnePath('js/server/perftests'); - testsCases.server_http = _.filter(fs.list(makePathUnix('js/common/tests/http')), - function (p) { - return p.substr(-3) === '.js'; - }).map( - function (x) { - return fs.join(makePathUnix('js/common/tests/http'), x); - }).sort(); + testsCases.server_http = doOnePath('js/common/tests/http'); - testsCases.replication = _.filter(fs.list(makePathUnix('js/common/tests/replication')), - function (p) { - return p.substr(-3) === '.js'; - }).map( - function (x) { - return fs.join(makePathUnix('js/common/tests/replication'), x); - }).sort(); + testsCases.replication = doOnePath('js/common/tests/replication'); - testsCases.agency = _.filter(fs.list(makePathUnix('js/client/tests/agency')), - function (p) { - return p.substr(-3) === '.js'; - }).map( - function (x) { - return fs.join(makePathUnix('js/client/tests/agency'), x); - }).sort(); + testsCases.agency = doOnePath('js/client/tests/agency'); - testsCases.resilience = _.filter(fs.list(makePathUnix('js/server/tests/resilience')), - function (p) { - return p.substr(-3) === '.js'; - }).map( - function (x) { - return fs.join(makePathUnix('js/server/tests/resilience'), x); - }).sort(); + testsCases.resilience = doOnePath('js/server/tests/resilience'); - testsCases.client_resilience = _.filter(fs.list(makePathUnix('js/client/tests/resilience')), - function (p) { - return p.substr(-3) === '.js'; - }).map( - function (x) { - return fs.join(makePathUnix('js/client/tests/resilience'), x); - }).sort(); + testsCases.client_resilience = doOnePath('js/client/tests/resilience'); testsCases.server = testsCases.common.concat(testsCases.server_only); testsCases.client = testsCases.common.concat(testsCases.client_only);