Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…PASS-8276-no-shard-key
  • Loading branch information
mabaasit committed Sep 26, 2024
2 parents f644bd7 + df47e20 commit 4f0ce46
Show file tree
Hide file tree
Showing 21 changed files with 312 additions and 465 deletions.
6 changes: 3 additions & 3 deletions .evergreen/buildvariants-and-tasks.in.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ const MAINTAINED_SERVER_VERSIONS = [
{ name: '60x-enterprise', version: '6.0.x-enterprise' },
{ name: '70x-community', version: '7.0.x' },
{ name: '70x-enterprise', version: '7.0.x-enterprise' },
{ name: '80x-community', version: '8.0.0-rc18' },
{ name: '80x-enterprise', version: '8.0.0-rc18-enterprise' },
{ name: '80x-community', version: '8.0.x' },
{ name: '80x-enterprise', version: '8.0.x-enterprise' },
];
const TEST_LATEST_ALPHA_SERVER_VERSION = { name: 'latest-alpha', version: 'latest-alpha-enterprise' };
Expand Down Expand Up @@ -281,7 +281,7 @@ tasks:
- func: check

- name: test
tags:
tags:
- required-for-publish
- run-on-pr
- assigned_to_jira_team_compass_compass
Expand Down
12 changes: 6 additions & 6 deletions .evergreen/buildvariants-and-tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1291,7 +1291,7 @@ tasks:
compass_distribution: compass
- func: test-packaged-app
vars:
mongodb_version: 8.0.0-rc18
mongodb_version: 8.0.x
compass_distribution: compass
e2e_test_groups: 3
e2e_test_group: 1
Expand All @@ -1314,7 +1314,7 @@ tasks:
compass_distribution: compass
- func: test-packaged-app
vars:
mongodb_version: 8.0.0-rc18
mongodb_version: 8.0.x
compass_distribution: compass
e2e_test_groups: 3
e2e_test_group: 2
Expand All @@ -1337,7 +1337,7 @@ tasks:
compass_distribution: compass
- func: test-packaged-app
vars:
mongodb_version: 8.0.0-rc18
mongodb_version: 8.0.x
compass_distribution: compass
e2e_test_groups: 3
e2e_test_group: 3
Expand All @@ -1360,7 +1360,7 @@ tasks:
compass_distribution: compass
- func: test-packaged-app
vars:
mongodb_version: 8.0.0-rc18-enterprise
mongodb_version: 8.0.x-enterprise
compass_distribution: compass
e2e_test_groups: 3
e2e_test_group: 1
Expand All @@ -1383,7 +1383,7 @@ tasks:
compass_distribution: compass
- func: test-packaged-app
vars:
mongodb_version: 8.0.0-rc18-enterprise
mongodb_version: 8.0.x-enterprise
compass_distribution: compass
e2e_test_groups: 3
e2e_test_group: 2
Expand All @@ -1406,7 +1406,7 @@ tasks:
compass_distribution: compass
- func: test-packaged-app
vars:
mongodb_version: 8.0.0-rc18-enterprise
mongodb_version: 8.0.x-enterprise
compass_distribution: compass
e2e_test_groups: 3
e2e_test_group: 3
Expand Down
2 changes: 1 addition & 1 deletion .evergreen/functions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ functions:
eval $(.evergreen/print-compass-env.sh)
rm -rf mongodb-crypt && mkdir -p mongodb-crypt
(cd mongodb-crypt && \
curl -sSfL $(npx -y mongodb-download-url --enterprise --crypt_shared --version '>= 8.0.0-rc18') | \
curl -sSfL $(npx -y mongodb-download-url --enterprise --crypt_shared --version continuous) | \
tar -xvz)
export COMPASS_CRYPT_LIBRARY_PATH=$(echo $PWD/mongodb-crypt/lib/mongo_*_v1.*)
npm run test-csfle --workspace mongodb-data-service
Expand Down
2 changes: 1 addition & 1 deletion THIRD-PARTY-NOTICES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
The following third-party software is used by and included in **Mongodb Compass**.
This document was automatically generated on Wed Sep 25 2024.
This document was automatically generated on Thu Sep 26 2024.

## List of dependencies

Expand Down
6 changes: 4 additions & 2 deletions docs/tracking-plan.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

# Compass Tracking Plan

Generated on Wed, Sep 25, 2024 at 11:30 AM
Generated on Thu, Sep 26, 2024 at 11:31 AM

## Table of Contents

Expand Down Expand Up @@ -299,6 +299,8 @@ This event is fired when user runs the aggregation.
the even has been fired.
- **editor_view_type** (required): `"stage" | "text" | "focus"`
- The type of editor view from which the aggregation has been executed.
- **stage_operators** (required): `{}`
- The names of the stages in the pipeline being executed.
- **connection_id** (optional): `string | undefined`
- The id of the connection associated to this event.

