Skip to content

Commit 885dafd

Browse files
authored
feat: release multiple connections COMPASS-7905 (#6138)
* invert multiple vs single connections * testing single connection not possible right now * unfocus * port some connection form tests, skip some others for now * skip legacy connections tests * skip more single connection usage * skip some tests in the sidebar * skip more * skip a test in compass-shell * move enableNewMultipleConnectionSystem from a feature flag to a preference so it can be set to false in compass-web * TODO ticket numbers
1 parent 7c34845 commit 885dafd

File tree

16 files changed

+55
-158
lines changed

16 files changed

+55
-158
lines changed

.evergreen/buildvariants-and-tasks.in.yml

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -246,14 +246,6 @@ buildvariants:
246246
- name: e2e-coverage-<%= group.number %>
247247
<% } %>
248248

249-
- name: e2e-multiple-connections
250-
display_name: E2E Multiple Connections
251-
run_on: ubuntu2004-large
252-
tasks:
253-
<% for(const group of E2E_TEST_GROUPS) { %>
254-
- name: e2e-multiple-connections-<%= group.number %>
255-
<% } %>
256-
257249
- name: csfle-tests
258250
display_name: CSFLE Tests
259251
run_on: ubuntu2004-large
@@ -340,21 +332,6 @@ tasks:
340332
debug: 'compass-e2e-tests*,electron*,hadron*,mongo*'
341333
<% } %>
342334

343-
<% for(const group of E2E_TEST_GROUPS) { %>
344-
- name: e2e-multiple-connections-<%= group.number %>
345-
tags: ['required-for-publish', 'run-on-pr']
346-
commands:
347-
- func: prepare
348-
- func: install
349-
- func: bootstrap
350-
- func: test-multiple-connections
351-
vars:
352-
e2e_test_groups: <%= E2E_TEST_GROUPS.length %>
353-
e2e_test_group: <%= group.number %>
354-
debug: 'compass-e2e-tests*,electron*,hadron*,mongo*'
355-
mongodb_version: latest-enterprise
356-
<% } %>
357-
358335
- name: generate-vulnerability-report
359336
tags: ['required-for-publish', 'run-on-pr']
360337
commands:

.evergreen/buildvariants-and-tasks.yml

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -220,13 +220,6 @@ buildvariants:
220220
- name: e2e-coverage-1
221221
- name: e2e-coverage-2
222222
- name: e2e-coverage-3
223-
- name: e2e-multiple-connections
224-
display_name: E2E Multiple Connections
225-
run_on: ubuntu2004-large
226-
tasks:
227-
- name: e2e-multiple-connections-1
228-
- name: e2e-multiple-connections-2
229-
- name: e2e-multiple-connections-3
230223
- name: csfle-tests
231224
display_name: CSFLE Tests
232225
run_on: ubuntu2004-large
@@ -338,48 +331,6 @@ tasks:
338331
e2e_test_groups: 3
339332
e2e_test_group: 3
340333
debug: compass-e2e-tests*,electron*,hadron*,mongo*
341-
- name: e2e-multiple-connections-1
342-
tags:
343-
- required-for-publish
344-
- run-on-pr
345-
commands:
346-
- func: prepare
347-
- func: install
348-
- func: bootstrap
349-
- func: test-multiple-connections
350-
vars:
351-
e2e_test_groups: 3
352-
e2e_test_group: 1
353-
debug: compass-e2e-tests*,electron*,hadron*,mongo*
354-
mongodb_version: latest-enterprise
355-
- name: e2e-multiple-connections-2
356-
tags:
357-
- required-for-publish
358-
- run-on-pr
359-
commands:
360-
- func: prepare
361-
- func: install
362-
- func: bootstrap
363-
- func: test-multiple-connections
364-
vars:
365-
e2e_test_groups: 3
366-
e2e_test_group: 2
367-
debug: compass-e2e-tests*,electron*,hadron*,mongo*
368-
mongodb_version: latest-enterprise
369-
- name: e2e-multiple-connections-3
370-
tags:
371-
- required-for-publish
372-
- run-on-pr
373-
commands:
374-
- func: prepare
375-
- func: install
376-
- func: bootstrap
377-
- func: test-multiple-connections
378-
vars:
379-
e2e_test_groups: 3
380-
e2e_test_group: 3
381-
debug: compass-e2e-tests*,electron*,hadron*,mongo*
382-
mongodb_version: latest-enterprise
383334
- name: generate-vulnerability-report
384335
tags:
385336
- required-for-publish

