Skip to content

Commit 2f2da32

Browse files
committed
chore(web): add test case for flex
1 parent 36f5622 commit 2f2da32

File tree

2 files changed

+34
-2
lines changed

2 files changed

+34
-2
lines changed

packages/compass-indexes/src/modules/rolling-indexes-service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export class RollingIndexesService {
7272
atlasMetadata.metricsType === 'flex'
7373
) {
7474
throw new Error(
75-
'Flex clusters don not support rolling index build creation'
75+
'Flex clusters do not support rolling index build creation'
7676
);
7777
}
7878

packages/compass-web/src/connection-storage.spec.ts

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,35 @@ describe('buildConnectionInfoFromClusterDescription', function () {
125125
},
126126
'mongodb+srv://serverless.mongodb.com/?tls=true&authMechanism=MONGODB-X509&authSource=%24external&serverMonitoringMode=poll&maxIdleTimeMS=30000&minPoolSize=0&maxPoolSize=5',
127127
],
128+
[
129+
'flex',
130+
{
131+
'@provider': 'FLEX',
132+
uniqueId: '123abc',
133+
groupId: 'abc',
134+
name: 'Cluster0-flex',
135+
clusterType: 'REPLICASET',
136+
srvAddress: 'flex.mongodb.com',
137+
state: 'IDLE',
138+
deploymentItemName: 'flex-xxx',
139+
dataProcessingRegion: {
140+
regionalUrl: 'https://example.com',
141+
},
142+
replicationSpecList: [
143+
{
144+
regionConfigs: [
145+
{
146+
priority: 1,
147+
electableSpecs: {
148+
instanceSize: 'FLEX',
149+
},
150+
},
151+
],
152+
},
153+
],
154+
},
155+
'mongodb+srv://flex.mongodb.com/?tls=true&authMechanism=MONGODB-X509&authSource=%24external&serverMonitoringMode=poll&maxIdleTimeMS=30000&minPoolSize=0&maxPoolSize=5',
156+
],
128157
];
129158

130159
for (const [type, clusterDescription, connectionString] of tests) {
@@ -162,7 +191,10 @@ describe('buildConnectionInfoFromClusterDescription', function () {
162191
.deep.eq({
163192
orgId: '123',
164193
projectId: 'abc',
165-
metricsId: type === 'serverless' ? `Cluster0-serverless` : '123abc',
194+
metricsId:
195+
type === 'serverless' || type === 'flex'
196+
? `Cluster0-${type}`
197+
: '123abc',
166198
clusterName: `Cluster0-${type}`,
167199
clusterUniqueId: '123abc',
168200
metricsType: type === 'sharded' ? 'cluster' : type,

0 commit comments

Comments
 (0)