Expand Down Expand Up @@ -1642,7 +1644,7 @@ This event is fired when a user activates (i.e., navigates to) a screen.

**Properties**:

- **name** (optional): `"my_queries" | "aggregations" | "documents" | "collections" | "databases" | "indexes" | "performance" | "schema" | "validation" | "confirm_new_pipeline_modal" | "create_collection_modal" | "create_database_modal" | "drop_collection_modal" | "drop_database_modal" | "create_index_modal" | "create_search_index_modal" | "create_view_modal" | "csfle_connection_modal" | "delete_pipeline_modal" | "drop_index_modal" | "export_modal" | "export_to_language_modal" | "import_modal" | "insert_document_modal" | "non_genuine_mongodb_modal" | "rename_collection_modal" | "restore_pipeline_modal" | "save_pipeline_modal" | "shell_info_modal" | "update_search_index_modal" | undefined`
- **name** (optional): `"my_queries" | "aggregations" | "documents" | "collections" | "databases" | "indexes" | "globalwrites" | "performance" | "schema" | "validation" | "confirm_new_pipeline_modal" | "create_collection_modal" | "create_database_modal" | "drop_collection_modal" | "drop_database_modal" | "create_index_modal" | "create_search_index_modal" | "create_view_modal" | "csfle_connection_modal" | "delete_pipeline_modal" | "drop_index_modal" | "export_modal" | "export_to_language_modal" | "import_modal" | "insert_document_modal" | "non_genuine_mongodb_modal" | "rename_collection_modal" | "restore_pipeline_modal" | "save_pipeline_modal" | "shell_info_modal" | "update_search_index_modal" | undefined`
- The name of the screen that was activated.
- **connection_id** (optional): `string | undefined`
- The id of the connection associated to this event.
Expand Down
8 changes: 6 additions & 2 deletions packages/atlas-service/src/atlas-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,11 @@ export class AtlasService {
automationAgentFetch<OpType extends keyof AutomationAgentRequestTypes>(
atlasMetadata: Pick<
AtlasClusterMetadata,
'projectId' | 'clusterUniqueId' | 'regionalBaseUrl' | 'metricsType'
| 'projectId'
| 'clusterUniqueId'
| 'regionalBaseUrl'
| 'metricsType'
| 'metricsId'
>,
opType: OpType,
opBody: Omit<
Expand All @@ -118,7 +122,7 @@ export class AtlasService {
const opBodyClusterId =
atlasMetadata.metricsType === 'serverless'
? { serverlessId: atlasMetadata.clusterUniqueId }
: { clusterId: atlasMetadata.clusterUniqueId };
: { clusterId: atlasMetadata.metricsId };
return makeAutomationAgentOpRequest(
this.authenticatedFetch.bind(this),
this.regionalizedCloudEndpoint(atlasMetadata),
Expand Down
1 change: 1 addition & 0 deletions packages/compass-aggregations/src/modules/aggregation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ export const runAggregation = (): PipelineBuilderThunkAction<Promise<void>> => {
() => ({
num_stages: pipeline.length,
editor_view_type: mapPipelineModeToEditorViewType(getState()),
stage_operators: pipeline.map((stage) => getStageOperator(stage)),
}),
connectionInfoRef.current
);
Expand Down
6 changes: 6 additions & 0 deletions packages/compass-e2e-tests/helpers/commands/create-index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,5 +108,11 @@ export async function createIndex(
const indexComponent = await browser.$(indexComponentSelector);
await indexComponent.waitForDisplayed();

// Wait for index to get ready before proceeding
await browser
.$(indexComponentSelector)
.$(Selectors.IndexPropertyInProgress)
.waitForDisplayed({ reverse: true });

return indexName;
}
1 change: 1 addition & 0 deletions packages/compass-e2e-tests/helpers/selectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1088,6 +1088,7 @@ export const indexComponent = (name: string): string => {
};
export const IndexFieldName = '[data-testid="indexes-name-field"]';
export const IndexFieldType = '[data-testid="indexes-type-field"]';
export const IndexPropertyInProgress = '[data-testid="index-in-progress"]';
export const IndexToggleOptions =
'[data-testid="create-index-modal-toggle-options"]';
export const indexToggleOption = (fieldName: string) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,12 @@ import sinon from 'sinon';
import {
render,
screen,
cleanup,
fireEvent,
userEvent,
within,
} from '@mongodb-js/testing-library-compass';

import CreateIndexActions from '../create-index-actions';

const noop = () => {};

describe('CreateIndexActions Component', function () {
let clearErrorSpy;
let onCreateIndexClickSpy;
Expand All @@ -29,16 +26,13 @@ describe('CreateIndexActions Component', function () {
clearErrorSpy = null;
onCreateIndexClickSpy = null;
closeCreateIndexModalSpy = null;

cleanup();
});

it('renders a cancel button', function () {
render(
<CreateIndexActions
error={null}
onErrorBannerCloseClick={clearErrorSpy}
inProgress={false}
onCreateIndexClick={onCreateIndexClickSpy}
onCancelCreateIndexClick={closeCreateIndexModalSpy}
/>
Expand All @@ -54,14 +48,13 @@ describe('CreateIndexActions Component', function () {
<CreateIndexActions
error={null}
onErrorBannerCloseClick={clearErrorSpy}
inProgress={false}
onCreateIndexClick={onCreateIndexClickSpy}
onCancelCreateIndexClick={closeCreateIndexModalSpy}
/>
);

const button = screen.getByTestId('create-index-actions-cancel-button');
fireEvent.click(button);
userEvent.click(button);
expect(closeCreateIndexModalSpy).to.have.been.calledOnce;
});
});
Expand All @@ -72,7 +65,6 @@ describe('CreateIndexActions Component', function () {
<CreateIndexActions
error={null}
onErrorBannerCloseClick={clearErrorSpy}
inProgress={false}
onCreateIndexClick={onCreateIndexClickSpy}
onCancelCreateIndexClick={closeCreateIndexModalSpy}
/>
Expand All @@ -81,7 +73,7 @@ describe('CreateIndexActions Component', function () {
const button = screen.getByTestId(
'create-index-actions-create-index-button'
);
fireEvent.click(button);
userEvent.click(button);
expect(onCreateIndexClickSpy).to.have.been.calledOnce;
});
});
Expand All @@ -91,7 +83,6 @@ describe('CreateIndexActions Component', function () {
<CreateIndexActions
error={null}
onErrorBannerCloseClick={clearErrorSpy}
inProgress={false}
onCreateIndexClick={onCreateIndexClickSpy}
onCancelCreateIndexClick={closeCreateIndexModalSpy}
/>
Expand All @@ -109,7 +100,6 @@ describe('CreateIndexActions Component', function () {
<CreateIndexActions
error={'Some error happened!'}
onErrorBannerCloseClick={clearErrorSpy}
inProgress={false}
onCreateIndexClick={onCreateIndexClickSpy}
onCancelCreateIndexClick={closeCreateIndexModalSpy}
/>
Expand All @@ -126,7 +116,6 @@ describe('CreateIndexActions Component', function () {
<CreateIndexActions
error={'Some error happened!'}
onErrorBannerCloseClick={clearErrorSpy}
inProgress={false}
onCreateIndexClick={onCreateIndexClickSpy}
onCancelCreateIndexClick={closeCreateIndexModalSpy}
/>
Expand All @@ -137,25 +126,9 @@ describe('CreateIndexActions Component', function () {
);
const closeIcon = within(errorBanner).getByLabelText('X Icon');

fireEvent.click(closeIcon);
userEvent.click(closeIcon);
expect(clearErrorSpy).to.have.been.calledOnce;
});

it('does not render in progress banner', function () {
render(
<CreateIndexActions
error={'Some error happened!'}
onErrorBannerCloseClick={clearErrorSpy}
inProgress={true}
onCreateIndexClick={onCreateIndexClickSpy}
/>
);

const inProgressBanner = screen.queryByTestId(
'create-index-actions-in-progress-banner-wrapper'
);
expect(inProgressBanner).to.not.exist;
});
});

context('without error', function () {
Expand All @@ -164,7 +137,6 @@ describe('CreateIndexActions Component', function () {
<CreateIndexActions
error={null}
onErrorBannerCloseClick={clearErrorSpy}
inProgress={false}
onCreateIndexClick={onCreateIndexClickSpy}
onCancelCreateIndexClick={closeCreateIndexModalSpy}
/>
Expand All @@ -175,42 +147,5 @@ describe('CreateIndexActions Component', function () {
);
expect(errorBanner).to.not.exist;
});

context('when in progress', function () {
beforeEach(function () {
render(
<CreateIndexActions
error={null}
onErrorBannerCloseClick={noop}
inProgress={true}
onCreateIndexClick={noop}
onCancelCreateIndexClick={noop}
/>
);
});

afterEach(cleanup);

it('renders in progress banner', function () {
const inProgressBanner = screen.getByTestId(
'create-index-actions-in-progress-banner-wrapper'
);
expect(inProgressBanner).to.contain.text('Index creation in progress');
});

it('hides the create index button', function () {
const onCreateIndexClickButton = screen.queryByTestId(
'create-index-actions-create-index-button'
);
expect(onCreateIndexClickButton).to.not.exist;
});

it('renames the cancel button to close', function () {
const cancelButton = screen.getByTestId(
'create-index-actions-cancel-button'
);
expect(cancelButton.textContent).to.be.equal('Close');
});
});
});
});
Loading

0 comments on commit 4f0ce46

Please sign in to comment.