.evergreen/functions.yml

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -602,30 +602,6 @@ functions:
602602
603603
tar czf coverage.tgz packages/compass-e2e-tests/coverage
604604
605-
test-multiple-connections:
606-
- command: shell.exec
607-
# Fail the task if it's idle for 10 mins
608-
timeout_secs: 600
609-
params:
610-
working_dir: src
611-
shell: bash
612-
env:
613-
<<: *compass-env
614-
DEBUG: ${debug|}
615-
MONGODB_VERSION: ${mongodb_version|}
616-
MONGODB_RUNNER_VERSION: ${mongodb_version|}
617-
E2E_TEST_GROUPS: ${e2e_test_groups}
618-
E2E_TEST_GROUP: ${e2e_test_group}
619-
HADRON_DISTRIBUTION: compass
620-
script: |
621-
set -e
622-
# Load environment variables
623-
eval $(.evergreen/print-compass-env.sh)
624-
625-
echo "Running E2E tests for multiple connections"
626-
627-
npm run --unsafe-perm --workspace compass-e2e-tests test-ci -- -- --test-multiple-connections
628-
629605
test-packaged-app:
630606
- command: shell.exec
631607
# Fail the task if it's idle for 10 mins

packages/compass-connections-navigation/src/sc-connections-navigation-tree.spec.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ function renderComponent(
9393
);
9494
}
9595

