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

[Test] Stabilize CustomOpenVSXRegistry e2e test #23329

Merged
merged 2 commits into from
Feb 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion tests/e2e/constants/MOCHA_CONSTANTS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const MOCHA_CONSTANTS: {

MOCHA_DELAYED_SUITE: process.env.MOCHA_DELAYED_SUITE === 'true',

MOCHA_DEFAULT_TIMEOUT: Number(process.env.MOCHA_DEFAULT_TIMEOUT) || 420000,
MOCHA_DEFAULT_TIMEOUT: Number(process.env.MOCHA_DEFAULT_TIMEOUT) || 840000,

MOCHA_RETRIES: process.env.MOCHA_RETRIES || BASE_TEST_CONSTANTS.TEST_ENVIRONMENT === '' ? 0 : 2,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { ITestWorkspaceUtil } from '../../utils/workspace/ITestWorkspaceUtil';
import { TIMEOUT_CONSTANTS } from '../../constants/TIMEOUT_CONSTANTS';
import { DriverHelper } from '../../utils/DriverHelper';
import { error } from 'selenium-webdriver';
import { CreateWorkspace } from '../../pageobjects/dashboard/CreateWorkspace';

suite(
`Create a workspace via launching a factory from the ${FACTORY_TEST_CONSTANTS.TS_SELENIUM_FACTORY_GIT_REPO_URL} repository`,
Expand All @@ -42,6 +43,7 @@ suite(
const appVersion: string = BASE_TEST_CONSTANTS.TESTING_APPLICATION_VERSION
? BASE_TEST_CONSTANTS.TESTING_APPLICATION_VERSION.split('.').slice(0, 2).join('.')
: 'next';
const createWorkspace: CreateWorkspace = e2eContainer.get(CLASSES.CreateWorkspace);
let currentNamespace: string | undefined = '';
let cheClusterNamespace: string | undefined = '';
let cheClusterName: string | undefined = '';
Expand All @@ -56,6 +58,7 @@ suite(
await browserTabsUtil.navigateTo(
FACTORY_TEST_CONSTANTS.TS_SELENIUM_FACTORY_URL() || 'https://github.com/redhat-developer/devspaces/'
);
await createWorkspace.performTrustAuthorPopup();
});

test('Obtain workspace name from workspace loader page', async function (): Promise<void> {
Expand Down Expand Up @@ -112,7 +115,7 @@ suite(
const commandToBuildCustomVSXImage: string = `cd ${pathToPluginRegistry} && yes | ./build.sh`;
const commandLoginIntoInternalRegistry: string =
'podman login -u $(oc whoami | tr -d :) -p $(oc whoami -t) image-registry.openshift-image-registry.svc:5000';
const retagImageCommand: string = `podman tag quay.io/devspaces/pluginregistry-rhel8:next ${internalRegistry}/${currentNamespace}/che-plugin-registry:${appVersion}`;
const retagImageCommand: string = `podman tag quay.io/devspaces/pluginregistry-rhel9:next ${internalRegistry}/${currentNamespace}/che-plugin-registry:${appVersion}`;

const output: ShellString = kubernetesCommandLineToolsExecutor.execInContainerCommand(commandToBuildCustomVSXImage);
expect(output.code).equals(0);
Expand All @@ -130,6 +133,8 @@ suite(

test('Configure Che to use the embedded Eclipse Open VSX server', function (): void {
// create secret for using internal registry
kubernetesCommandLineToolsExecutor.execInContainerCommand(`oc delete secret regcred -n ${cheClusterNamespace} || true`);

const createRegistrySecretCommand: string = `oc create secret -n ${cheClusterNamespace} docker-registry regcred --docker-server=${internalRegistry} --docker-username=\$(oc whoami | tr -d :) --docker-password=\$(oc whoami -t)`;
const createSecretOutput: string = kubernetesCommandLineToolsExecutor.execInContainerCommand(createRegistrySecretCommand);
expect(createSecretOutput).contains('regcred created');
Expand Down Expand Up @@ -194,6 +199,7 @@ suite(
});

suiteTeardown('Clean up resources and restore default CHE cluster CR', async function (): Promise<void> {
kubernetesCommandLineToolsExecutor.getPodAndContainerNames();
try {
kubernetesCommandLineToolsExecutor.execInContainerCommand(`oc delete secret regcred -n ${cheClusterNamespace}`);
} catch (error) {
Expand Down