Skip to content

Commit e9c293a

Browse files
authored
[Test] Stabilize CustomOpenVSXRegistry e2e test (#23329)
1 parent 99346a1 commit e9c293a

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

tests/e2e/constants/MOCHA_CONSTANTS.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export const MOCHA_CONSTANTS: {
2727

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

30-
MOCHA_DEFAULT_TIMEOUT: Number(process.env.MOCHA_DEFAULT_TIMEOUT) || 420000,
30+
MOCHA_DEFAULT_TIMEOUT: Number(process.env.MOCHA_DEFAULT_TIMEOUT) || 840000,
3131

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

tests/e2e/specs/miscellaneous/CustomOpenVSXRegistry.spec.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import { ITestWorkspaceUtil } from '../../utils/workspace/ITestWorkspaceUtil';
2525
import { TIMEOUT_CONSTANTS } from '../../constants/TIMEOUT_CONSTANTS';
2626
import { DriverHelper } from '../../utils/DriverHelper';
2727
import { error } from 'selenium-webdriver';
28+
import { CreateWorkspace } from '../../pageobjects/dashboard/CreateWorkspace';
2829

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

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

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

131134
test('Configure Che to use the embedded Eclipse Open VSX server', function (): void {
132135
// create secret for using internal registry
136+
kubernetesCommandLineToolsExecutor.execInContainerCommand(`oc delete secret regcred -n ${cheClusterNamespace} || true`);
137+
133138
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)`;
134139
const createSecretOutput: string = kubernetesCommandLineToolsExecutor.execInContainerCommand(createRegistrySecretCommand);
135140
expect(createSecretOutput).contains('regcred created');
@@ -194,6 +199,7 @@ suite(
194199
});
195200

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

0 commit comments

Comments
 (0)