96-
describe('ConnectionsNavigationTree -- Single connection usage', function () {
96+
// TODO(COMPASS-7906): remove
97+
describe.skip('ConnectionsNavigationTree -- Single connection usage', function () {
9798
let preferences: PreferencesAccess;
9899
afterEach(cleanup);
99100

packages/compass-connections/src/components/legacy-connections.spec.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ async function loadSavedConnectionAndConnect(connectionInfo: ConnectionInfo) {
4242

4343
// Wait for the connection to load in the form.
4444
await waitFor(() =>
45-
expect(screen.queryByRole('textbox')?.textContent).to.equal(
45+
expect(screen.queryByTestId('connectionString')?.textContent).to.equal(
4646
connectionInfo.connectionOptions.connectionString
4747
)
4848
);
@@ -54,7 +54,8 @@ async function loadSavedConnectionAndConnect(connectionInfo: ConnectionInfo) {
5454
await waitFor(() => expect(screen.queryByText('Cancel')).to.not.exist);
5555
}
5656

57-
describe('Connections Component', function () {
57+
// TODO(COMPASS-7906): remove
58+
describe.skip('Connections Component', function () {
5859
let preferences: PreferencesAccess;
5960

6061
before(async function () {
@@ -367,7 +368,9 @@ describe('Connections Component', function () {
367368

368369
// Wait for the connection to load in the form.
369370
await waitFor(() =>
370-
expect(screen.queryByRole('textbox')?.textContent).to.equal(
371+
expect(
372+
screen.queryByTestId('connectionString')?.textContent
373+
).to.equal(
371374
'mongodb://localhost:27099/?connectTimeoutMS=5000&serverSelectionTimeoutMS=5000'
372375
)
373376
);

packages/compass-e2e-tests/helpers/compass.ts

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,8 @@ let MONGODB_USE_ENTERPRISE =
4646

4747
// should we test compass-web (true) or compass electron (false)?
4848
export const TEST_COMPASS_WEB = process.argv.includes('--test-compass-web');
49-
export const TEST_MULTIPLE_CONNECTIONS = process.argv.includes(
50-
'--test-multiple-connections'
51-
);
49+
// multiple connections is now the default when we're not testing compass-web
50+
export const TEST_MULTIPLE_CONNECTIONS = !TEST_COMPASS_WEB;
5251

5352
/*
5453
A helper so we can easily find all the tests we're skipping in compass-web.
@@ -997,20 +996,6 @@ export async function init(
997996
): Promise<Compass> {
998997
name = pathName(name ?? formattedDate());
999998

1000-
// Use the multiple connections feature flag when testing multiple connections
1001-
// so that compass starts up with it already enabled. But be careful not to
1002-
// override the env var because there are tests that set it.
1003-
if (
1004-
TEST_MULTIPLE_CONNECTIONS &&
1005-
!process.env.COMPASS_GLOBAL_CONFIG_FILE_FOR_TESTING
1006-
) {
1007-
process.env.COMPASS_GLOBAL_CONFIG_FILE_FOR_TESTING = path.join(
1008-
__dirname,
1009-
'..',
1010-
'multiple-connections.yaml'
1011-
);
1012-
}
1013-
1014999
// Unfortunately mocha's type is that this.test inside a test or hook is
10151000
// optional even though it always exists. So we have a lot of
10161001
// this.test?.fullTitle() and therefore we hopefully won't end up with a lot

packages/compass-e2e-tests/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ const debug = Debug('compass-e2e-tests');
2525

2626
const allowedArgs = [
2727
'--test-compass-web',
28-
'--test-multiple-connections',
2928
'--no-compile',
3029
'--no-native-modules',
3130
'--test-packaged-app',

packages/compass-preferences-model/src/feature-flags.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ export type FeatureFlags = {
1818
newExplainPlan: boolean;
1919
showInsights: boolean;
2020
enableRenameCollectionModal: boolean;
21-
enableNewMultipleConnectionSystem: boolean;
2221
enableQueryHistoryAutocomplete: boolean;
2322
enableProxySupport: boolean;
2423
};
@@ -64,18 +63,6 @@ export const featureFlags: Required<{
6463
},
6564
},
6665

67-
/**
68-
* Feature flag for the new multiple connection UI.
69-
* Epic: COMPASS-6410
70-
*/
71-
enableNewMultipleConnectionSystem: {
72-
stage: 'development',
73-
description: {
74-
short: 'Enables support for multiple connections.',
75-
long: 'Allows users to open multiple connections in the same window.',
76-
},
77-
},
78-
7966
/**
8067
* Feature flag for adding query history items to the query bar autocompletion. COMPASS-8096
8168
*/

packages/compass-preferences-model/src/preferences-schema.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ export type UserConfigurablePreferences = PermanentFeatureFlags &
6767
enablePerformanceAdvisorBanner: boolean;
6868
maximumNumberOfActiveConnections?: number;
6969
enableShowDialogOnQuit: boolean;
70+
enableNewMultipleConnectionSystem: boolean;
7071
enableProxySupport: boolean;
7172
proxy: string;
7273
};
@@ -213,7 +214,7 @@ const featureFlagsProps: Required<{
213214
}> = Object.fromEntries(
214215
Object.entries(featureFlags).map(([key, value]) => [
215216
key as keyof FeatureFlags,
216-
featureFlagToPreferenceDefinition(value),
217+
featureFlagToPreferenceDefinition(key, value),
217218
])
218219
) as unknown as Required<{
219220
[K in keyof FeatureFlags]: PreferenceDefinition<K>;
@@ -780,6 +781,18 @@ export const storedUserPreferencesProps: Required<{
780781
type: 'boolean',
781782
},
782783

784+
enableNewMultipleConnectionSystem: {
785+
ui: true,
786+
cli: true,
787+
global: true,
788+
description: {
789+
short: 'Enables support for multiple connections.',
790+
long: 'Allows users to open multiple connections in the same window.',
791+
},
792+
validator: z.boolean().default(true),
793+
type: 'boolean',
794+
},
795+
783796
proxy: {
784797
ui: true,
785798
cli: true,
@@ -1026,6 +1039,7 @@ function deriveReadOnlyOptionState<K extends keyof AllPreferences>(
10261039

10271040
// Helper to convert feature flag definitions to preference definitions
10281041
function featureFlagToPreferenceDefinition(
1042+
key: string,
10291043
featureFlag: FeatureFlagDefinition
10301044
): PreferenceDefinition<keyof FeatureFlags> {
10311045
return {

packages/compass-shell/src/plugin.spec.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ describe('CompassShellPlugin', function () {
6363
wrapper = null;
6464
});
6565

66-
it('returns a renderable plugin', async function () {
66+
// TODO(COMPASS-7906): remove
67+
it.skip('returns a renderable plugin', async function () {
6768
connectionsManager['connectionStatuses'].set('1', 'connected');
6869
wrapper = mount(
6970
<AppRegistryProvider>

0 commit comments

Comments
 (0)