MCPcopy
hub / github.com/mongodb/node-mongodb-native / TestConfiguration

Class TestConfiguration

test/tools/runner/config.ts:84–513  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82}
83
84export class TestConfiguration {
85 version: string;
86 clientSideEncryption: {
87 enabled: boolean;
88 mongodbClientEncryption: any;
89 version: string;
90 libmongocrypt: string | null;
91 };
92 cryptSharedVersion: MongoClient['autoEncrypter']['cryptSharedLibVersionInfo'] | null;
93 parameters: Record<string, any>;
94 singleMongosLoadBalancerUri: string;
95 multiMongosLoadBalancerUri: string;
96 topologyType: TopologyType;
97 buildInfo: Record<string, any>;
98 options: {
99 hosts?: string[];
100 hostAddresses: HostAddress[];
101 hostAddress?: HostAddress;
102 host?: string;
103 port?: number;
104 db?: string;
105 replicaSet?: string;
106 authMechanism?: string;
107 authMechanismProperties?: Record<string, any>;
108 auth?: { username: string; password: string; authSource?: string };
109 proxyURIParams?: ProxyParams;
110 };
111 serverApi?: ServerApi;
112 activeResources: number;
113 isSrv: boolean;
114 filters: Record<string, Filter>;
115 compressor: CompressorName | null;
116
117 constructor(
118 private uri: string,
119 private context: Record<string, any>
120 ) {
121 const url = new ConnectionString(uri);
122 const { hosts } = url;
123 const hostAddresses = hosts.map(HostAddress.fromString);
124 this.version = context.version;
125 this.clientSideEncryption = context.clientSideEncryption;
126 this.cryptSharedVersion = context.cryptShared;
127 this.parameters = { ...context.parameters };
128 this.singleMongosLoadBalancerUri = context.singleMongosLoadBalancerUri;
129 this.multiMongosLoadBalancerUri = context.multiMongosLoadBalancerUri;
130 this.topologyType = this.isLoadBalanced ? TopologyType.LoadBalanced : context.topologyType;
131 this.buildInfo = context.buildInfo;
132 this.serverApi = context.serverApi;
133 this.isSrv = uri.indexOf('mongodb+srv') > -1;
134 this.compressor = getCompressor(process.env.COMPRESSOR);
135 this.options = {
136 hosts,
137 hostAddresses,
138 hostAddress: hostAddresses[0],
139 host: hostAddresses[0].host,
140 port: typeof hostAddresses[0].host === 'string' && hostAddresses[0].port,
141 db: url.pathname.slice(1) ? url.pathname.slice(1) : 'integration_tests',

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected