Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Everest 953 backups and pitr dbwizard combining #293

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
f5fa137
EVEREST-953-backups-and-PITR-dbwizard-combining: BackupsActionableAlert
solovevayaroslavna May 8, 2024
a2c9886
EVEREST-953-backups-and-PITR-dbwizard-combining: fix margins
solovevayaroslavna May 8, 2024
6679382
EVEREST-953-backups-and-PITR-dbwizard-combining: preview
solovevayaroslavna May 8, 2024
211eeae
EVEREST-953-backups-and-PITR-dbwizard-combining
solovevayaroslavna May 8, 2024
8ff69f9
Merge branch 'refs/heads/main' into EVEREST-953-backups-and-PITR-dbwi…
solovevayaroslavna May 8, 2024
42f7902
Merge branch 'refs/heads/main' into EVEREST-953-backups-and-PITR-dbwi…
solovevayaroslavna May 8, 2024
a94b725
EVEREST-953-backups-and-PITR-dbwizard-combining: fix small errors + t…
solovevayaroslavna May 13, 2024
3eaf0ee
EVEREST-953-backups-and-PITR-dbwizard-combining: tests fix
solovevayaroslavna May 13, 2024
9fbea4a
Merge branch 'main' into EVEREST-953-backups-and-PITR-dbwizard-combining
solovevayaroslavna May 13, 2024
5bea004
EVEREST-953-backups-and-PITR-dbwizard-combining: unit tests fix
solovevayaroslavna May 13, 2024
3e86795
Merge branch 'refs/heads/main' into EVEREST-953-backups-and-PITR-dbwi…
solovevayaroslavna May 14, 2024
4350562
EVEREST-953-backups-and-PITR-dbwizard-combining: tests fix typo
solovevayaroslavna May 14, 2024
7e95419
Merge branch 'main' into EVEREST-953-backups-and-PITR-dbwizard-combining
solovevayaroslavna May 15, 2024
967f841
Merge branch 'main' into EVEREST-953-backups-and-PITR-dbwizard-combining
solovevayaroslavna May 16, 2024
3dbe662
fix: e2e tentative (#299)
fabio-silva May 16, 2024
19db3ad
[UI] EVEREST-1005-Expand-divider-in-tabs-component changing the width…
X6uddy May 16, 2024
d8615e8
Merge branch 'refs/heads/main' into EVEREST-953-backups-and-PITR-dbwi…
solovevayaroslavna May 16, 2024
0afb790
Merge branch 'refs/heads/main' into EVEREST-953-backups-and-PITR-dbwi…
solovevayaroslavna May 16, 2024
b4239ce
Merge branch 'refs/heads/main' into EVEREST-953-backups-and-PITR-dbwi…
solovevayaroslavna May 16, 2024
2764429
Merge branch 'refs/heads/main' into EVEREST-953-backups-and-PITR-dbwi…
solovevayaroslavna May 16, 2024
dd1c26c
Merge branch 'refs/heads/main' into EVEREST-953-backups-and-PITR-dbwi…
solovevayaroslavna May 16, 2024
373a13c
Merge branch 'main' into EVEREST-953-backups-and-PITR-dbwizard-combining
solovevayaroslavna May 16, 2024
df5ae0c
EVEREST-953-backups-and-PITR-dbwizard-combining: e2e tests fix
solovevayaroslavna May 16, 2024
3b0ed14
Merge branch 'main' into EVEREST-953-backups-and-PITR-dbwizard-combining
solovevayaroslavna May 16, 2024
6394b21
Merge branch 'main' into EVEREST-953-backups-and-PITR-dbwizard-combining
solovevayaroslavna May 16, 2024
71dd08e
Merge branch 'main' into EVEREST-953-backups-and-PITR-dbwizard-combining
solovevayaroslavna May 17, 2024
2fae9d4
Merge branch 'main' into EVEREST-953-backups-and-PITR-dbwizard-combining
solovevayaroslavna May 17, 2024
f9f3069
EVEREST-953-backups-and-PITR-dbwizard-combining: fix monitoring test …
solovevayaroslavna May 21, 2024
a8f3663
Merge branch 'main' into EVEREST-953-backups-and-PITR-dbwizard-combining
solovevayaroslavna May 22, 2024
8aa4eb7
Merge branch 'main' into EVEREST-953-backups-and-PITR-dbwizard-combining
solovevayaroslavna May 22, 2024
6049cf2
EVEREST-953-backups-and-PITR-dbwizard-combining: fix initializing
solovevayaroslavna May 22, 2024
6c698e9
Merge branch 'main' into EVEREST-953-backups-and-PITR-dbwizard-combining
solovevayaroslavna May 23, 2024
5e1273d
Merge branch 'refs/heads/main' into EVEREST-953-backups-and-PITR-dbwi…
solovevayaroslavna May 27, 2024
4a064e8
EVEREST-953-backups-and-PITR-dbwizard-combining: format
solovevayaroslavna May 27, 2024
c556dc2
Merge branch 'main' into EVEREST-953-backups-and-PITR-dbwizard-combining
solovevayaroslavna May 27, 2024
56f858e
Merge branch 'main' into EVEREST-953-backups-and-PITR-dbwizard-combining
solovevayaroslavna May 27, 2024
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 @@ -24,7 +24,6 @@ import { getClusterDetailedInfo } from '../../../utils/storage-class';
import { advancedConfigurationStepCheck } from './steps/advanced-configuration-step';
import { backupsStepCheck } from './steps/backups-step';
import { basicInformationStepCheck } from './steps/basic-information-step';
import { pitrStepCheck } from './steps/pitr-step';
import { resourcesStepCheck } from './steps/resources-step';
import {
goToLastAndSubmit,
Expand All @@ -35,8 +34,8 @@ import {
submitWizard,
} from '../../../utils/db-wizard';
import { EVEREST_CI_NAMESPACES } from '../../../constants';
import { findDbAndClickActions } from '../../../utils/db-clusters-list';
import { addFirstScheduleInDBWizard } from '../db-wizard-utils';
import { findDbAndClickActions } from '../../../utils/db-clusters-list';
import { waitForInitializingState } from '../../../utils/table';

test.describe('DB Cluster creation', () => {
Expand Down Expand Up @@ -139,9 +138,6 @@ test.describe('DB Cluster creation', () => {

await moveForward(page);

await pitrStepCheck(page);
await moveForward(page);

await advancedConfigurationStepCheck(page);
await moveForward(page);

Expand Down Expand Up @@ -227,21 +223,15 @@ test.describe('DB Cluster creation', () => {
await expect(
page.getByText('You don’t have any backup schedules yet.')
).toBeVisible();
await expect(page.getByTestId('pitr-no-backup-alert')).toBeVisible();

await moveForward(page);
const enabledPitrCheckbox = page
.getByTestId('switch-input-pitr-enabled-label')
.getByRole('checkbox');
await expect(enabledPitrCheckbox).not.toBeChecked();
await expect(enabledPitrCheckbox).toBeDisabled();
await moveBack(page);
await addFirstScheduleInDBWizard(page);
await moveForward(page);
await expect(enabledPitrCheckbox).not.toBeChecked();
await expect(enabledPitrCheckbox).not.toBeDisabled();
await enabledPitrCheckbox.setChecked(true);

await expect(
page.getByTestId('text-input-pitr-storage-location')
).toBeVisible();
Expand Down Expand Up @@ -311,9 +301,6 @@ test.describe('DB Cluster creation', () => {
await resourcesStepCheck(page);
await moveForward(page);
await backupsStepCheck(page);

await moveForward(page);
await pitrStepCheck(page);
await page
.getByTestId('switch-input-pitr-enabled-label')
.getByRole('checkbox')
Expand All @@ -336,14 +323,14 @@ test.describe('DB Cluster creation', () => {
await page.goto('/databases');
await waitForInitializingState(page, clusterName);
await findDbAndClickActions(page, clusterName, 'Edit');
await goToStep(page, 'point-in-time-recovery');
await goToStep(page, 'backups');
await setPitrEnabledStatus(page, false);
await goToLastAndSubmit(page);

// We turn it back on to make sure nothing breaks
await page.goto('/databases');
await findDbAndClickActions(page, clusterName, 'Edit');
await goToStep(page, 'point-in-time-recovery');
await goToStep(page, 'backups');
await setPitrEnabledStatus(page, true);

await deleteDbClusterFn(request, clusterName, namespace);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,20 @@ export const backupsStepCheck = async (page: Page) => {
)
).toBeVisible();

const enabledPitrCheckbox = page
.getByTestId('switch-input-pitr-enabled-label')
.getByRole('checkbox');

await expect(enabledPitrCheckbox).not.toBeChecked();

await addFirstScheduleInDBWizard(page);

await expect(
page.getByText('Point-in-time Recovery', { exact: true })
).toBeVisible();
await expect(
page.getByText(
'PITR provides continuous backups of your database, enabling you to restore it to'
)
).toBeVisible();
};

This file was deleted.

10 changes: 8 additions & 2 deletions ui/apps/everest/.e2e/db-cluster/db-wizard/db-wizard-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,18 @@ export const addFirstScheduleInDBWizard = async (page: Page) => {
await openCreateScheduleDialogFromDBWizard(page);
await fillScheduleModalForm(page);
await page.getByTestId('form-dialog-create').click();

// checking created schedule in dbWiard schedules list
await expect(
page.getByTestId('editable-item').getByText('Monthly on day 10 at 5:05 PM')
).toBeVisible();
await expect(page.getByText(STORAGE_NAMES[1])).toBeVisible();

if (await checkDbTypeisVisibleInPreview(page, DbType.Mongo)) {
expect(await page.getByText(STORAGE_NAMES[1]).allInnerTexts()).toHaveLength(
2
);
} else {
await expect(page.getByText(STORAGE_NAMES[1])).toBeVisible();
}
};

export const addScheduleInDbWizard = async (page: Page) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@ import {
checkSuccessOfUpdateAndGoToDbClustersList,
} from './edit-db-cluster.utils';
import { STORAGE_NAMES } from '../../../constants';
import { addFirstScheduleInDBWizard } from '../db-wizard-utils';
import { waitForInitializingState } from '../../../utils/table';

test.describe.serial('DB Cluster Editing PITR Step', async () => {
test.describe.serial('MySQL PITR editing', async () => {
const mySQLName = 'db-pitr-mysql';

test.beforeAll(async ({ request }) => {
Expand Down Expand Up @@ -72,9 +73,8 @@ test.describe.serial('DB Cluster Editing PITR Step', async () => {
page,
}) => {
await findDbAndClickActions(page, mySQLName, 'Edit', 'UP');
await goToStep(page, 'point-in-time-recovery');
await goToStep(page, 'backups');

// Check PITR form
const pitrCheckbox = page
.getByTestId('switch-input-pitr-enabled')
.getByRole('checkbox');
Expand All @@ -98,11 +98,13 @@ test.describe.serial('DB Cluster Editing PITR Step', async () => {
await storageOptions.first().click();

// Check the preview actual value
await expect(
page
.getByTestId('section-Point-in-time Recovery')
const pitrPreviewText = (
await page
.getByTestId('section-Backups')
.getByTestId('preview-content')
).toHaveText('Enabled');
.allInnerTexts()
)[1];
expect(pitrPreviewText).toBe('PITR Enabled');

// Go to Advanced Configuration step
await moveForward(page);
Expand All @@ -114,32 +116,21 @@ test.describe.serial('DB Cluster Editing PITR Step', async () => {

await findDbAndClickActions(page, mySQLName, 'Edit');

// Go to Resources step
await moveForward(page);
// Go to Backups step
await moveForward(page);

// Go to PITR step
await moveForward(page);
// Go to PITR
await goToStep(page, 'backups');
await expect(pitrCheckbox).toBeChecked();
await expect(pitrStorageLocation).toBeVisible();
await expect(pitrStorageLocation).not.toBeEmpty();
});

test('Disable PITR for database during editing pitr step in dbWizard', async ({
test('Disable PITR for database during editing in dbWizard', async ({
page,
}) => {
await findDbAndClickActions(page, mySQLName, 'Edit');
await expect(page.getByTestId('mysql-toggle-button')).toBeVisible();

// Go to Resources step
await moveForward(page);
// Go to Backups step
await moveForward(page);
// Go to PITR step
await moveForward(page);

// Check PITR step
await goToStep(page, 'backups');
const pitrCheckbox = page
.getByTestId('switch-input-pitr-enabled')
.getByRole('checkbox');
Expand All @@ -153,16 +144,15 @@ test.describe.serial('DB Cluster Editing PITR Step', async () => {
// Disable PITR
await pitrCheckbox.setChecked(false);
// Check the preview actual value
await expect(
page
.getByTestId('section-Point-in-time Recovery')
const pitrPreviewText = (
await page
.getByTestId('section-Backups')
.getByTestId('preview-content')
).toHaveText('Disabled');
.allInnerTexts()
)[1];
expect(pitrPreviewText).toBe('PITR Disabled');

// Go to Advanced Configuration step
await moveForward(page);
// Go to Monitoring step
await moveForward(page);
await goToStep(page, 'monitoring');

await checkDbWizardEditSubmitIsAvailableAndClick(page);
await checkSuccessOfUpdateAndGoToDbClustersList(page);
Expand All @@ -174,3 +164,85 @@ test.describe.serial('DB Cluster Editing PITR Step', async () => {
);
});
});

test.describe.serial('MongoDb PITR editing', async () => {
const psmdbName = 'db-pitr-psmdb';

test.beforeAll(async ({ request }) => {
await createDbClusterFn(request, {
dbName: psmdbName,
dbType: 'mongodb',
numberOfNodes: '3',
cpu: 1,
disk: 1,
memory: 1,
});
});

test.afterAll(async ({ request }) => {
await deleteDbClusterFn(request, psmdbName);
});

test.beforeEach(async ({ page }) => {
await page.goto('/databases');
await waitForInitializingState(page, psmdbName);
});

test('Enable PITR to database during editing in dbWizard', async ({
page,
}) => {
await page.goto('/databases');
await findDbAndClickActions(page, psmdbName, 'Edit', 'UP');

await goToStep(page, 'backups');

const pitrCheckbox = page
.getByTestId('switch-input-pitr-enabled')
.getByRole('checkbox');
await expect(pitrCheckbox).not.toBeChecked();
await expect(pitrCheckbox).toBeDisabled();
await addFirstScheduleInDBWizard(page);
await expect(pitrCheckbox).not.toBeDisabled();
await expect(
page
.getByTestId('switch-input-pitr-enabled-label')
.getByText(`Storage: ${STORAGE_NAMES[1]}`)
).toBeVisible();

// TODO move to schedules part
// MongoDB could create schedules only with the one of storages, so for not first schedules storage should be disabled
await expect(
page.getByText(
'The backup storage you select for your first backup schedule will be used for al'
)
).toBeVisible();
await page.getByTestId('create-schedule').click();
const scheduleStorageLocation = page.getByTestId(
'text-input-storage-location'
);
await expect(scheduleStorageLocation).toBeDisabled();
await expect(scheduleStorageLocation).not.toBeEmpty();
await page.getByTestId('close-dialog-icon').click();

// Enable pitr
await pitrCheckbox.setChecked(true);
await expect(pitrCheckbox).toBeChecked();

// Check the preview actual value
const pitrPreviewText = (
await page
.getByTestId('section-Backups')
.getByTestId('preview-content')
.allInnerTexts()
)[1];
expect(pitrPreviewText).toBe('PITR Enabled');

await goToStep(page, 'monitoring');
await checkDbWizardEditSubmitIsAvailableAndClick(page);
await checkSuccessOfUpdateAndGoToDbClustersList(page);

await findDbAndClickActions(page, psmdbName, 'Edit');
await goToStep(page, 'backups');
await expect(pitrCheckbox).toBeChecked();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,6 @@ test.describe.serial('DB Cluster Editing Backups Step', async () => {

await goToStep(page, 'backups');
await addFirstScheduleInDBWizard(page);

// Go to Point-in-time Recovery (PITR)
await moveForward(page);
// Go to Advanced Configuration step
await moveForward(page);
// Go to Monitoring step
Expand Down Expand Up @@ -94,8 +91,6 @@ test.describe.serial('DB Cluster Editing Backups Step', async () => {
await addScheduleInDbWizard(page);
await addScheduleInDbWizard(page);

// Go to Point-in-time Recovery (PITR)
await moveForward(page);
// Go to Advanced Configuration step
await moveForward(page);
// Go to Monitoring step
Expand Down
2 changes: 0 additions & 2 deletions ui/apps/everest/.e2e/multinamespaces/monitoring.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ test.describe('Namespaces: Monitoring availability', () => {
await moveForward(page);
// Backups step
await moveForward(page);
// PITR step
await moveForward(page);
// Advanced Configuration step
await moveForward(page);
// Monitoring Step
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,6 @@ test.describe.serial('Namespaces: Backup Storage availability', () => {
await page.getByRole('option', { name: pxcStorageLocationName }).click();
await page.getByTestId('form-dialog-create').click();

// PITR step
await moveForward(page);

const pitrCheckbox = page
.getByTestId('switch-input-pitr-enabled')
.getByRole('checkbox');
Expand Down
2 changes: 0 additions & 2 deletions ui/apps/everest/.e2e/utils/db-wizard.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { expect, Page } from '@playwright/test';
import { startTransition } from 'react';

export const storageLocationAutocompleteEmptyValidationCheck = async (
page: Page,
Expand Down Expand Up @@ -28,7 +27,6 @@ export const goToStep = (
| 'basic-information'
| 'resources'
| 'backups'
| 'point-in-time-recovery'
| 'advanced-configurations'
| 'monitoring'
) => page.getByTestId(`button-edit-preview-${step}`).click();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
export const Messages = {
noStoragesMessage: (namespace: string) =>
`To enable scheduled backups for the ${namespace} namespace, first add a backup storage within the same namespace. If you want to proceed without the scheduled backups, disable them.`,
noStoragesMessage: `To create backup schedules, you need to add a backup storage first.`,
addStorage: 'Add storage',
};
Loading
Loading