Skip to content
Merged
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
14 changes: 14 additions & 0 deletions tests/e2e/specs/miscellaneous/PredefinedNamespace.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,25 @@ suite(`Create predefined workspace and check it ${BASE_TEST_CONSTANTS.TEST_ENVIR
// generate empty workspace DevFile and create it through oc client under a regular user
suiteSetup('Login', async function (): Promise<void> {
const devfileContent: string = 'schemaVersion: 2.2.0\n' + 'metadata:\n' + ` name: ${workspaceName}\n`;
const majorMinorVersion: string = BASE_TEST_CONSTANTS.TESTING_APPLICATION_VERSION.split('.').slice(0, 2).join('.');
const devSpacesEditorImage: string = `quay.io/redhat-user-workloads/devspaces-tenant/devspaces/code-rhel9:${majorMinorVersion}`;
kubernetesCommandLineToolsExecutor.loginToOcp(userName);
devWorkspaceConfigurationHelper = new DevWorkspaceConfigurationHelper({
devfileContent
});
devfileContext = await devWorkspaceConfigurationHelper.generateDevfileContext();

// update che-code-injector image to use Dev Spaces VS Code Editor (Dev Spaces only)
if (BASE_TEST_CONSTANTS.TESTING_APPLICATION_NAME() === 'devspaces') {
devfileContext.devWorkspaceTemplates.forEach((template): void => {
template.spec?.components?.forEach((component): void => {
if (component.name === 'che-code-injector' && component.container?.image) {
component.container.image = devSpacesEditorImage;
}
});
});
}

const devWorkspaceConfigurationYamlString: string =
devWorkspaceConfigurationHelper.getDevWorkspaceConfigurationYamlAsString(devfileContext);
kubernetesCommandLineToolsExecutor.applyWithoutNamespace(devWorkspaceConfigurationYamlString);
Expand Down