Skip to content

Commit

Permalink
EVEREST-1829 - Add support to run upgrade test on feature build
Browse files Browse the repository at this point in the history
  • Loading branch information
tplavcic committed Jan 31, 2025
1 parent 7f097f8 commit cbc6965
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 20 deletions.
3 changes: 2 additions & 1 deletion ui/apps/everest/.e2e/constants.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { EVEREST_BUCKETS_NAMESPACES_MAP, EVEREST_DIR, TAG_FOR_UPGRADE } =
const { EVEREST_BUCKETS_NAMESPACES_MAP, EVEREST_DIR, TAG_FOR_UPGRADE, FB_BUILD } =
process.env;

type BucketsNamespaceMap = [string, string[]][];
Expand All @@ -17,6 +17,7 @@ export const getBucketNamespacesMap = (): BucketsNamespaceMap =>

export const everestdir = EVEREST_DIR;
export const everestTagForUpgrade = TAG_FOR_UPGRADE;
export const everestFeatureBuildForUpgrade = FB_BUILD;

const second = 1_000;
const minute = 60 * second;
Expand Down
4 changes: 2 additions & 2 deletions ui/apps/everest/.e2e/upgrade/post-upgrade.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ test.describe('Post upgrade tests', { tag: '@post-upgrade' }, async () => {
page,
`${operator.shortName}-db-cluster`,
'Up',
TIMEOUTS.ThreeMinutes
TIMEOUTS.FiveMinutes
);
});
}
Expand Down Expand Up @@ -229,7 +229,7 @@ test.describe('Post upgrade tests', { tag: '@post-upgrade' }, async () => {
'Initializing',
TIMEOUTS.ThreeMinutes
);
await waitForStatus(page, `${c.name}`, 'Up', TIMEOUTS.ThreeMinutes);
await waitForStatus(page, `${c.name}`, 'Up', TIMEOUTS.FiveMinutes);
});
}

Expand Down
21 changes: 12 additions & 9 deletions ui/apps/everest/.e2e/upgrade/testData.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { everestTagForUpgrade } from '@e2e/constants';
import { everestTagForUpgrade, everestFeatureBuildForUpgrade } from '@e2e/constants';

export const pxcDBCluster = {
name: 'pxc-db-cluster',
Expand Down Expand Up @@ -37,23 +37,26 @@ export const postgresDBCluster = {
export const expectedEverestUpgradeLog = (
tag = everestTagForUpgrade.replace(/v/g, '')
) => {
return `ℹ️ Upgrading Everest to version ${tag}
const version = typeof everestFeatureBuildForUpgrade !== 'undefined' && everestFeatureBuildForUpgrade
? everestFeatureBuildForUpgrade
: tag;

return `ℹ️ Upgrading Everest to version ${version}
✓ Upgrading Custom Resource Definitions
✓ Upgrading Helm chart
✓ Ensuring Everest API deployment is ready
✓ Ensuring Everest operator deployment is ready
✓ Ensuring Everest CatalogSource is ready
🚀 Everest has been upgraded to version ${tag}
🚀 Everest has been upgraded to version ${version}
To view the password for the 'admin' user, run the following command:
everestctl accounts initial-admin-password
Run the following command to get the initial admin password:
everestctl accounts initial-admin-password
IMPORTANT: This password is NOT stored in a hashed format. To secure it, update the password using the following command:
NOTE: The initial password is stored in plain text. For security, change it immediately using the following command:
everestctl accounts set-password --username admin`;
};
everestctl accounts set-password --username admin`;
};
1 change: 0 additions & 1 deletion ui/apps/everest/.e2e/utils/db-cluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import { getTokenFromLocalStorage } from './localStorage';
import { getNamespacesFn } from './namespaces';
import { DbType } from '@percona/types';
import { checkError, getVersionServiceURL } from '@e2e/utils/generic';
import { execSync } from 'child_process';

export const createDbClusterFn = async (
request: APIRequestContext,
Expand Down
21 changes: 14 additions & 7 deletions ui/apps/everest/.e2e/utils/generic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

import { expect } from '@playwright/test';
import { execSync } from 'child_process';
import { everestFeatureBuildForUpgrade } from '@e2e/constants';

export const checkError = async (response) => {
if (!response.ok()) {
Expand All @@ -25,12 +26,18 @@ export const checkError = async (response) => {
};

export const getVersionServiceURL = async () => {
try {
const command = `kubectl get deployment everest-server --namespace everest-system -o jsonpath="{.spec.template.spec.containers[0].env[?(@.name=='VERSION_SERVICE_URL')].value}"`;
const output = execSync(command).toString();
return output;
} catch (error) {
console.error(`Error executing command: ${error}`);
throw error;
if (typeof everestFeatureBuildForUpgrade !== 'undefined' && everestFeatureBuildForUpgrade) {
return "http://localhost:8081";
}
else {
try {
const command = `kubectl get deployment everest-server --namespace everest-system -o jsonpath="{.spec.template.spec.containers[0].env[?(@.name=='VERSION_SERVICE_URL')].value}"`;
const output = execSync(command).toString();
return output;
} catch (error) {
console.error(`Error executing command: ${error}`);
throw error;
}
}

};

0 comments on commit cbc6965

Please sign in to comment.