Skip to content

Commit ec67b8e

Browse files
authored
chore(eol-server): update tests & eol server COMPASS-9909 (#7393)
* e2e-tests eol server checks * bump expected EoL server version
1 parent 128cc89 commit ec67b8e

File tree

8 files changed

+51
-135
lines changed

8 files changed

+51
-135
lines changed

packages/compass-connections/src/utils/end-of-life-server.spec.ts

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { expect } from 'chai';
22
import { isEndOfLifeVersion } from './end-of-life-server';
33

44
describe('isEndOfLifeVersion', function () {
5-
const LATEST_END_OF_LIFE_VERSION = '4.4.x';
5+
const LATEST_END_OF_LIFE_VERSION = '6.x';
66

77
function expectVersions(versions: string[], expected: boolean) {
88
for (const version of versions) {
@@ -15,17 +15,25 @@ describe('isEndOfLifeVersion', function () {
1515
}
1616
}
1717

18-
it('returns true for v4.4 and below', () => {
18+
it('returns true for versions below v7.0', () => {
1919
expectVersions(
20-
['4.4.0', '4.3.0', '4.0', '4.0-beta.0', '1.0.0', '0.0.1', '3.999.0'],
20+
[
21+
'6.2',
22+
'6.0.2',
23+
'6.0.0',
24+
'4.4.0',
25+
'4.3.0',
26+
'4.0',
27+
'4.0-beta.0',
28+
'1.0.0',
29+
'0.0.1',
30+
'3.999.0',
31+
],
2132
true
2233
);
2334
});
2435

25-
it('returns true for v4.5 and above', () => {
26-
expectVersions(
27-
['4.5.0', '5.0.0', '5.0.25', '6.0.0', '7.0.0', '8.0.0'],
28-
false
29-
);
36+
it('returns false for v7.0 and above', () => {
37+
expectVersions(['7.0.0', '8.0.0'], false);
3038
});
3139
});

packages/compass-connections/src/utils/end-of-life-server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { createLogger } from '@mongodb-js/compass-logging';
55

66
const { mongoLogId, log, debug } = createLogger('END-OF-LIFE-SERVER');
77

8-
const FALLBACK_END_OF_LIFE_SERVER_VERSION = '4.4';
8+
const FALLBACK_END_OF_LIFE_SERVER_VERSION = '6.x';
99
const {
1010
HADRON_AUTO_UPDATE_ENDPOINT = process.env
1111
.HADRON_AUTO_UPDATE_ENDPOINT_OVERRIDE,

packages/compass-e2e-tests/tests/collection-aggregations-tab.test.ts

Lines changed: 10 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -157,46 +157,35 @@ describe('Collection aggregations tab', function () {
157157
'$bucketAuto',
158158
'$collStats',
159159
'$count',
160+
'$densify',
160161
'$facet',
162+
'$fill',
161163
'$geoNear',
162164
'$graphLookup',
163165
'$group',
164166
'$indexStats',
165167
'$limit',
166168
'$lookup',
167169
'$match',
170+
'$merge',
168171
'$out',
169172
'$project',
170173
'$redact',
171174
'$replaceRoot',
175+
'$replaceWith',
172176
'$sample',
177+
'$search',
178+
'$searchMeta',
179+
'$set',
180+
'$setWindowFields',
173181
'$skip',
174182
'$sort',
175183
'$sortByCount',
184+
'$unionWith',
185+
'$unset',
176186
'$unwind',
177187
];
178188

179-
if (serverSatisfies('>= 4.1.11')) {
180-
expectedAggregations.push('$search');
181-
}
182-
if (serverSatisfies('>= 4.2.0')) {
183-
expectedAggregations.push('$merge', '$replaceWith', '$set', '$unset');
184-
}
185-
if (serverSatisfies('>= 4.4.0')) {
186-
expectedAggregations.push('$unionWith');
187-
}
188-
if (serverSatisfies('>= 4.4.9')) {
189-
expectedAggregations.push('$searchMeta');
190-
}
191-
if (serverSatisfies('>= 5.0.0')) {
192-
expectedAggregations.push('$setWindowFields');
193-
}
194-
if (serverSatisfies('>= 5.1.0')) {
195-
expectedAggregations.push('$densify');
196-
}
197-
if (serverSatisfies('>= 5.3.0')) {
198-
expectedAggregations.push('$fill');
199-
}
200189
if (serverSatisfies('>=6.0.10 <7.0.0 || >=7.0.2')) {
201190
expectedAggregations.push('$vectorSearch');
202191
}
@@ -225,10 +214,6 @@ describe('Collection aggregations tab', function () {
225214
});
226215

227216
it('shows atlas only stage preview', async function () {
228-
if (serverSatisfies('< 4.1.11')) {
229-
this.skip();
230-
}
231-
232217
await browser.selectStageOperator(0, '$search');
233218

234219
await browser.waitUntil(async function () {
@@ -255,11 +240,6 @@ describe('Collection aggregations tab', function () {
255240
});
256241

257242
it('shows $merge stage preview', async function () {
258-
// $merge operator is supported from 4.2.0
259-
if (serverSatisfies('< 4.2.0')) {
260-
return this.skip();
261-
}
262-
263243
await browser.selectStageOperator(0, '$merge');
264244
await browser.setCodemirrorEditorValue(
265245
Selectors.stageEditor(0),
@@ -623,10 +603,6 @@ describe('Collection aggregations tab', function () {
623603
'{ $jsonSchema: { bsonType: "object", required: [ "phone" ] } }';
624604
const VALIDATED_OUT_COLLECTION = 'nestedDocs';
625605
beforeEach(async function () {
626-
if (serverSatisfies('< 5.0.0')) {
627-
return this.skip();
628-
}
629-
630606
await browser.setValidation({
631607
connectionName: DEFAULT_CONNECTION_NAME_1,
632608
database: 'test',
@@ -643,10 +619,6 @@ describe('Collection aggregations tab', function () {
643619
});
644620

645621
afterEach(async function () {
646-
if (serverSatisfies('< 5.0.0')) {
647-
return this.skip();
648-
}
649-
650622
await browser.setValidation({
651623
connectionName: DEFAULT_CONNECTION_NAME_1,
652624
database: 'test',
@@ -755,10 +727,6 @@ describe('Collection aggregations tab', function () {
755727
});
756728

757729
it('supports $merge as the last stage', async function () {
758-
if (serverSatisfies('< 4.2.0')) {
759-
return this.skip();
760-
}
761-
762730
await browser.selectStageOperator(0, '$merge');
763731
await browser.setCodemirrorEditorValue(
764732
Selectors.stageEditor(0),
@@ -823,10 +791,6 @@ describe('Collection aggregations tab', function () {
823791
});
824792

825793
it('cancels pipeline with $merge as the last stage', async function () {
826-
if (serverSatisfies('< 4.2.0')) {
827-
return this.skip();
828-
}
829-
830794
await browser.selectStageOperator(0, '$merge');
831795
await browser.setCodemirrorEditorValue(
832796
Selectors.stageEditor(0),
@@ -951,12 +915,6 @@ describe('Collection aggregations tab', function () {
951915
});
952916

953917
it('supports cancelling long-running aggregations', async function () {
954-
if (serverSatisfies('< 4.4.0')) {
955-
// $function expression that we use to simulate slow aggregation is only
956-
// supported since server 4.4
957-
this.skip();
958-
}
959-
960918
const slowQuery = `{
961919
sleep: {
962920
$function: {
@@ -1518,10 +1476,6 @@ describe('Collection aggregations tab', function () {
15181476
});
15191477

15201478
it('handles $merge stage operators', async function () {
1521-
if (serverSatisfies('< 4.2.0')) {
1522-
return this.skip();
1523-
}
1524-
15251479
await browser.selectStageOperator(0, '$merge');
15261480
await browser.setCodemirrorEditorValue(
15271481
Selectors.stageEditor(0),
@@ -1540,10 +1494,6 @@ describe('Collection aggregations tab', function () {
15401494
});
15411495

15421496
it('handles atlas only operator', async function () {
1543-
if (serverSatisfies('< 4.1.11')) {
1544-
this.skip();
1545-
}
1546-
15471497
await browser.selectStageOperator(0, '$search');
15481498
await browser.setCodemirrorEditorValue(Selectors.stageEditor(0), '{}');
15491499

packages/compass-e2e-tests/tests/collection-documents-tab.test.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import {
1313
TEST_COMPASS_WEB,
1414
skipForWeb,
1515
DEFAULT_CONNECTION_NAME_1,
16-
serverSatisfies,
1716
} from '../helpers/compass';
1817
import type { Compass } from '../helpers/compass';
1918
import * as Selectors from '../helpers/selectors';
@@ -697,10 +696,6 @@ FindIterable<Document> result = collection.find(filter);`);
697696
const REQUIRE_PHONE_VALIDATOR =
698697
'{ $jsonSchema: { bsonType: "object", required: [ "phone" ] } }';
699698
beforeEach(async function () {
700-
if (serverSatisfies('< 5.0.0')) {
701-
return this.skip();
702-
}
703-
704699
await browser.setValidation({
705700
connectionName: DEFAULT_CONNECTION_NAME_1,
706701
database: 'test',

packages/compass-e2e-tests/tests/collection-import.test.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import {
1010
skipForWeb,
1111
TEST_COMPASS_WEB,
1212
DEFAULT_CONNECTION_NAME_1,
13-
serverSatisfies,
1413
} from '../helpers/compass';
1514
import type { Compass } from '../helpers/compass';
1615
import * as Selectors from '../helpers/selectors';
@@ -545,11 +544,6 @@ describe('Collection import', function () {
545544
});
546545

547546
it('with JSON + abort on error checked, it displays a validation error with details', async function () {
548-
// 4.x doesn't provide validation details
549-
if (serverSatisfies('< 5.0.0')) {
550-
this.skip();
551-
}
552-
553547
const jsonPath = path.resolve(
554548
__dirname,
555549
'..',
@@ -605,11 +599,6 @@ describe('Collection import', function () {
605599
});
606600

607601
it('with CSV + abort on error unchecked, it includes the details in a file', async function () {
608-
// 4.x doesn't provide validation details
609-
if (serverSatisfies('< 5.0.0')) {
610-
this.skip();
611-
}
612-
613602
const filename = 'array-documents.csv';
614603
const csvPath = path.resolve(__dirname, '..', 'fixtures', filename);
615604

packages/compass-e2e-tests/tests/collection-indexes-tab.test.ts

Lines changed: 24 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -75,47 +75,35 @@ describe('Collection indexes tab', function () {
7575
await browser.dropIndex(createdIndexName, 'drop-index-modal-basic.png');
7676
});
7777

78-
describe('server version 4.2.0', function () {
79-
it('supports creating a wildcard index', async function () {
80-
if (serverSatisfies('< 4.2.0')) {
81-
return this.skip();
82-
}
83-
84-
const indexName = await browser.createIndex(
85-
{
86-
fieldName: '$**',
87-
indexType: '1',
88-
},
89-
{
90-
wildcardProjection: '{ "fieldA": 1, "fieldB.fieldC": 1 }',
91-
},
92-
'create-index-modal-wildcard.png'
93-
);
78+
it('supports creating a wildcard index', async function () {
79+
const indexName = await browser.createIndex(
80+
{
81+
fieldName: '$**',
82+
indexType: '1',
83+
},
84+
{
85+
wildcardProjection: '{ "fieldA": 1, "fieldB.fieldC": 1 }',
86+
},
87+
'create-index-modal-wildcard.png'
88+
);
9489

95-
const indexFieldTypeSelector = `${Selectors.indexComponent(indexName)} ${
96-
Selectors.IndexFieldType
97-
}`;
98-
const indexFieldTypeElement = browser.$(indexFieldTypeSelector);
99-
expect(await indexFieldTypeElement.getText()).to.equal('WILDCARD');
90+
const indexFieldTypeSelector = `${Selectors.indexComponent(indexName)} ${
91+
Selectors.IndexFieldType
92+
}`;
93+
const indexFieldTypeElement = browser.$(indexFieldTypeSelector);
94+
expect(await indexFieldTypeElement.getText()).to.equal('WILDCARD');
10095

101-
await browser.dropIndex(indexName, 'drop-index-modal-wildcard.png');
102-
});
96+
await browser.dropIndex(indexName, 'drop-index-modal-wildcard.png');
10397
});
10498

105-
describe('server version 4.4.0', function () {
106-
it('supports hiding and unhiding indexes', async function () {
107-
if (serverSatisfies('< 4.4.0')) {
108-
return this.skip();
109-
}
110-
111-
const indexName = await browser.createIndex({
112-
fieldName: 'i',
113-
indexType: 'text',
114-
});
115-
116-
await browser.hideIndex(indexName, 'hide-index-modal.png');
117-
await browser.unhideIndex(indexName, 'unhide-index-modal.png');
99+
it('supports hiding and unhiding indexes', async function () {
100+
const indexName = await browser.createIndex({
101+
fieldName: 'i',
102+
indexType: 'text',
118103
});
104+
105+
await browser.hideIndex(indexName, 'hide-index-modal.png');
106+
await browser.unhideIndex(indexName, 'unhide-index-modal.png');
119107
});
120108

121109
describe('server version 20.0.0', function () {

packages/compass-e2e-tests/tests/database-collections-tab.test.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -212,10 +212,6 @@ describe('Database collections tab', function () {
212212
});
213213

214214
it('can create a time series collection', async function () {
215-
if (serverSatisfies('< 5.0.0')) {
216-
return this.skip();
217-
}
218-
219215
const collectionName = 'my-timeseries-collection';
220216

221217
// open the create collection modal from the button at the top
@@ -285,10 +281,6 @@ describe('Database collections tab', function () {
285281
});
286282

287283
it('can create a clustered collection', async function () {
288-
if (serverSatisfies('< 5.3.0')) {
289-
return this.skip();
290-
}
291-
292284
const collectionName = 'my-clustered-collection';
293285
const indexName = 'my-clustered-index';
294286

packages/compass-e2e-tests/tests/search-indexes.test.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import {
44
cleanup,
55
screenshotIfFailed,
66
Selectors,
7-
serverSatisfies,
87
skipForWeb,
98
TEST_COMPASS_WEB,
109
DEFAULT_CONNECTION_STRING_1,
@@ -158,11 +157,6 @@ describe('Search Indexes', function () {
158157

159158
before(async function () {
160159
skipForWeb(this, 'search indexes disabled on compass-web');
161-
162-
// $search works with server 4.2 or more
163-
if (!serverSatisfies('>= 4.1.11')) {
164-
this.skip();
165-
}
166160
compass = await init(this.test?.fullTitle());
167161
browser = compass.browser;
168162
});

0 commit comments

Comments
 (0)