Skip to content

Commit e31f072

Browse files
authored
chore: update mongodb-runner testing server port(#607)
1 parent a2b9b97 commit e31f072

12 files changed

+58
-59
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"watch": "npm run compile && npm-run-all -p watch:*",
4848
"watch:extension": "npm run compile:extension -- -watch",
4949
"watch:extension-bundles": "webpack --mode development --watch",
50-
"pretest": "npm run compile && mongodb-runner start --id=vscode -- --port 27018",
50+
"pretest": "npm run compile && mongodb-runner start --id=vscode -- --port 27088",
5151
"test": "npm run test-webview && npm run test-extension",
5252
"test-extension": "cross-env NODE_OPTIONS=--no-force-async-hooks-checks xvfb-maybe node ./out/test/runTest.js",
5353
"test-webview": "jest",

src/test/suite/commands/launchMongoShell.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@ suite('Commands Test Suite', () => {
6161

6262
test('openMongoDBShell should open a terminal with the active connection driver url', async () => {
6363
const expectedDriverUrl =
64-
'mongodb://localhost:27018/?readPreference=primary&ssl=false';
64+
'mongodb://localhost:27088/?readPreference=primary&ssl=false';
6565

6666
getMongoClientConnectionOptionsStub.returns({
67-
url: 'mongodb://localhost:27018/?readPreference=primary&ssl=false',
67+
url: 'mongodb://localhost:27088/?readPreference=primary&ssl=false',
6868
options: {},
6969
});
7070
isCurrentlyConnectedStub.returns(true);
@@ -92,10 +92,10 @@ suite('Commands Test Suite', () => {
9292

9393
test('powershell openMongoDBShell should open a terminal with the active connection driver url', async () => {
9494
const expectedDriverUrl =
95-
'mongodb://localhost:27018/?readPreference=primary&ssl=false';
95+
'mongodb://localhost:27088/?readPreference=primary&ssl=false';
9696

9797
getMongoClientConnectionOptionsStub.returns({
98-
url: 'mongodb://localhost:27018/?readPreference=primary&ssl=false',
98+
url: 'mongodb://localhost:27088/?readPreference=primary&ssl=false',
9999
options: {},
100100
});
101101

@@ -126,10 +126,10 @@ suite('Commands Test Suite', () => {
126126

127127
test('windows cmd openMongoDBShell should open a terminal with the active connection driver url', async () => {
128128
const expectedDriverUrl =
129-
'mongodb://localhost:27018/?readPreference=primary&ssl=false';
129+
'mongodb://localhost:27088/?readPreference=primary&ssl=false';
130130

131131
getMongoClientConnectionOptionsStub.returns({
132-
url: 'mongodb://localhost:27018/?readPreference=primary&ssl=false',
132+
url: 'mongodb://localhost:27088/?readPreference=primary&ssl=false',
133133
options: {},
134134
});
135135

src/test/suite/connectionController.test.ts

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import KeytarStub from './keytarStub';
3535
import { ext } from '../../extensionConstants';
3636
import type { KeytarInterface } from '../../utils/keytar';
3737

38-
const testDatabaseConnectionName = 'localhost:27018';
38+
const testDatabaseConnectionName = 'localhost:27088';
3939
const testDatabaseURI2WithTimeout =
4040
'mongodb://shouldfail?connectTimeoutMS=1000&serverSelectionTimeoutMS=1000';
4141

@@ -96,7 +96,7 @@ suite('Connection Controller Test Suite', function () {
9696
testConnectionController.getSavedConnections().length,
9797
1
9898
);
99-
assert.strictEqual(name, 'localhost:27018');
99+
assert.strictEqual(name, 'localhost:27088');
100100
assert.strictEqual(testConnectionController.isCurrentlyConnected(), true);
101101

102102
assert.notStrictEqual(dataService, null);
@@ -253,7 +253,7 @@ suite('Connection Controller Test Suite', function () {
253253

254254
test('the connection model loads both global and workspace stored connection models', async () => {
255255
const expectedDriverUrl =
256-
'mongodb://localhost:27018/?appname=mongodb-vscode+0.0.0-dev.0';
256+
'mongodb://localhost:27088/?appname=mongodb-vscode+0.0.0-dev.0';
257257

258258
await vscode.workspace
259259
.getConfiguration('mdb.connectionSaving')
@@ -285,7 +285,7 @@ suite('Connection Controller Test Suite', function () {
285285
assert.strictEqual(Object.keys(connections).length, 4);
286286
assert.strictEqual(
287287
connections[Object.keys(connections)[0]].name,
288-
'localhost:27018'
288+
'localhost:27088'
289289
);
290290
assert.strictEqual(
291291
connections[Object.keys(connections)[2]].connectionOptions
@@ -419,11 +419,11 @@ suite('Connection Controller Test Suite', function () {
419419
const name = testConnectionController._connections[activeId || ''].name;
420420

421421
assert.strictEqual(activeId, id);
422-
assert.strictEqual(name, 'localhost:27018');
422+
assert.strictEqual(name, 'localhost:27088');
423423
});
424424

425425
test('"copyConnectionStringByConnectionId" returns the driver uri of a connection', async () => {
426-
const expectedDriverUrl = 'mongodb://localhost:27018/';
426+
const expectedDriverUrl = 'mongodb://localhost:27088/';
427427

428428
await testConnectionController.loadSavedConnections();
429429
await testConnectionController.addNewConnectionStringAndConnect(
@@ -667,8 +667,8 @@ suite('Connection Controller Test Suite', function () {
667667
const connectionIds = Object.keys(connections);
668668

669669
assert.strictEqual(connectionIds.length, 2);
670-
assert.strictEqual(connections[connectionIds[0]].name, 'localhost:27018');
671-
assert.strictEqual(connections[connectionIds[1]].name, 'localhost:27018');
670+
assert.strictEqual(connections[connectionIds[0]].name, 'localhost:27088');
671+
assert.strictEqual(connections[connectionIds[1]].name, 'localhost:27088');
672672

673673
const inputBoxResolvesStub = sandbox.stub();
674674
inputBoxResolvesStub.onCall(0).resolves('Lynx');
@@ -689,7 +689,7 @@ suite('Connection Controller Test Suite', function () {
689689

690690
assert.strictEqual(connectionQuickPicks.length, 3);
691691
assert.strictEqual(connectionQuickPicks[0].label, 'Add new connection');
692-
assert.strictEqual(connectionQuickPicks[1].label, 'localhost:27018');
692+
assert.strictEqual(connectionQuickPicks[1].label, 'localhost:27088');
693693
assert.strictEqual(connectionQuickPicks[2].label, 'Lynx');
694694
});
695695

@@ -711,7 +711,7 @@ suite('Connection Controller Test Suite', function () {
711711
assert.strictEqual(testConnectionController.isCurrentlyConnected(), true);
712712
assert.strictEqual(
713713
testConnectionController.getActiveConnectionName(),
714-
'localhost:27018'
714+
'localhost:27088'
715715
);
716716
});
717717

@@ -1144,7 +1144,7 @@ suite('Connection Controller Test Suite', function () {
11441144
);
11451145
assert.strictEqual(
11461146
testConnectionController._connections[connections[0].id].name,
1147-
'localhost:27018'
1147+
'localhost:27088'
11481148
);
11491149
});
11501150

@@ -1195,7 +1195,7 @@ suite('Connection Controller Test Suite', function () {
11951195
delete mongoClientConnectionOptions.options.parentHandle;
11961196

11971197
assert.deepStrictEqual(mongoClientConnectionOptions, {
1198-
url: 'mongodb://localhost:27018/?appname=mongodb-vscode+0.0.0-dev.0',
1198+
url: 'mongodb://localhost:27088/?appname=mongodb-vscode+0.0.0-dev.0',
11991199
options: {
12001200
autoEncryption: undefined,
12011201
monitorCommands: true,
@@ -1211,10 +1211,10 @@ suite('Connection Controller Test Suite', function () {
12111211

12121212
test('_getConnectionStringWithProxy returns string with proxy options', () => {
12131213
const expectedConnectionStringWithProxy =
1214-
'mongodb://localhost:27018/?appname=mongodb-vscode+0.0.0-dev.0&proxyHost=localhost&proxyPassword=gwce7tr8733ujbr&proxyPort=3378&proxyUsername=test';
1214+
'mongodb://localhost:27088/?appname=mongodb-vscode+0.0.0-dev.0&proxyHost=localhost&proxyPassword=gwce7tr8733ujbr&proxyPort=3378&proxyUsername=test';
12151215
const connectionString =
12161216
testConnectionController._getConnectionStringWithProxy({
1217-
url: 'mongodb://localhost:27018/?appname=mongodb-vscode+0.0.0-dev.0',
1217+
url: 'mongodb://localhost:27088/?appname=mongodb-vscode+0.0.0-dev.0',
12181218
options: {
12191219
proxyHost: 'localhost',
12201220
proxyPassword: 'gwce7tr8733ujbr',
@@ -1671,11 +1671,11 @@ suite('Connection Controller Test Suite', function () {
16711671
},
16721672
'random-connection-3': {
16731673
id: 'random-connection-3',
1674-
name: 'localhost:27018',
1674+
name: 'localhost:27088',
16751675
storageLocation: 'GLOBAL',
16761676
connectionOptions: {
16771677
connectionString:
1678-
'mongodb://localhost:27018/?readPreference=primary&ssl=false',
1678+
'mongodb://localhost:27088/?readPreference=primary&ssl=false',
16791679
},
16801680
},
16811681
} as any;
@@ -1737,12 +1737,12 @@ suite('Connection Controller Test Suite', function () {
17371737
},
17381738
'random-connection-2': {
17391739
id: 'random-connection-2',
1740-
name: 'localhost:27018',
1740+
name: 'localhost:27088',
17411741
storageLocation: 'GLOBAL',
17421742
secretStorageLocation: SecretStorageLocation.KeytarSecondAttempt,
17431743
connectionOptions: {
17441744
connectionString:
1745-
'mongodb://localhost:27018/?readPreference=primary&ssl=false',
1745+
'mongodb://localhost:27088/?readPreference=primary&ssl=false',
17461746
},
17471747
},
17481748
} as any;
@@ -1794,32 +1794,32 @@ suite('Connection Controller Test Suite', function () {
17941794
},
17951795
'random-connection-2': {
17961796
id: 'random-connection-2',
1797-
name: 'localhost:27018',
1797+
name: 'localhost:27088',
17981798
storageLocation: 'GLOBAL',
17991799
secretStorageLocation: SecretStorageLocation.SecretStorage,
18001800
connectionOptions: {
18011801
connectionString:
1802-
'mongodb://localhost:27018/?readPreference=primary&ssl=false',
1802+
'mongodb://localhost:27088/?readPreference=primary&ssl=false',
18031803
},
18041804
},
18051805
'random-connection-3': {
18061806
id: 'random-connection-3',
1807-
name: 'localhost:27018',
1807+
name: 'localhost:27088',
18081808
storageLocation: 'GLOBAL',
18091809
secretStorageLocation: SecretStorageLocation.Keytar,
18101810
connectionOptions: {
18111811
connectionString:
1812-
'mongodb://localhost:27018/?readPreference=primary&ssl=false',
1812+
'mongodb://localhost:27088/?readPreference=primary&ssl=false',
18131813
},
18141814
},
18151815
'random-connection-4': {
18161816
id: 'random-connection-4',
1817-
name: 'localhost:27018',
1817+
name: 'localhost:27088',
18181818
storageLocation: 'GLOBAL',
18191819
secretStorageLocation: SecretStorageLocation.KeytarSecondAttempt,
18201820
connectionOptions: {
18211821
connectionString:
1822-
'mongodb://localhost:27018/?readPreference=primary&ssl=false',
1822+
'mongodb://localhost:27088/?readPreference=primary&ssl=false',
18231823
},
18241824
},
18251825
} as any;

src/test/suite/dbTestHelper.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import type { Document } from 'bson';
55
export const TEST_USER_USERNAME = 'testUser';
66
export const TEST_USER_PASSWORD = 'password';
77

8-
export const TEST_DATABASE_URI = 'mongodb://localhost:27018';
9-
export const TEST_DATABASE_URI_USER = `mongodb://${TEST_USER_USERNAME}:${TEST_USER_PASSWORD}@localhost:27018`;
8+
export const TEST_DATABASE_URI = 'mongodb://localhost:27088';
9+
export const TEST_DATABASE_URI_USER = `mongodb://${TEST_USER_USERNAME}:${TEST_USER_PASSWORD}@localhost:27088`;
1010

1111
export const TEST_DB_NAME = 'vscodeTestDatabaseAA';
1212

src/test/suite/editors/playgroundSelectedCodeActionProvider.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ suite('Playground Selected CodeAction Provider Test Suite', function () {
386386
namespace: 'db.coll',
387387
type: null,
388388
content:
389-
"# Requires the PyMongo package.\n# https://api.mongodb.com/python/current\n\nclient = MongoClient('mongodb://localhost:27018/?appname=mongodb-vscode+0.0.0-dev.0')\nfilter={\n 'name': '22'\n}\n\nresult = client['db']['coll'].find(\n filter=filter\n)",
389+
"# Requires the PyMongo package.\n# https://api.mongodb.com/python/current\n\nclient = MongoClient('mongodb://localhost:27088/?appname=mongodb-vscode+0.0.0-dev.0')\nfilter={\n 'name': '22'\n}\n\nresult = client['db']['coll'].find(\n filter=filter\n)",
390390
language: 'python',
391391
};
392392

@@ -461,7 +461,7 @@ suite('Playground Selected CodeAction Provider Test Suite', function () {
461461
namespace: 'db.coll',
462462
type: null,
463463
content:
464-
"# Requires the MongoDB Ruby Driver\n# https://docs.mongodb.com/ruby-driver/master/\n\nclient = Mongo::Client.new('mongodb://localhost:27018/?appname=mongodb-vscode+0.0.0-dev.0', :database => 'db')\n\nresult = client.database['coll'].find({\n 'name' => '22'\n})",
464+
"# Requires the MongoDB Ruby Driver\n# https://docs.mongodb.com/ruby-driver/master/\n\nclient = Mongo::Client.new('mongodb://localhost:27088/?appname=mongodb-vscode+0.0.0-dev.0', :database => 'db')\n\nresult = client.database['coll'].find({\n 'name' => '22'\n})",
465465
language: 'ruby',
466466
};
467467

@@ -536,7 +536,7 @@ suite('Playground Selected CodeAction Provider Test Suite', function () {
536536
namespace: 'db.coll',
537537
type: null,
538538
content:
539-
'// Requires the MongoDB Go Driver\n// https://go.mongodb.org/mongo-driver\nctx := context.TODO()\n\n// Set client options\nclientOptions := options.Client().ApplyURI("mongodb://localhost:27018/?appname=mongodb-vscode+0.0.0-dev.0")\n\n// Connect to MongoDB\nclient, err := mongo.Connect(ctx, clientOptions)\nif err != nil {\n log.Fatal(err)\n}\ndefer func() {\n if err := client.Disconnect(ctx); err != nil {\n log.Fatal(err)\n }\n}()\n\n// Find data\ncoll := client.Database("db").Collection("coll")\n_, err = coll.Find(ctx, bson.D{{"name", "22"}})\nif err != nil {\n log.Fatal(err)\n}',
539+
'// Requires the MongoDB Go Driver\n// https://go.mongodb.org/mongo-driver\nctx := context.TODO()\n\n// Set client options\nclientOptions := options.Client().ApplyURI("mongodb://localhost:27088/?appname=mongodb-vscode+0.0.0-dev.0")\n\n// Connect to MongoDB\nclient, err := mongo.Connect(ctx, clientOptions)\nif err != nil {\n log.Fatal(err)\n}\ndefer func() {\n if err := client.Disconnect(ctx); err != nil {\n log.Fatal(err)\n }\n}()\n\n// Find data\ncoll := client.Database("db").Collection("coll")\n_, err = coll.Find(ctx, bson.D{{"name", "22"}})\nif err != nil {\n log.Fatal(err)\n}',
540540
language: 'go',
541541
};
542542

src/test/suite/explorer/explorerController.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ suite('Explorer Controller Test Suite', function () {
118118
`Expected there be 1 connection tree item, found ${connectionsItems.length}`
119119
);
120120
assert(
121-
connectionsItems[0].label === 'localhost:27018',
122-
'There should be a connection tree item with the label "localhost:27018"'
121+
connectionsItems[0].label === 'localhost:27088',
122+
'There should be a connection tree item with the label "localhost:27088"'
123123
);
124124
assert(
125125
connectionsItems[0].description === 'connected',
@@ -153,8 +153,8 @@ suite('Explorer Controller Test Suite', function () {
153153
testConnectionController._connections[connectionId].name;
154154

155155
assert(
156-
connectionName === 'localhost:27018',
157-
`Expected active connection name to be 'localhost:27018' found ${connectionName}`
156+
connectionName === 'localhost:27088',
157+
`Expected active connection name to be 'localhost:27088' found ${connectionName}`
158158
);
159159

160160
try {
@@ -172,8 +172,8 @@ suite('Explorer Controller Test Suite', function () {
172172
`Expected there be 2 connection tree item, found ${connectionsItems.length}`
173173
);
174174
assert(
175-
connectionsItems[0].label === 'localhost:27018',
176-
`First connection tree item should have label "localhost:27018" found ${connectionsItems[0].label}`
175+
connectionsItems[0].label === 'localhost:27088',
176+
`First connection tree item should have label "localhost:27088" found ${connectionsItems[0].label}`
177177
);
178178
assert(
179179
connectionsItems[0].isExpanded === false,

src/test/suite/language/mongoDBService.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const INCREASED_TEST_TIMEOUT = 5000;
2929
suite('MongoDBService Test Suite', () => {
3030
const params = {
3131
connectionId: 'pineapple',
32-
connectionString: 'mongodb://localhost:27018',
32+
connectionString: 'mongodb://localhost:27088',
3333
connectionOptions: {
3434
readPreference: READ_PREFERENCES.PRIMARY,
3535
productDocsLink: LINKS.extensionDocs(),
@@ -102,7 +102,7 @@ suite('MongoDBService Test Suite', () => {
102102
await testMongoDBService.activeConnectionChanged(params);
103103

104104
expect(testMongoDBService.connectionString).to.be.equal(
105-
'mongodb://localhost:27018'
105+
'mongodb://localhost:27088'
106106
);
107107

108108
await testMongoDBService.activeConnectionChanged({ connectionId: null });

src/test/suite/mdbExtensionController.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import {
2828
import { VIEW_COLLECTION_SCHEME } from '../../editors/collectionDocumentsProvider';
2929
import type { CollectionDetailsType } from '../../explorer/collectionTreeItem';
3030

31-
const testDatabaseURI = 'mongodb://localhost:27018';
31+
const testDatabaseURI = 'mongodb://localhost:27088';
3232

3333
function getTestConnectionTreeItem(
3434
options?: Partial<ConstructorParameters<typeof ConnectionTreeItem>[0]>

src/test/suite/playground.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {
1616
const expect = chai.expect;
1717
chai.use(chaiAsPromised);
1818

19-
const TEST_DATABASE_URI = 'mongodb://localhost:27018';
19+
const TEST_DATABASE_URI = 'mongodb://localhost:27088';
2020

2121
suite('Playground', function () {
2222
this.timeout(8000);
@@ -56,7 +56,7 @@ suite('Playground', function () {
5656
sandbox.replace(
5757
mdbTestExtension.testExtensionController._connectionController,
5858
'getActiveConnectionName',
59-
sandbox.fake.returns('localhost:27018')
59+
sandbox.fake.returns('localhost:27088')
6060
);
6161
sandbox.replace(
6262
mdbTestExtension.testExtensionController._connectionController,

src/test/suite/storage/storageController.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ suite('Storage Controller Test Suite', () => {
103103
id: 'conn2',
104104
name: 'saved2',
105105
storageLocation: StorageLocation.WORKSPACE,
106-
connectionOptions: { connectionString: 'mongodb://localhost:27018' },
106+
connectionOptions: { connectionString: 'mongodb://localhost:27088' },
107107
});
108108

109109
const updatedWorkspaceModels = testStorageController.get(

0 commit comments

Comments
 (0)