-
Notifications
You must be signed in to change notification settings - Fork 381
Expand file tree
/
Copy pathload_libs-8.3.js
More file actions
48 lines (37 loc) · 1.71 KB
/
Copy pathload_libs-8.3.js
File metadata and controls
48 lines (37 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// All changes required to run JS tests in legacy / qa-tests directories should go in this file.
// Assume that the shell is running from either test/legacy42/ or test/qa-tests directories for load paths.
// This file intentionally loads the libs for 8.1, since the changes for 8.1 are the same as what we
// need for 8.3.
if (typeof TestData == "undefined") {
print('Initialising TestData in load_libs.8.3.js')
TestData = new Object();
}
const {ReplSetTest} = await import('../shell_common/libs/replsettest-8.1.js');
globalThis.ReplSetTest = ReplSetTest
const {ShardingTest} = await import('../shell_common/libs/shardingtest-8.1.js');
globalThis.ShardingTest = ShardingTest
// SERVER-95628 - In 8.1 shell rawMongoProgramOutput expects a regexp argument to match the program output.
// Change it here specifically when running from 8.1 shell.
var __origRawMongoProgramOutput = rawMongoProgramOutput;
rawMongoProgramOutput = function() { return __origRawMongoProgramOutput('.*') };
// This function is copied from an earlier version of the server JS tests; it was
// removed in SERVER-109431 as dead code because nothing in the server was using it.
ToolTest.prototype.runTool = function () {
let a = ["mongo" + arguments[0]];
let hasdbpath = false;
let hasDialTimeout = false;
for (let i = 1; i < arguments.length; i++) {
a.push(arguments[i]);
if (arguments[i] === "--dbpath") hasdbpath = true;
if (arguments[i] === "--dialTimeout") hasDialTimeout = true;
}
if (!hasdbpath) {
a.push("--host");
a.push("127.0.0.1:" + this.port);
}
if (!hasDialTimeout) {
a.push("--dialTimeout");
a.push("30");
}
return runMongoProgram.apply(null, a);
};