8000 Feature/refactor testrunner (#15998) · arangodb/arangodb@fdc51c7 · GitHub
[go: up one dir, main page]

Skip to content

Commit fdc51c7

Browse files
dothebartjsteemannAditya Mukhopadhyay
authored
Feature/refactor testrunner (#15998)
* add separate list of testfiles * start modularizing the testrunner function into a deriveable object * start modularizing the testrunner function into a deriveable object * Update js/client/modules/@arangodb/testutils/testrunner.js Co-authored-by: Jan <jsteemann@users.noreply.github.com> * convert more testsuites to the new logic * properly convert the agency runner * modify audit test * convert auth tests * convert chaos * adjust communication suite * convert more tests * lint * fix testcase path * cleanup, convert two missing suites * endpoints suite * disable graph checks for backup suite * lint * documentation * implement permissions test * fix database to be used for checking * one last convert * lint * re-apply changes from #16021 * Update js/client/modules/@arangodb/testutils/testrunner.js Co-authored-by: Aditya Mukhopadhyay <aditya@arangodb.com> * Update js/client/modules/@arangodb/testsuites/backup.js Co-authored-by: Aditya Mukhopadhyay <aditya@arangodb.com> * Update js/client/modules/@arangodb/testsuites/backup.js Co-authored-by: Aditya Mukhopadhyay <aditya@arangodb.com> * Update js/client/modules/@arangodb/testsuites/communication.js Co-authored-by: Aditya Mukhopadhyay <aditya@arangodb.com> * Update js/client/modules/@arangodb/testsuites/go.js Co-authored-by: Aditya Mukhopadhyay <aditya@arangodb.com> * Update js/client/modules/@arangodb/testsuites/go.js Co-authored-by: Aditya Mukhopadhyay <aditya@arangodb.com> * Update js/client/modules/@arangodb/testsuites/rta_makedata.js Co-authored-by: Aditya Mukhopadhyay <aditya@arangodb.com> * Update js/client/modules/@arangodb/testsuites/rta_makedata.js Co-authored-by: Aditya Mukhopadhyay <aditya@arangodb.com> * Update js/client/modules/@arangodb/testsuites/endpoints.js Co-authored-by: Aditya Mukhopadhyay <aditya@arangodb.com> * Update js/client/modules/@arangodb/testsuites/endpoints.js Co-authored-by: Aditya Mukhopadhyay <aditya@arangodb.com> * Update js/client/modules/@arangodb/testsuites/go.js Co-authored-by: Aditya Mukhopadhyay <aditya@arangodb.com> * Update js/client/modules/@arangodb/testsuites/drivers.js Co-authored-by: Aditya Mukhopadhyay <aditya@arangodb.com> * Update js/client/modules/@arangodb/testsuites/go.js Co-authored-by: Aditya Mukhopadhyay <aditya@arangodb.com> * Update js/client/modules/@arangodb/testsuites/drivers.js Co-authored-by: Aditya Mukhopadhyay <aditya@arangodb.com> * Update js/client/modules/@arangodb/testutils/test-utils.js Co-authored-by: Aditya Mukhopadhyay <aditya@arangodb.com> * Update js/client/modules/@arangodb/testutils/test-utils.js Co-authored-by: Aditya Mukhopadhyay <aditya@arangodb.com> * Update js/client/modules/@arangodb/testutils/test-utils.js Co-authored-by: Aditya Mukhopadhyay <aditya@arangodb.com> * Update js/client/modules/@arangodb/testsuites/drivers.js Co-authored-by: Aditya Mukhopadhyay <aditya@arangodb.com> * Update js/client/modules/@arangodb/testsuites/js.js Co-authored-by: Aditya Mukhopadhyay <aditya@arangodb.com> * Update js/client/modules/@arangodb/testsuites/php.js Co-authored-by: Aditya Mukhopadhyay <aditya@arangodb.com> * Update js/client/modules/@arangodb/testsuites/rta_makedata.js Co-authored-by: Aditya Mukhopadhyay <aditya@arangodb.com> * Update js/client/modules/@arangodb/testsuites/go.js Co-authored-by: Aditya Mukhopadhyay <aditya@arangodb.com> * Update js/client/modules/@arangodb/testsuites/java.js Co-authored-by: Aditya Mukhopadhyay <aditya@arangodb.com> * Update js/client/modules/@arangodb/testsuites/endpoints.js Co-authored-by: Aditya Mukhopadhyay <aditya@arangodb.com> * Update js/client/modules/@arangodb/testsuites/export.js Co-authored-by: Aditya Mukhopadhyay <aditya@arangodb.com> * Update js/client/modules/@arangodb/testsuites/importing.js Co-authored-by: Aditya Mukhopadhyay <aditya@arangodb.com> * Update js/client/modules/@arangodb/testsuites/permissions_client.js Co-authored-by: Aditya Mukhopadhyay <aditya@arangodb.com> * Update js/client/modules/@arangodb/testsuites/server_permissions.js Co-authored-by: Aditya Mukhopadhyay <aditya@arangodb.com> * Update js/client/modules/@arangodb/testutils/testrunner.js Co-authored-by: Aditya Mukhopadhyay <aditya@arangodb.com> * Update js/client/modules/@arangodb/testsuites/replication.js Co-authored-by: Aditya Mukhopadhyay <aditya@arangodb.com> * disable bypass * add check whether arangods exited early during startup * move haxxman string into one common place * fix typo, bucket splitting * fix authentification setting in restart Co-authored-by: Jan <jsteemann@users.noreply.github.com> Co-authored-by: Aditya Mukhopadhyay <aditya@arangodb.com>
1 parent cc07505 commit fdc51c7

35 files changed

+2734
-2982
lines changed

js/client/modules/@arangodb/testsuites/agency.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ function agency (options) {
5050

5151
options.agency = true;
5252
options.cluster = false;
53-
let results = tu.performTests(options, testCases, 'agency', tu.runInArangosh);
53+
let results = new tu.runInArangoshRunner(options, 'agency', {}, false, false).run(testCases);
5454

5555
options.agency = saveAgency;
5656
options.cluster = saveCluster;

js/client/modules/@arangodb/testsuites/aql.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,11 @@ function shellApiClient (options) {
8787
// we want this to ensure that in an overload situation we do not
8888
// get random failedLeader / failedFollower jobs during our tests.
8989
let moreOptions = { "agency.supervision-ok-threshold" : "15", "agency.supervision-grace-period" : "30" };
90-
let rc = tu.performTests(opts, testCases, 'shell_api', tu.runInLocalArangosh, moreOptions);
90+
let rc = new tu.runLocalInArangoshRunner(opts, 'shell_api', moreOptions).run(testCases);
9191
options.cleanup = options.cleanup && opts.cleanup;
9292
return rc;
9393
}
94+
9495
// //////////////////////////////////////////////////////////////////////////////
9596
// / @brief TEST: shell_client
9697
// //////////////////////////////////////////////////////////////////////////////
@@ -108,7 +109,7 @@ function shellClient (options) {
108109
// we want this to ensure that in an overload situation we do not
109110
// get random failedLeader / failedFollower jobs during our tests.
110111
let moreOptions = { "agency.supervision-ok-threshold" : "15", "agency.supervision-grace-period" : "30" };
111-
let rc = tu.performTests(opts, testCases, 'shell_client', tu.runInLocalArangosh, moreOptions);
112+
let rc = new tu.runLocalInArangoshRunner(opts, 'shell_client', moreOptions).run(testCases);
112113
options.cleanup = options.cleanup && opts.cleanup;
113114
return rc;
114115
}
@@ -125,7 +126,7 @@ function shellServer (options) {
125126
testCases = tu.splitBuckets(options, testCases);
126127

127128
let opts = ensureServers(options, 3);
128-
let rc = tu.performTests(opts, testCases, 'shell_server', tu.runThere);
129+
let rc = new tu.runOnArangodRunner(opts, 'shell_server', {}).run(testCases);
129130
options.cleanup = options.cleanup && opts.cleanup;
130131
return rc;
131132
}
@@ -140,7 +141,7 @@ function shellServerOnly (options) {
140141
testCases = tu.splitBuckets(options, testCases);
141142

142143
let opts = ensureServers(options, 3);
143-
let rc = tu.performTests(opts, testCases, 'shell_server_only', tu.runThere);
144+
let rc = new tu.runOnArangodRunner(opts, 'shell_server_only', {}).run(testCases);
144145
options.cleanup = options.cleanup && opts.cleanup;
145146
return rc;
146147
}
@@ -164,7 +165,7 @@ function shellServerAql (options) {
164165
testCases = tu.splitBuckets(options, testCases);
165166

166167
let opts = ensureServers(options, 3);
167-
let rc = tu.performTests(opts, testCases, name, tu.runThere);
168+
let rc = new tu.runOnArangodRunner(opts, name, {}).run(testCases);
168169
options.cleanup = options.cleanup && opts.cleanup;
169170
return rc;
170171
}
@@ -196,7 +197,7 @@ function shellClientAql (options) {
196197
testCases = tu.splitBuckets(options, testCases);
197198

198199
let opts = ensureServers(options, 3);
199-
let rc = tu.performTests(opts, testCases, name, tu.runInLocalArangosh);
200+
let rc = new tu.runLocalInArangoshRunner(opts, name, {}).run(testCases);
200201
options.cleanup = options.cleanup && opts.cleanup;
201202
return rc;
202203
}

js/client/modules/@arangodb/testsuites/audit.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,17 +70,18 @@ function auditLog(onServer) {
7070

7171
options.auditLoggingEnabled = true;
7272

73-
const serverOptions = {
74-
'server.authentication': 'true',
75-
'server.jwt-secret': 'haxxmann',
73+
const serverOptions = Object.assign({}, tu.testServerAuthInfo, {
7674
'log.level': 'audit-authentication=info',
7775
'log.force-direct': true
78-
};
76+
});
7977

8078
print(CYAN + 'Audit log server tests...' + RESET);
8179
let testCases = tu.scanTestPaths(testPaths['audit_' + (onServer ? 'server' : 'client')], options);
82-
83-
return tu.performTests(options, testCases, 'audit', onServer ? tu.runThere : tu.runInArangosh, serverOptions);
80+
if (onServer) {
81+
return new tu.runOnArangodRunner(options, 'audit', serverOptions).run(testCases);
82+
} else {
83+
return new tu.runInArangoshRunner(options, 'audit', serverOptions).run(testCases);
84+
}
8485
};
8586
}
8687

js/client/modules/@arangodb/testsuites/authentication.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,11 @@ function authenticationClient (options) {
7474

7575
testCases = tu.splitBuckets(options, testCases);
7676

77-
return tu.performTests(options, testCases, 'authentication', tu.runInArangosh, {
78-
'server.authentication': 'true',
79-
'server.jwt-secret': 'haxxmann',
80-
'cluster.create-waits-for-sync-replication': false
81-
});
77+
return new tu.runInArangoshRunner(options, 'authentication', Object.assign(
78+
{},
79+
tu.testServerAuthInfo, {
80+
'cluster.create-waits-for-sync-replication': false
81+
}), false).run(testCases);
8282
}
8383

8484
function authenticationServer (options) {
@@ -97,11 +97,11 @@ function authenticationServer (options) {
9797
}
9898

9999
print(CYAN + 'Server Authentication tests...' + RESET);
100-
return tu.performTests(options, testCases, 'authentication_server', tu.runThere, {
101-
'server.authentication': 'true',
102-
'server.jwt-secret': 'haxxmann',
103-
'cluster.create-waits-for-sync-replication': false
104-
});
100+
return new tu.runOnArangodRunner(options, 'authentication_server', Object.assign(
101+
{},
102+
tu.testServerAuthInfo, {
103+
'cluster.create-waits-for-sync-replication': false
104+
}), false).run(testCases);
105105
}
106106

107107
// //////////////////////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)
0