Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,46 +157,35 @@ describe('Collection aggregations tab', function () {
'$bucketAuto',
'$collStats',
'$count',
'$densify',
'$facet',
'$fill',
'$geoNear',
'$graphLookup',
'$group',
'$indexStats',
'$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');
}
Expand Down Expand Up @@ -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 () {
Expand All @@ -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),
Expand Down Expand Up @@ -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',
Expand All @@ -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',
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -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: {
Expand Down Expand Up @@ -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),
Expand All @@ -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), '{}');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -697,10 +696,6 @@ FindIterable<Document> 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',
Expand Down
11 changes: 0 additions & 11 deletions packages/compass-e2e-tests/tests/collection-import.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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,
'..',
Expand Down Expand Up @@ -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);

Expand Down
60 changes: 24 additions & 36 deletions packages/compass-e2e-tests/tests/collection-indexes-tab.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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';

Expand Down
6 changes: 0 additions & 6 deletions packages/compass-e2e-tests/tests/search-indexes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
cleanup,
screenshotIfFailed,
Selectors,
serverSatisfies,
skipForWeb,
TEST_COMPASS_WEB,
DEFAULT_CONNECTION_STRING_1,
Expand Down Expand Up @@ -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;
});
Expand Down
Loading