diff --git a/packages/compass-connections/src/utils/end-of-life-server.spec.ts b/packages/compass-connections/src/utils/end-of-life-server.spec.ts index ad0e0271008..317c9f7ddf9 100644 --- a/packages/compass-connections/src/utils/end-of-life-server.spec.ts +++ b/packages/compass-connections/src/utils/end-of-life-server.spec.ts @@ -2,7 +2,7 @@ import { expect } from 'chai'; import { isEndOfLifeVersion } from './end-of-life-server'; describe('isEndOfLifeVersion', function () { - const LATEST_END_OF_LIFE_VERSION = '4.4.x'; + const LATEST_END_OF_LIFE_VERSION = '6.x'; function expectVersions(versions: string[], expected: boolean) { for (const version of versions) { @@ -15,17 +15,25 @@ describe('isEndOfLifeVersion', function () { } } - it('returns true for v4.4 and below', () => { + it('returns true for versions below v7.0', () => { expectVersions( - ['4.4.0', '4.3.0', '4.0', '4.0-beta.0', '1.0.0', '0.0.1', '3.999.0'], + [ + '6.2', + '6.0.2', + '6.0.0', + '4.4.0', + '4.3.0', + '4.0', + '4.0-beta.0', + '1.0.0', + '0.0.1', + '3.999.0', + ], true ); }); - it('returns true for v4.5 and above', () => { - expectVersions( - ['4.5.0', '5.0.0', '5.0.25', '6.0.0', '7.0.0', '8.0.0'], - false - ); + it('returns false for v7.0 and above', () => { + expectVersions(['7.0.0', '8.0.0'], false); }); }); diff --git a/packages/compass-connections/src/utils/end-of-life-server.ts b/packages/compass-connections/src/utils/end-of-life-server.ts index bd069796fec..1951f37e24e 100644 --- a/packages/compass-connections/src/utils/end-of-life-server.ts +++ b/packages/compass-connections/src/utils/end-of-life-server.ts @@ -5,7 +5,7 @@ import { createLogger } from '@mongodb-js/compass-logging'; const { mongoLogId, log, debug } = createLogger('END-OF-LIFE-SERVER'); -const FALLBACK_END_OF_LIFE_SERVER_VERSION = '4.4'; +const FALLBACK_END_OF_LIFE_SERVER_VERSION = '6.x'; const { HADRON_AUTO_UPDATE_ENDPOINT = process.env .HADRON_AUTO_UPDATE_ENDPOINT_OVERRIDE, diff --git a/packages/compass-e2e-tests/tests/collection-aggregations-tab.test.ts b/packages/compass-e2e-tests/tests/collection-aggregations-tab.test.ts index 939c4944d36..4b32eefd0fc 100644 --- a/packages/compass-e2e-tests/tests/collection-aggregations-tab.test.ts +++ b/packages/compass-e2e-tests/tests/collection-aggregations-tab.test.ts @@ -157,7 +157,9 @@ describe('Collection aggregations tab', function () { '$bucketAuto', '$collStats', '$count', + '$densify', '$facet', + '$fill', '$geoNear', '$graphLookup', '$group', @@ -165,38 +167,25 @@ describe('Collection aggregations tab', function () { '$limit', '$lookup', '$match', + '$merge', '$out', '$project', '$redact', '$replaceRoot', + '$replaceWith', '$sample', + '$search', + '$searchMeta', + '$set', + '$setWindowFields', '$skip', '$sort', '$sortByCount', + '$unionWith', + '$unset', '$unwind', ]; - if (serverSatisfies('>= 4.1.11')) { - expectedAggregations.push('$search'); - } - if (serverSatisfies('>= 4.2.0')) { - expectedAggregations.push('$merge', '$replaceWith', '$set', '$unset'); - } - if (serverSatisfies('>= 4.4.0')) { - expectedAggregations.push('$unionWith'); - } - if (serverSatisfies('>= 4.4.9')) { - expectedAggregations.push('$searchMeta'); - } - if (serverSatisfies('>= 5.0.0')) { - expectedAggregations.push('$setWindowFields'); - } - if (serverSatisfies('>= 5.1.0')) { - expectedAggregations.push('$densify'); - } - if (serverSatisfies('>= 5.3.0')) { - expectedAggregations.push('$fill'); - } if (serverSatisfies('>=6.0.10 <7.0.0 || >=7.0.2')) { expectedAggregations.push('$vectorSearch'); } @@ -225,10 +214,6 @@ describe('Collection aggregations tab', function () { }); it('shows atlas only stage preview', async function () { - if (serverSatisfies('< 4.1.11')) { - this.skip(); - } - await browser.selectStageOperator(0, '$search'); await browser.waitUntil(async function () { @@ -255,11 +240,6 @@ describe('Collection aggregations tab', function () { }); it('shows $merge stage preview', async function () { - // $merge operator is supported from 4.2.0 - if (serverSatisfies('< 4.2.0')) { - return this.skip(); - } - await browser.selectStageOperator(0, '$merge'); await browser.setCodemirrorEditorValue( Selectors.stageEditor(0), @@ -623,10 +603,6 @@ describe('Collection aggregations tab', function () { '{ $jsonSchema: { bsonType: "object", required: [ "phone" ] } }'; const VALIDATED_OUT_COLLECTION = 'nestedDocs'; beforeEach(async function () { - if (serverSatisfies('< 5.0.0')) { - return this.skip(); - } - await browser.setValidation({ connectionName: DEFAULT_CONNECTION_NAME_1, database: 'test', @@ -643,10 +619,6 @@ describe('Collection aggregations tab', function () { }); afterEach(async function () { - if (serverSatisfies('< 5.0.0')) { - return this.skip(); - } - await browser.setValidation({ connectionName: DEFAULT_CONNECTION_NAME_1, database: 'test', @@ -755,10 +727,6 @@ describe('Collection aggregations tab', function () { }); it('supports $merge as the last stage', async function () { - if (serverSatisfies('< 4.2.0')) { - return this.skip(); - } - await browser.selectStageOperator(0, '$merge'); await browser.setCodemirrorEditorValue( Selectors.stageEditor(0), @@ -823,10 +791,6 @@ describe('Collection aggregations tab', function () { }); it('cancels pipeline with $merge as the last stage', async function () { - if (serverSatisfies('< 4.2.0')) { - return this.skip(); - } - await browser.selectStageOperator(0, '$merge'); await browser.setCodemirrorEditorValue( Selectors.stageEditor(0), @@ -951,12 +915,6 @@ describe('Collection aggregations tab', function () { }); it('supports cancelling long-running aggregations', async function () { - if (serverSatisfies('< 4.4.0')) { - // $function expression that we use to simulate slow aggregation is only - // supported since server 4.4 - this.skip(); - } - const slowQuery = `{ sleep: { $function: { @@ -1518,10 +1476,6 @@ describe('Collection aggregations tab', function () { }); it('handles $merge stage operators', async function () { - if (serverSatisfies('< 4.2.0')) { - return this.skip(); - } - await browser.selectStageOperator(0, '$merge'); await browser.setCodemirrorEditorValue( Selectors.stageEditor(0), @@ -1540,10 +1494,6 @@ describe('Collection aggregations tab', function () { }); it('handles atlas only operator', async function () { - if (serverSatisfies('< 4.1.11')) { - this.skip(); - } - await browser.selectStageOperator(0, '$search'); await browser.setCodemirrorEditorValue(Selectors.stageEditor(0), '{}'); diff --git a/packages/compass-e2e-tests/tests/collection-documents-tab.test.ts b/packages/compass-e2e-tests/tests/collection-documents-tab.test.ts index 7e8293bbc02..5466975e8ab 100644 --- a/packages/compass-e2e-tests/tests/collection-documents-tab.test.ts +++ b/packages/compass-e2e-tests/tests/collection-documents-tab.test.ts @@ -13,7 +13,6 @@ import { TEST_COMPASS_WEB, skipForWeb, DEFAULT_CONNECTION_NAME_1, - serverSatisfies, } from '../helpers/compass'; import type { Compass } from '../helpers/compass'; import * as Selectors from '../helpers/selectors'; @@ -697,10 +696,6 @@ FindIterable result = collection.find(filter);`); const REQUIRE_PHONE_VALIDATOR = '{ $jsonSchema: { bsonType: "object", required: [ "phone" ] } }'; beforeEach(async function () { - if (serverSatisfies('< 5.0.0')) { - return this.skip(); - } - await browser.setValidation({ connectionName: DEFAULT_CONNECTION_NAME_1, database: 'test', diff --git a/packages/compass-e2e-tests/tests/collection-import.test.ts b/packages/compass-e2e-tests/tests/collection-import.test.ts index fd76d88b85a..de333b24c2a 100644 --- a/packages/compass-e2e-tests/tests/collection-import.test.ts +++ b/packages/compass-e2e-tests/tests/collection-import.test.ts @@ -10,7 +10,6 @@ import { skipForWeb, TEST_COMPASS_WEB, DEFAULT_CONNECTION_NAME_1, - serverSatisfies, } from '../helpers/compass'; import type { Compass } from '../helpers/compass'; import * as Selectors from '../helpers/selectors'; @@ -545,11 +544,6 @@ describe('Collection import', function () { }); it('with JSON + abort on error checked, it displays a validation error with details', async function () { - // 4.x doesn't provide validation details - if (serverSatisfies('< 5.0.0')) { - this.skip(); - } - const jsonPath = path.resolve( __dirname, '..', @@ -605,11 +599,6 @@ describe('Collection import', function () { }); it('with CSV + abort on error unchecked, it includes the details in a file', async function () { - // 4.x doesn't provide validation details - if (serverSatisfies('< 5.0.0')) { - this.skip(); - } - const filename = 'array-documents.csv'; const csvPath = path.resolve(__dirname, '..', 'fixtures', filename); diff --git a/packages/compass-e2e-tests/tests/collection-indexes-tab.test.ts b/packages/compass-e2e-tests/tests/collection-indexes-tab.test.ts index d95d6ba3912..6ad4d9fd8a4 100644 --- a/packages/compass-e2e-tests/tests/collection-indexes-tab.test.ts +++ b/packages/compass-e2e-tests/tests/collection-indexes-tab.test.ts @@ -75,47 +75,35 @@ describe('Collection indexes tab', function () { await browser.dropIndex(createdIndexName, 'drop-index-modal-basic.png'); }); - describe('server version 4.2.0', function () { - it('supports creating a wildcard index', async function () { - if (serverSatisfies('< 4.2.0')) { - return this.skip(); - } - - const indexName = await browser.createIndex( - { - fieldName: '$**', - indexType: '1', - }, - { - wildcardProjection: '{ "fieldA": 1, "fieldB.fieldC": 1 }', - }, - 'create-index-modal-wildcard.png' - ); + it('supports creating a wildcard index', async function () { + const indexName = await browser.createIndex( + { + fieldName: '$**', + indexType: '1', + }, + { + wildcardProjection: '{ "fieldA": 1, "fieldB.fieldC": 1 }', + }, + 'create-index-modal-wildcard.png' + ); - const indexFieldTypeSelector = `${Selectors.indexComponent(indexName)} ${ - Selectors.IndexFieldType - }`; - const indexFieldTypeElement = browser.$(indexFieldTypeSelector); - expect(await indexFieldTypeElement.getText()).to.equal('WILDCARD'); + const indexFieldTypeSelector = `${Selectors.indexComponent(indexName)} ${ + Selectors.IndexFieldType + }`; + const indexFieldTypeElement = browser.$(indexFieldTypeSelector); + expect(await indexFieldTypeElement.getText()).to.equal('WILDCARD'); - await browser.dropIndex(indexName, 'drop-index-modal-wildcard.png'); - }); + await browser.dropIndex(indexName, 'drop-index-modal-wildcard.png'); }); - describe('server version 4.4.0', function () { - it('supports hiding and unhiding indexes', async function () { - if (serverSatisfies('< 4.4.0')) { - return this.skip(); - } - - const indexName = await browser.createIndex({ - fieldName: 'i', - indexType: 'text', - }); - - await browser.hideIndex(indexName, 'hide-index-modal.png'); - await browser.unhideIndex(indexName, 'unhide-index-modal.png'); + it('supports hiding and unhiding indexes', async function () { + const indexName = await browser.createIndex({ + fieldName: 'i', + indexType: 'text', }); + + await browser.hideIndex(indexName, 'hide-index-modal.png'); + await browser.unhideIndex(indexName, 'unhide-index-modal.png'); }); describe('server version 20.0.0', function () { diff --git a/packages/compass-e2e-tests/tests/database-collections-tab.test.ts b/packages/compass-e2e-tests/tests/database-collections-tab.test.ts index 86181e19d6c..d0d2436a56b 100644 --- a/packages/compass-e2e-tests/tests/database-collections-tab.test.ts +++ b/packages/compass-e2e-tests/tests/database-collections-tab.test.ts @@ -212,10 +212,6 @@ describe('Database collections tab', function () { }); it('can create a time series collection', async function () { - if (serverSatisfies('< 5.0.0')) { - return this.skip(); - } - const collectionName = 'my-timeseries-collection'; // open the create collection modal from the button at the top @@ -285,10 +281,6 @@ describe('Database collections tab', function () { }); it('can create a clustered collection', async function () { - if (serverSatisfies('< 5.3.0')) { - return this.skip(); - } - const collectionName = 'my-clustered-collection'; const indexName = 'my-clustered-index'; diff --git a/packages/compass-e2e-tests/tests/search-indexes.test.ts b/packages/compass-e2e-tests/tests/search-indexes.test.ts index 841f21937f2..0bbd3c529c6 100644 --- a/packages/compass-e2e-tests/tests/search-indexes.test.ts +++ b/packages/compass-e2e-tests/tests/search-indexes.test.ts @@ -4,7 +4,6 @@ import { cleanup, screenshotIfFailed, Selectors, - serverSatisfies, skipForWeb, TEST_COMPASS_WEB, DEFAULT_CONNECTION_STRING_1, @@ -158,11 +157,6 @@ describe('Search Indexes', function () { before(async function () { skipForWeb(this, 'search indexes disabled on compass-web'); - - // $search works with server 4.2 or more - if (!serverSatisfies('>= 4.1.11')) { - this.skip(); - } compass = await init(this.test?.fullTitle()); browser = compass.browser; });