From 3f34d5c664f7defda5b5440077dfc57eebbb28ac Mon Sep 17 00:00:00 2001 From: msivasubramaniaan Date: Thu, 25 Jul 2024 19:37:13 +0530 Subject: [PATCH 01/15] chaged the image path and removed (formerly Red Hat CodeReady Containers) text Signed-off-by: msivasubramaniaan --- README.crc-workflow.md | 4 ++-- doc/development.md | 2 +- images/{welcome/devfile.png => openshift-local.png} | Bin src/webview/cluster/app/cluster.style.tsx | 1 - src/webview/cluster/app/cluster.tsx | 7 ++++--- src/webview/welcome/app/welcomePage.tsx | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) rename images/{welcome/devfile.png => openshift-local.png} (100%) diff --git a/README.crc-workflow.md b/README.crc-workflow.md index ca17aedbb..016b364ea 100644 --- a/README.crc-workflow.md +++ b/README.crc-workflow.md @@ -7,7 +7,7 @@ from `OpenShift: Application Explorer` view title. ![ addcluster ](https://raw.githubusercontent.com/redhat-developer/vscode-openshift-tools/main/images/add-cluster.gif) The view provides a guided workflow to create and start OpenShift 4 single node cluster on your workstation -using OpenShift Local (formerly Red Hat CodeReady Containers): +using OpenShift Local: * Download & Install OpenShift Local * Set Virtual Machine parameters: number of CPUs and memory limit @@ -21,4 +21,4 @@ The view provides following options to control cluster's state: * Open OpenShift Developer Console for cluster * Refresh cluster's state -![ screencast ](https://raw.githubusercontent.com/redhat-developer/vscode-openshift-tools/main/images/gif/crc-webview.gif) \ No newline at end of file +![ screencast ](https://raw.githubusercontent.com/redhat-developer/vscode-openshift-tools/main/images/gif/crc-webview.gif) diff --git a/doc/development.md b/doc/development.md index 4b7845c82..8b9cb7b63 100644 --- a/doc/development.md +++ b/doc/development.md @@ -79,7 +79,7 @@ use # Running local OpenShift Cluster -## OpenShift Local (formerly Red Hat CodeReady Containers) +## OpenShift Local 1. Downloads are available at: https://developers.redhat.com/content-gateway/rest/mirror/pub/openshift-v4/clients/crc/ 2. To use these binaries follow the instructions at https://console.redhat.com/openshift/install/crc/installer-provisioned to obtain the needed pull-secret. diff --git a/images/welcome/devfile.png b/images/openshift-local.png similarity index 100% rename from images/welcome/devfile.png rename to images/openshift-local.png diff --git a/src/webview/cluster/app/cluster.style.tsx b/src/webview/cluster/app/cluster.style.tsx index 99cfff4ab..0eb7b193a 100644 --- a/src/webview/cluster/app/cluster.style.tsx +++ b/src/webview/cluster/app/cluster.style.tsx @@ -181,7 +181,6 @@ export default (theme: Theme) => cardBody: { maxHeight: '15em', overflow: 'hidden', - overflowY: 'scroll', '&::-webkit-scrollbar': { width: 0, } diff --git a/src/webview/cluster/app/cluster.tsx b/src/webview/cluster/app/cluster.tsx index 460566983..9a0e6df36 100644 --- a/src/webview/cluster/app/cluster.tsx +++ b/src/webview/cluster/app/cluster.tsx @@ -12,15 +12,16 @@ import clusterStyle, { ClusterTheme } from './cluster.style'; import AddClusterView from './clusterView'; import OpenShiftLogo from './images/logo.png'; import AddSandboxView from './sandboxView'; +import OpenShiftLocal from '../../../../images/openshift-local.png'; const useStyles = makeStyles(clusterStyle); const clusterTypes = [ { heading: 'Deploy it locally on your laptop', - description: 'Install on Laptop: Red Hat OpenShift Local (formerly Red Hat CodeReady Containers)', + description: 'Install on Laptop: Red Hat OpenShift Local', smallInfo: 'Create a minimal OpenShift 4 cluster on your desktop/laptop for local development and testing.', - imageUrl: ['https://www.openshift.com/hubfs/images/icons/Icon-Red_Hat-Hardware-Laptop-A-Black-RGB.svg'], + imageUrl: [OpenShiftLocal], urlAlt: 'crc', redirectLink: '', buttonText: 'Create/Refresh cluster', @@ -30,7 +31,7 @@ const clusterTypes = [ heading: 'Launch Developer Sandbox', description: 'Free access to the Developer Sandbox for Red Hat OpenShift', smallInfo: 'If you are exploring how to run your code as containers in OpenShift, our free Developer Sandbox instantly gives you a way to try it out.', - imageUrl: ['https://assets.openshift.com/hubfs/images/logos/osh/Logo-Red_Hat-OpenShift-A-Standard-RGB.svg'], + imageUrl: ['https://www.redhat.com/rhdc/managed-files/Logo-Red_Hat-OpenShift-A-Standard-RGB.svg'], urlAlt: 'dev sandbox', redirectLink: '', buttonText: 'Start your OpenShift experience', diff --git a/src/webview/welcome/app/welcomePage.tsx b/src/webview/welcome/app/welcomePage.tsx index a893e8213..c2a5d5adb 100644 --- a/src/webview/welcome/app/welcomePage.tsx +++ b/src/webview/welcome/app/welcomePage.tsx @@ -16,7 +16,7 @@ import OpenShiftLogo from '../../../../images/title/logo.svg'; import OpenShiftBranding from '../../../../images/welcome/OpenShift-Branding-box.png'; import CloudBranding from '../../../../images/welcome/cloud.svg'; import ComponentBranding from '../../../../images/welcome/component.png'; -import DevfileBranding from '../../../../images/welcome/devfile.png'; +import OpenShhiftLocal from '../../../../images/openshift-local.png'; import MicrosoftLogo from '../../../../images/welcome/microsoft.svg'; import OdoLogo from '../../../../images/welcome/odo.png'; import { VSCodeMessage } from './vsCodeMessage'; @@ -363,7 +363,7 @@ export class Welcome extends React.Component
- +
From 23e06161532cd83821cfecda6320b440dc7ccba0 Mon Sep 17 00:00:00 2001 From: msivasubramaniaan Date: Tue, 30 Jul 2024 23:08:19 +0530 Subject: [PATCH 02/15] removed odo analyze command Signed-off-by: msivasubramaniaan --- src/downloadUtil/downloadBinaries.ts | 10 +++-- src/odo/componentType.ts | 14 +++++++ src/odo/odoWrapper.ts | 11 +++--- src/tools.json | 37 +++++++++++++++++++ src/tools.ts | 3 +- .../create-component/createComponentLoader.ts | 17 ++++----- test/integration/odoWrapper.test.ts | 13 +++---- 7 files changed, 78 insertions(+), 27 deletions(-) diff --git a/src/downloadUtil/downloadBinaries.ts b/src/downloadUtil/downloadBinaries.ts index 1dbb6f7ab..aaec7d625 100644 --- a/src/downloadUtil/downloadBinaries.ts +++ b/src/downloadUtil/downloadBinaries.ts @@ -57,10 +57,12 @@ export async function downloadFileAndCreateSha256( console.log(`${current}%`), ); const currentSHA256 = await hasha.fromFile(currentFile, { algorithm: 'sha256' }); - if (currentSHA256 === platform.sha256sum) { - console.log(`Download of ${currentFile} has finished and SHA256 is correct`); - } else { - throw Error(`${currentFile} is downloaded and SHA256 is not correct`); + if (platform.sha256sum) { + if (currentSHA256 === platform.sha256sum) { + console.log(`Download of ${currentFile} has finished and SHA256 is correct`); + } else { + throw Error(`${currentFile} is downloaded and SHA256 is not correct`); + } } if (process.env.REMOTE_CONTAINERS === 'true') { await extractTool(toolsFolder, platform, currentFile); diff --git a/src/odo/componentType.ts b/src/odo/componentType.ts index e65bcd168..4be8b1b83 100644 --- a/src/odo/componentType.ts +++ b/src/odo/componentType.ts @@ -92,6 +92,20 @@ export interface AnalyzeResponse { ports: number[]; } +interface Version { + SchemaVersion: number; + Default: boolean; + Version: string; +} + +export interface AlizerAnalyzeResponse { + Name: string; + Language: string; + ProjectType: string; + Tags: string[]; + Versions: Version[]; +} + export type ComponentTypeDescription = DevfileComponentType & DevfileData; export class ComponentTypeAdapter implements ComponentType { diff --git a/src/odo/odoWrapper.ts b/src/odo/odoWrapper.ts index ee17ab8f0..4a763336d 100644 --- a/src/odo/odoWrapper.ts +++ b/src/odo/odoWrapper.ts @@ -11,7 +11,7 @@ import { ToolsConfig } from '../tools'; import { ChildProcessUtil, CliExitData } from '../util/childProcessUtil'; import { VsCommandError } from '../vscommand'; import { Command } from './command'; -import { AnalyzeResponse, ComponentTypeAdapter, ComponentTypeDescription, DevfileComponentType, Registry } from './componentType'; +import { AlizerAnalyzeResponse, ComponentTypeAdapter, ComponentTypeDescription, DevfileComponentType, Registry } from './componentType'; import { ComponentDescription, StarterProject } from './componentTypeDescription'; import { BindableService } from './odoTypes'; @@ -194,13 +194,12 @@ export class Odo { ); } - public async analyze(currentFolderPath: string): Promise { + public async alizerAnalyze(currentFolderPath: Uri): Promise { const cliData: CliExitData = await this.execute( - new CommandText('odo', 'analyze -o json'), - currentFolderPath, + new CommandText('alizer', `devfile ${currentFolderPath.fsPath}`) ); - const parse = JSON.parse(cliData.stdout) as AnalyzeResponse[]; - return parse; + const parse = JSON.parse(cliData.stdout) as AlizerAnalyzeResponse[]; + return [[...parse].shift()]; } /** diff --git a/src/tools.json b/src/tools.json index 79ddbb724..df9f767b4 100644 --- a/src/tools.json +++ b/src/tools.json @@ -173,6 +173,43 @@ } } }, + "alizer": { + "description": "Alizer CLI tool", + "vendor": "The Devfile Project", + "name": "alizer", + "version": "1.6.0", + "versionRange": "^1.6.0", + "versionRangeLabel": "version >= 1.6.0", + "dlFileName": "alizer", + "filePrefix": "", + "platform": { + "win32": { + "url": "https://github.com/devfile/alizer/releases/download/v1.6.0/alizer-v1.6.0-windows-amd64.exe", + "dlFileName": "alizer_windows_amd64.exe", + "cmdFileName": "alizer.exe" + }, + "darwin": { + "url": "https://github.com/devfile/alizer/releases/download/v1.6.0/alizer-v1.6.0-darwin-amd64", + "dlFileName": "alizer_darwin_amd64", + "cmdFileName": "alizer" + }, + "darwin-arm64": { + "url": "https://github.com/devfile/alizer/releases/download/v1.6.0/alizer-v1.6.0-darwin-arm64", + "dlFileName": "alizer_darwin_arm64", + "cmdFileName": "alizer" + }, + "linux": { + "url": "https://github.com/devfile/alizer/releases/download/v1.6.0/alizer-v1.6.0-linux-amd64", + "dlFileName": "alizer_linux_amd64", + "cmdFileName": "alizer" + }, + "linux-arm64": { + "url": "https://github.com/devfile/alizer/releases/download/v1.6.0/alizer-v1.6.0-linux-arm64", + "dlFileName": "alizer_linux_arm64", + "cmdFileName": "alizer" + } + } + }, "crc": { "description": "crc openshift container", "vendor": "Red Hat, Inc.", diff --git a/src/tools.ts b/src/tools.ts index 5890bb204..c3b3b6297 100644 --- a/src/tools.ts +++ b/src/tools.ts @@ -92,11 +92,12 @@ export class ToolsConfig { public static async selectTool(locations: string[], versionRange: string): Promise { let result: string; const funcValue = Platform.OS !== 'win32' ? 'func' : 'func.exe'; + const alizerValue = Platform.OS !== 'win32' ? 'alizer' : 'alizer.exe'; // Array.find cannot be used here because of async calls for (const location of locations) { // FIXME: see https://github.com/knative/func/issues/2067 // eslint-disable-next-line no-await-in-loop - if (location && (location.endsWith(funcValue) || semver.satisfies(await ToolsConfig.getVersion(location), versionRange))) { + if (location && (location.endsWith(funcValue) || location.endsWith(alizerValue) || semver.satisfies(await ToolsConfig.getVersion(location), versionRange))) { result = location; break; } diff --git a/src/webview/create-component/createComponentLoader.ts b/src/webview/create-component/createComponentLoader.ts index 28705c112..52b0bb811 100644 --- a/src/webview/create-component/createComponentLoader.ts +++ b/src/webview/create-component/createComponentLoader.ts @@ -11,7 +11,7 @@ import * as tmp from 'tmp'; import { promisify } from 'util'; import * as vscode from 'vscode'; import { extensions, Uri, ViewColumn, WebviewPanel, window } from 'vscode'; -import { AnalyzeResponse, ComponentTypeDescription } from '../../odo/componentType'; +import { AlizerAnalyzeResponse, ComponentTypeDescription } from '../../odo/componentType'; import { Endpoint } from '../../odo/componentTypeDescription'; import { Odo } from '../../odo/odoWrapper'; import { ComponentTypesView } from '../../registriesView'; @@ -514,14 +514,14 @@ export default class CreateComponentLoader { } static async getRecommendedDevfile(uri: Uri): Promise { - let analyzeRes: AnalyzeResponse[] = []; + let analyzeRes: AlizerAnalyzeResponse[] = []; let compDescriptions: ComponentTypeDescription[] = []; try { void CreateComponentLoader.panel.webview.postMessage({ action: 'getRecommendedDevfileStart' }); - analyzeRes = await Odo.Instance.analyze(uri.fsPath); - compDescriptions = await getCompDescription(analyzeRes); + const alizerAnalyzeRes: AlizerAnalyzeResponse[] = await Odo.Instance.alizerAnalyze(uri); + compDescriptions = await getCompDescription(alizerAnalyzeRes); } catch (error) { if (error.message.toLowerCase().indexOf('failed to parse the devfile') !== -1) { const actions: Array = ['Yes', 'Cancel']; @@ -535,7 +535,7 @@ export default class CreateComponentLoader { const file = await fs.readFile(devFileV1Path, 'utf8'); const devfileV1 = JSYAML.load(file.toString()) as DevfileV1; await fs.unlink(devFileV1Path); - analyzeRes = await Odo.Instance.analyze(uri.fsPath); + analyzeRes = await Odo.Instance.alizerAnalyze(uri); compDescriptions = await getCompDescription(analyzeRes); const endPoints = getEndPoints(compDescriptions[0]); const devfileV2 = DevfileConverter.getInstance().devfileV1toDevfileV2( @@ -583,7 +583,7 @@ export default class CreateComponentLoader { } } -async function getCompDescription(devfiles: AnalyzeResponse[]): Promise { +async function getCompDescription(devfiles: AlizerAnalyzeResponse[]): Promise { const compDescriptions = await ComponentTypesView.instance.getCompDescriptions(); if (devfiles.length === 0) { return Array.from(compDescriptions); @@ -591,9 +591,8 @@ async function getCompDescription(devfiles: AnalyzeResponse[]): Promise devfiles.some( (res) => - res.devfile === name && - res.devfileVersion === version && - res.devfileRegistry === registry.name, + res.Name === name && + res.Versions[0].Version === version ), ); } diff --git a/test/integration/odoWrapper.test.ts b/test/integration/odoWrapper.test.ts index 35e5fb3e6..cc8d0fd62 100644 --- a/test/integration/odoWrapper.test.ts +++ b/test/integration/odoWrapper.test.ts @@ -100,12 +100,12 @@ suite('./odo/odoWrapper.ts', function () { }); test('analyze()', async function () { - const analysis1 = await Odo.Instance.analyze(tmpFolder1.fsPath); + const analysis1 = await Odo.Instance.alizerAnalyze(tmpFolder1); expect(analysis1).to.exist; - expect(analysis1[0].devfile).to.equal('nodejs'); - const analysis2 = await Odo.Instance.analyze(tmpFolder2.fsPath); + expect(analysis1[0].Name).to.equal('nodejs'); + const analysis2 = await Odo.Instance.alizerAnalyze(tmpFolder2); expect(analysis2).to.exist; - expect(analysis2[0].devfile).to.equal('go'); + expect(analysis2[0].Name).to.equal('go'); }); }); @@ -208,9 +208,8 @@ suite('./odo/odoWrapper.ts', function () { }); test('analyze()', async function() { - const [analysis] = await Odo.Instance.analyze(tmpFolder); - expect(analysis.name).to.equal(path.basename(tmpFolder).toLocaleLowerCase()); - expect(analysis.devfile).to.equal(COMPONENT_TYPE); + const [analysis] = await Odo.Instance.alizerAnalyze(Uri.file(tmpFolder)); + expect(analysis.Name).to.equal(COMPONENT_TYPE); }); test('deleteComponentConfiguration()', async function() { From 63381743c78e1d62f743319763ab1a85ca0b1b0f Mon Sep 17 00:00:00 2001 From: msivasubramaniaan Date: Fri, 2 Aug 2024 14:45:32 +0530 Subject: [PATCH 03/15] addressed review comments Signed-off-by: msivasubramaniaan --- src/alizer/alizerWrapper.ts | 35 +++++++++++++++++++ src/alizer/types.ts | 19 ++++++++++ src/odo/componentType.ts | 14 -------- src/odo/odoWrapper.ts | 10 +----- .../create-component/createComponentLoader.ts | 24 ++++++------- test/integration/odoWrapper.test.ts | 7 ++-- 6 files changed, 71 insertions(+), 38 deletions(-) create mode 100644 src/alizer/alizerWrapper.ts create mode 100644 src/alizer/types.ts diff --git a/src/alizer/alizerWrapper.ts b/src/alizer/alizerWrapper.ts new file mode 100644 index 000000000..a20772a10 --- /dev/null +++ b/src/alizer/alizerWrapper.ts @@ -0,0 +1,35 @@ +/*----------------------------------------------------------------------------------------------- + * Copyright (c) Red Hat, Inc. All rights reserved. + * Licensed under the MIT License. See LICENSE file in the project root for license information. + *-----------------------------------------------------------------------------------------------*/ + +import { CommandText } from '../base/command'; +import { CliChannel } from '../cli'; +import { Uri } from 'vscode'; +import { CliExitData } from '../util/childProcessUtil'; +import { AlizerAnalyzeResponse } from './types'; + +/** + * A wrapper around the `alizer` CLI tool. + * + * This class is a stateless singleton. + * This makes it easier to stub its methods than if it were a bunch of directly exported functions. + */ +export class Alizer { + private static INSTANCE = new Alizer(); + + static get Instance() { + return Alizer.INSTANCE; + } + + public async alizerAnalyze(currentFolderPath: Uri): Promise { + const cliData: CliExitData = await CliChannel.getInstance().executeTool( + new CommandText('alizer', `devfile ${currentFolderPath.fsPath}`), undefined, false + ); + if (cliData.error || cliData.stderr.length > 0) { + return undefined; + } + const parse = JSON.parse(cliData.stdout) as AlizerAnalyzeResponse[]; + return parse[0]; + } +} diff --git a/src/alizer/types.ts b/src/alizer/types.ts new file mode 100644 index 000000000..56e218c84 --- /dev/null +++ b/src/alizer/types.ts @@ -0,0 +1,19 @@ +/*----------------------------------------------------------------------------------------------- + * Copyright (c) Red Hat, Inc. All rights reserved. + * Licensed under the MIT License. See LICENSE file in the project root for license information. + *-----------------------------------------------------------------------------------------------*/ + + +interface Version { + SchemaVersion: number; + Default: boolean; + Version: string; +} + +export interface AlizerAnalyzeResponse { + Name: string; + Language: string; + ProjectType: string; + Tags: string[]; + Versions: Version[]; +} diff --git a/src/odo/componentType.ts b/src/odo/componentType.ts index 4be8b1b83..e65bcd168 100644 --- a/src/odo/componentType.ts +++ b/src/odo/componentType.ts @@ -92,20 +92,6 @@ export interface AnalyzeResponse { ports: number[]; } -interface Version { - SchemaVersion: number; - Default: boolean; - Version: string; -} - -export interface AlizerAnalyzeResponse { - Name: string; - Language: string; - ProjectType: string; - Tags: string[]; - Versions: Version[]; -} - export type ComponentTypeDescription = DevfileComponentType & DevfileData; export class ComponentTypeAdapter implements ComponentType { diff --git a/src/odo/odoWrapper.ts b/src/odo/odoWrapper.ts index 4a763336d..eaf4ec666 100644 --- a/src/odo/odoWrapper.ts +++ b/src/odo/odoWrapper.ts @@ -11,7 +11,7 @@ import { ToolsConfig } from '../tools'; import { ChildProcessUtil, CliExitData } from '../util/childProcessUtil'; import { VsCommandError } from '../vscommand'; import { Command } from './command'; -import { AlizerAnalyzeResponse, ComponentTypeAdapter, ComponentTypeDescription, DevfileComponentType, Registry } from './componentType'; +import { ComponentTypeAdapter, ComponentTypeDescription, DevfileComponentType, Registry } from './componentType'; import { ComponentDescription, StarterProject } from './componentTypeDescription'; import { BindableService } from './odoTypes'; @@ -194,14 +194,6 @@ export class Odo { ); } - public async alizerAnalyze(currentFolderPath: Uri): Promise { - const cliData: CliExitData = await this.execute( - new CommandText('alizer', `devfile ${currentFolderPath.fsPath}`) - ); - const parse = JSON.parse(cliData.stdout) as AlizerAnalyzeResponse[]; - return [[...parse].shift()]; - } - /** * Returns a list of starter projects for the given Devfile * diff --git a/src/webview/create-component/createComponentLoader.ts b/src/webview/create-component/createComponentLoader.ts index 52b0bb811..f62e62b85 100644 --- a/src/webview/create-component/createComponentLoader.ts +++ b/src/webview/create-component/createComponentLoader.ts @@ -11,7 +11,7 @@ import * as tmp from 'tmp'; import { promisify } from 'util'; import * as vscode from 'vscode'; import { extensions, Uri, ViewColumn, WebviewPanel, window } from 'vscode'; -import { AlizerAnalyzeResponse, ComponentTypeDescription } from '../../odo/componentType'; +import { ComponentTypeDescription } from '../../odo/componentType'; import { Endpoint } from '../../odo/componentTypeDescription'; import { Odo } from '../../odo/odoWrapper'; import { ComponentTypesView } from '../../registriesView'; @@ -30,6 +30,8 @@ import { } from '../common-ext/createComponentHelpers'; import { loadWebviewHtml, validateGitURL } from '../common-ext/utils'; import { Devfile, DevfileRegistry, TemplateProjectIdentifier } from '../common/devfile'; +import { AlizerAnalyzeResponse } from '../../alizer/types'; +import { Alizer } from '../../alizer/alizerWrapper'; interface CloneProcess { status: boolean; @@ -514,13 +516,13 @@ export default class CreateComponentLoader { } static async getRecommendedDevfile(uri: Uri): Promise { - let analyzeRes: AlizerAnalyzeResponse[] = []; + let analyzeRes: AlizerAnalyzeResponse; let compDescriptions: ComponentTypeDescription[] = []; try { void CreateComponentLoader.panel.webview.postMessage({ action: 'getRecommendedDevfileStart' }); - const alizerAnalyzeRes: AlizerAnalyzeResponse[] = await Odo.Instance.alizerAnalyze(uri); + const alizerAnalyzeRes: AlizerAnalyzeResponse = await Alizer.Instance.alizerAnalyze(uri); compDescriptions = await getCompDescription(alizerAnalyzeRes); } catch (error) { if (error.message.toLowerCase().indexOf('failed to parse the devfile') !== -1) { @@ -535,7 +537,7 @@ export default class CreateComponentLoader { const file = await fs.readFile(devFileV1Path, 'utf8'); const devfileV1 = JSYAML.load(file.toString()) as DevfileV1; await fs.unlink(devFileV1Path); - analyzeRes = await Odo.Instance.alizerAnalyze(uri); + analyzeRes = await Alizer.Instance.alizerAnalyze(uri); compDescriptions = await getCompDescription(analyzeRes); const endPoints = getEndPoints(compDescriptions[0]); const devfileV2 = DevfileConverter.getInstance().devfileV1toDevfileV2( @@ -583,17 +585,15 @@ export default class CreateComponentLoader { } } -async function getCompDescription(devfiles: AlizerAnalyzeResponse[]): Promise { +async function getCompDescription(devfile: AlizerAnalyzeResponse): Promise { const compDescriptions = await ComponentTypesView.instance.getCompDescriptions(); - if (devfiles.length === 0) { + if (!devfile) { return Array.from(compDescriptions); } - return Array.from(compDescriptions).filter(({ name, version, registry }) => - devfiles.some( - (res) => - res.Name === name && - res.Versions[0].Version === version - ), + return Array.from(compDescriptions).filter(({ name, version }) => { + devfile.Name === name; + devfile.Versions[0].Version === version + } ); } diff --git a/test/integration/odoWrapper.test.ts b/test/integration/odoWrapper.test.ts index cc8d0fd62..3adcc4dee 100644 --- a/test/integration/odoWrapper.test.ts +++ b/test/integration/odoWrapper.test.ts @@ -14,6 +14,7 @@ import { Uri, workspace } from 'vscode'; import { Oc } from '../../src/oc/ocWrapper'; import { Odo } from '../../src/odo/odoWrapper'; import { LoginUtil } from '../../src/util/loginUtil'; +import { Alizer } from '../../src/alizer/alizerWrapper'; suite('./odo/odoWrapper.ts', function () { const isOpenShift: boolean = Boolean(parseInt(process.env.IS_OPENSHIFT, 10)) || false; @@ -100,10 +101,10 @@ suite('./odo/odoWrapper.ts', function () { }); test('analyze()', async function () { - const analysis1 = await Odo.Instance.alizerAnalyze(tmpFolder1); + const analysis1 = await Alizer.Instance.alizerAnalyze(tmpFolder1); expect(analysis1).to.exist; expect(analysis1[0].Name).to.equal('nodejs'); - const analysis2 = await Odo.Instance.alizerAnalyze(tmpFolder2); + const analysis2 = await Alizer.Instance.alizerAnalyze(tmpFolder2); expect(analysis2).to.exist; expect(analysis2[0].Name).to.equal('go'); }); @@ -208,7 +209,7 @@ suite('./odo/odoWrapper.ts', function () { }); test('analyze()', async function() { - const [analysis] = await Odo.Instance.alizerAnalyze(Uri.file(tmpFolder)); + const analysis = await Alizer.Instance.alizerAnalyze(Uri.file(tmpFolder)); expect(analysis.Name).to.equal(COMPONENT_TYPE); }); From 8a9264ebe621a9a03a11497546297dbc92bfa7fb Mon Sep 17 00:00:00 2001 From: msivasubramaniaan Date: Thu, 8 Aug 2024 21:36:12 +0530 Subject: [PATCH 04/15] added alizer test Signed-off-by: msivasubramaniaan --- test/integration/alizerWrapper.test.ts | 124 +++++++++++++++++++++++++ test/integration/odoWrapper.test.ts | 15 --- 2 files changed, 124 insertions(+), 15 deletions(-) create mode 100644 test/integration/alizerWrapper.test.ts diff --git a/test/integration/alizerWrapper.test.ts b/test/integration/alizerWrapper.test.ts new file mode 100644 index 000000000..357834dbe --- /dev/null +++ b/test/integration/alizerWrapper.test.ts @@ -0,0 +1,124 @@ +/*----------------------------------------------------------------------------------------------- + * Copyright (c) Red Hat, Inc. All rights reserved. + * Licensed under the MIT License. See LICENSE file in the project root for license information. + *-----------------------------------------------------------------------------------------------*/ + +import { expect } from 'chai'; +import * as fs from 'fs/promises'; +import { suite, suiteSetup } from 'mocha'; +import * as tmp from 'tmp'; +import { promisify } from 'util'; +import { Uri, workspace } from 'vscode'; +import { Oc } from '../../src/oc/ocWrapper'; +import { Odo } from '../../src/odo/odoWrapper'; +import { LoginUtil } from '../../src/util/loginUtil'; +import { Alizer } from '../../src/alizer/alizerWrapper'; + +suite('./alizer/alizerWrapper.ts', function () { + const isOpenShift: boolean = Boolean(parseInt(process.env.IS_OPENSHIFT, 10)) || false; + const clusterUrl = process.env.CLUSTER_URL || 'https://api.crc.testing:6443'; + const username = process.env.CLUSTER_USER || 'developer'; + const password = process.env.CLUSTER_PASSWORD || 'developer'; + + suiteSetup(async function () { + if (isOpenShift) { + try { + await LoginUtil.Instance.logout(); + } catch (e) { + // do nothing + } + await Oc.Instance.loginWithUsernamePassword(clusterUrl, username, password); + } + }); + + suiteTeardown(async function () { + // ensure projects are cleaned up + try { + await Oc.Instance.deleteProject('my-test-project-1'); + } catch (e) { + // do nothing + } + try { + await Oc.Instance.deleteProject('my-test-project-2'); + } catch (e) { + // do nothing + } + + if (isOpenShift) { + await LoginUtil.Instance.logout(); + } + }); + + suite('analyse folder', function () { + const project1 = 'my-test-project-1'; + + let tmpFolder1: Uri; + let tmpFolder2: Uri; + + suiteSetup(async function () { + await Oc.Instance.createProject(project1); + tmpFolder1 = Uri.parse(await promisify(tmp.dir)()); + tmpFolder2 = Uri.parse(await promisify(tmp.dir)()); + await Odo.Instance.createComponentFromFolder( + 'nodejs', + undefined, + 'component1', + tmpFolder1, + 'nodejs-starter', + ); + await Odo.Instance.createComponentFromFolder( + 'go', + undefined, + 'component2', + tmpFolder2, + 'go-starter', + ); + }); + + suiteTeardown(async function () { + if (isOpenShift) { + await Oc.Instance.loginWithUsernamePassword(clusterUrl, username, password); + } + const newWorkspaceFolders = workspace.workspaceFolders.filter((workspaceFolder) => { + const fsPath = workspaceFolder.uri.fsPath; + return (fsPath !== tmpFolder1.fsPath && fsPath !== tmpFolder2.fsPath); + }); + workspace.updateWorkspaceFolders(0, workspace.workspaceFolders.length, ...newWorkspaceFolders); + await fs.rm(tmpFolder1.fsPath, { force: true, recursive: true }); + await fs.rm(tmpFolder2.fsPath, { force: true, recursive: true }); + await Oc.Instance.deleteProject(project1); + }); + + test('analyze()', async function () { + const analysis1 = await Alizer.Instance.alizerAnalyze(tmpFolder1); + expect(analysis1).to.exist; + expect(analysis1.Name).to.equal('nodejs'); + const analysis2 = await Alizer.Instance.alizerAnalyze(tmpFolder2); + expect(analysis2).to.exist; + expect(analysis2.Name).to.equal('go'); + }); + }); + + suite('create component', function() { + + const COMPONENT_TYPE = 'dotnet50'; + + let tmpFolder: string; + + suiteSetup(async function() { + tmpFolder = await promisify(tmp.dir)(); + }); + + suiteTeardown(async function() { + await fs.rm(tmpFolder, { recursive: true, force: true }); + }); + + test('analyze()', async function() { + const analysis = await Alizer.Instance.alizerAnalyze(Uri.file(tmpFolder)); + expect(analysis.Name).to.equal(COMPONENT_TYPE); + }); + + }); + + test('deleteComponentConfiguration'); +}); diff --git a/test/integration/odoWrapper.test.ts b/test/integration/odoWrapper.test.ts index 3adcc4dee..a47d80d5e 100644 --- a/test/integration/odoWrapper.test.ts +++ b/test/integration/odoWrapper.test.ts @@ -14,7 +14,6 @@ import { Uri, workspace } from 'vscode'; import { Oc } from '../../src/oc/ocWrapper'; import { Odo } from '../../src/odo/odoWrapper'; import { LoginUtil } from '../../src/util/loginUtil'; -import { Alizer } from '../../src/alizer/alizerWrapper'; suite('./odo/odoWrapper.ts', function () { const isOpenShift: boolean = Boolean(parseInt(process.env.IS_OPENSHIFT, 10)) || false; @@ -99,15 +98,6 @@ suite('./odo/odoWrapper.ts', function () { expect(componentDescription2).to.exist; expect(componentDescription2.managedBy).to.equal('odo'); }); - - test('analyze()', async function () { - const analysis1 = await Alizer.Instance.alizerAnalyze(tmpFolder1); - expect(analysis1).to.exist; - expect(analysis1[0].Name).to.equal('nodejs'); - const analysis2 = await Alizer.Instance.alizerAnalyze(tmpFolder2); - expect(analysis2).to.exist; - expect(analysis2[0].Name).to.equal('go'); - }); }); suite('registries', function () { @@ -208,11 +198,6 @@ suite('./odo/odoWrapper.ts', function () { } }); - test('analyze()', async function() { - const analysis = await Alizer.Instance.alizerAnalyze(Uri.file(tmpFolder)); - expect(analysis.Name).to.equal(COMPONENT_TYPE); - }); - test('deleteComponentConfiguration()', async function() { await Odo.Instance.deleteComponentConfiguration(tmpFolder); try { From f8dcc692f5b7681fc74101e753d05257c790b52d Mon Sep 17 00:00:00 2001 From: msivasubramaniaan Date: Thu, 8 Aug 2024 21:42:18 +0530 Subject: [PATCH 05/15] fixed no-unused-vars error Signed-off-by: msivasubramaniaan --- test/integration/alizerWrapper.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/integration/alizerWrapper.test.ts b/test/integration/alizerWrapper.test.ts index 357834dbe..c6b3ee961 100644 --- a/test/integration/alizerWrapper.test.ts +++ b/test/integration/alizerWrapper.test.ts @@ -24,7 +24,7 @@ suite('./alizer/alizerWrapper.ts', function () { if (isOpenShift) { try { await LoginUtil.Instance.logout(); - } catch (e) { + } catch (_e) { // do nothing } await Oc.Instance.loginWithUsernamePassword(clusterUrl, username, password); @@ -35,12 +35,12 @@ suite('./alizer/alizerWrapper.ts', function () { // ensure projects are cleaned up try { await Oc.Instance.deleteProject('my-test-project-1'); - } catch (e) { + } catch (_e) { // do nothing } try { await Oc.Instance.deleteProject('my-test-project-2'); - } catch (e) { + } catch (_e) { // do nothing } From 71031a3f08202e3972bcdf82a9990b1f5a62d127 Mon Sep 17 00:00:00 2001 From: msivasubramaniaan Date: Thu, 8 Aug 2024 21:50:05 +0530 Subject: [PATCH 06/15] fixed no-unused-vars error Signed-off-by: msivasubramaniaan --- test/integration/alizerWrapper.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/integration/alizerWrapper.test.ts b/test/integration/alizerWrapper.test.ts index c6b3ee961..751524b4e 100644 --- a/test/integration/alizerWrapper.test.ts +++ b/test/integration/alizerWrapper.test.ts @@ -24,7 +24,7 @@ suite('./alizer/alizerWrapper.ts', function () { if (isOpenShift) { try { await LoginUtil.Instance.logout(); - } catch (_e) { + } catch (_) { // do nothing } await Oc.Instance.loginWithUsernamePassword(clusterUrl, username, password); @@ -35,12 +35,12 @@ suite('./alizer/alizerWrapper.ts', function () { // ensure projects are cleaned up try { await Oc.Instance.deleteProject('my-test-project-1'); - } catch (_e) { + } catch (_) { // do nothing } try { await Oc.Instance.deleteProject('my-test-project-2'); - } catch (_e) { + } catch (_) { // do nothing } From 265507db6b36fe4f1bce612ef103869decf6808e Mon Sep 17 00:00:00 2001 From: msivasubramaniaan Date: Thu, 8 Aug 2024 21:52:21 +0530 Subject: [PATCH 07/15] fixed no-unused-vars error Signed-off-by: msivasubramaniaan --- .eslintrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.eslintrc b/.eslintrc index 9ef86a137..04b9a769f 100644 --- a/.eslintrc +++ b/.eslintrc @@ -108,7 +108,7 @@ "no-trailing-spaces": "error", "@typescript-eslint/prefer-regexp-exec": 0, "quotes": [ "error", "single"], - "@typescript-eslint/no-unused-vars": [ "error", { "vars": "local", "args": "none" }], + "@typescript-eslint/no-unused-vars": [ "error", { "vars": "local", "args": "none", "argsIgnorePattern": "^_" }], "@typescript-eslint/no-explicit-any": 1, "jsdoc/check-tag-names": "error", "jsdoc/check-param-names": ["error", { "checkDestructured": false }], From e42fd0c2a88b38437184dc3a654fd2300c208f0e Mon Sep 17 00:00:00 2001 From: msivasubramaniaan Date: Thu, 8 Aug 2024 22:01:30 +0530 Subject: [PATCH 08/15] fixed no-unused-vars error Signed-off-by: msivasubramaniaan --- .eslintrc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.eslintrc b/.eslintrc index 04b9a769f..2af1a4bbc 100644 --- a/.eslintrc +++ b/.eslintrc @@ -108,7 +108,7 @@ "no-trailing-spaces": "error", "@typescript-eslint/prefer-regexp-exec": 0, "quotes": [ "error", "single"], - "@typescript-eslint/no-unused-vars": [ "error", { "vars": "local", "args": "none", "argsIgnorePattern": "^_" }], + "@typescript-eslint/no-unused-vars": [ "error", { "vars": "local", "args": "none" }], "@typescript-eslint/no-explicit-any": 1, "jsdoc/check-tag-names": "error", "jsdoc/check-param-names": ["error", { "checkDestructured": false }], @@ -126,7 +126,8 @@ "no-unused-expressions": "off", "@typescript-eslint/unbound-method" : "off", "max-nested-callbacks" : "off", - "@typescript-eslint/no-unsafe-assignment": 1 + "@typescript-eslint/no-unsafe-assignment": 1, + "@typescript-eslint/no-unused-vars": [ "error", { "vars": "local", "args": "none", "argsIgnorePattern": "^_" }], } }, { From 3be7b536da091295f621cd0d209f0ca056d1894c Mon Sep 17 00:00:00 2001 From: msivasubramaniaan Date: Thu, 8 Aug 2024 22:07:32 +0530 Subject: [PATCH 09/15] fixed no-unused-vars error Signed-off-by: msivasubramaniaan --- .eslintrc | 2 +- test/integration/alizerWrapper.test.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.eslintrc b/.eslintrc index 2af1a4bbc..b9142d171 100644 --- a/.eslintrc +++ b/.eslintrc @@ -127,7 +127,7 @@ "@typescript-eslint/unbound-method" : "off", "max-nested-callbacks" : "off", "@typescript-eslint/no-unsafe-assignment": 1, - "@typescript-eslint/no-unused-vars": [ "error", { "vars": "local", "args": "none", "argsIgnorePattern": "^_" }], + "no-unused-vars": "off" } }, { diff --git a/test/integration/alizerWrapper.test.ts b/test/integration/alizerWrapper.test.ts index 751524b4e..c6b3ee961 100644 --- a/test/integration/alizerWrapper.test.ts +++ b/test/integration/alizerWrapper.test.ts @@ -24,7 +24,7 @@ suite('./alizer/alizerWrapper.ts', function () { if (isOpenShift) { try { await LoginUtil.Instance.logout(); - } catch (_) { + } catch (_e) { // do nothing } await Oc.Instance.loginWithUsernamePassword(clusterUrl, username, password); @@ -35,12 +35,12 @@ suite('./alizer/alizerWrapper.ts', function () { // ensure projects are cleaned up try { await Oc.Instance.deleteProject('my-test-project-1'); - } catch (_) { + } catch (_e) { // do nothing } try { await Oc.Instance.deleteProject('my-test-project-2'); - } catch (_) { + } catch (_e) { // do nothing } From c614dd580d7cfd11e263d32600dc4d56b180473f Mon Sep 17 00:00:00 2001 From: msivasubramaniaan Date: Thu, 8 Aug 2024 22:09:06 +0530 Subject: [PATCH 10/15] fixed no-unused-vars error Signed-off-by: msivasubramaniaan --- .eslintrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.eslintrc b/.eslintrc index b9142d171..15ee88be2 100644 --- a/.eslintrc +++ b/.eslintrc @@ -127,7 +127,7 @@ "@typescript-eslint/unbound-method" : "off", "max-nested-callbacks" : "off", "@typescript-eslint/no-unsafe-assignment": 1, - "no-unused-vars": "off" + "@typescript-eslint/no-unused-vars": "off" } }, { From 6a3ca0bc7fc325804dc32d66b3aac8b074c591a7 Mon Sep 17 00:00:00 2001 From: msivasubramaniaan Date: Thu, 8 Aug 2024 22:20:42 +0530 Subject: [PATCH 11/15] fixed test case fails Signed-off-by: msivasubramaniaan --- .eslintrc | 3 +-- test/integration/alizerWrapper.test.ts | 29 +++++++++++++++++++++----- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/.eslintrc b/.eslintrc index 15ee88be2..9ef86a137 100644 --- a/.eslintrc +++ b/.eslintrc @@ -126,8 +126,7 @@ "no-unused-expressions": "off", "@typescript-eslint/unbound-method" : "off", "max-nested-callbacks" : "off", - "@typescript-eslint/no-unsafe-assignment": 1, - "@typescript-eslint/no-unused-vars": "off" + "@typescript-eslint/no-unsafe-assignment": 1 } }, { diff --git a/test/integration/alizerWrapper.test.ts b/test/integration/alizerWrapper.test.ts index c6b3ee961..e729d76ba 100644 --- a/test/integration/alizerWrapper.test.ts +++ b/test/integration/alizerWrapper.test.ts @@ -2,11 +2,12 @@ * Copyright (c) Red Hat, Inc. All rights reserved. * Licensed under the MIT License. See LICENSE file in the project root for license information. *-----------------------------------------------------------------------------------------------*/ - +import { fail } from 'assert'; import { expect } from 'chai'; import * as fs from 'fs/promises'; import { suite, suiteSetup } from 'mocha'; import * as tmp from 'tmp'; +import * as path from 'path'; import { promisify } from 'util'; import { Uri, workspace } from 'vscode'; import { Oc } from '../../src/oc/ocWrapper'; @@ -24,7 +25,7 @@ suite('./alizer/alizerWrapper.ts', function () { if (isOpenShift) { try { await LoginUtil.Instance.logout(); - } catch (_e) { + } catch { // do nothing } await Oc.Instance.loginWithUsernamePassword(clusterUrl, username, password); @@ -35,12 +36,12 @@ suite('./alizer/alizerWrapper.ts', function () { // ensure projects are cleaned up try { await Oc.Instance.deleteProject('my-test-project-1'); - } catch (_e) { + } catch { // do nothing } try { await Oc.Instance.deleteProject('my-test-project-2'); - } catch (_e) { + } catch { // do nothing } @@ -113,12 +114,30 @@ suite('./alizer/alizerWrapper.ts', function () { await fs.rm(tmpFolder, { recursive: true, force: true }); }); + test('createComponentFromTemplateProject()', async function() { + await Odo.Instance.createComponentFromTemplateProject(tmpFolder, 'my-component', 8080, COMPONENT_TYPE, 'DefaultDevfileRegistry', 'dotnet50-example'); + try { + await fs.access(path.join(tmpFolder, 'devfile.yaml')); + } catch { + fail('Expected devfile to be created'); + } + }); + test('analyze()', async function() { const analysis = await Alizer.Instance.alizerAnalyze(Uri.file(tmpFolder)); expect(analysis.Name).to.equal(COMPONENT_TYPE); }); + test('deleteComponentConfiguration()', async function() { + await Odo.Instance.deleteComponentConfiguration(tmpFolder); + try { + await fs.access(path.join(tmpFolder, 'devfile.yaml')); + fail('devfile.yaml should have been deleted') + } catch { + // deleted successfully + } + }); + }); - test('deleteComponentConfiguration'); }); From e105c2d38d72449af5df3efd118fddd1e5a2c05c Mon Sep 17 00:00:00 2001 From: msivasubramaniaan Date: Tue, 13 Aug 2024 15:56:20 +0530 Subject: [PATCH 12/15] added deleteComponentConfiguration Signed-off-by: msivasubramaniaan --- test/integration/alizerWrapper.test.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/test/integration/alizerWrapper.test.ts b/test/integration/alizerWrapper.test.ts index e729d76ba..0cdf2f262 100644 --- a/test/integration/alizerWrapper.test.ts +++ b/test/integration/alizerWrapper.test.ts @@ -140,4 +140,5 @@ suite('./alizer/alizerWrapper.ts', function () { }); + test('deleteComponentConfiguration'); }); From ddbb56b7bf56297345b12dcfc2aa2cb121220a8b Mon Sep 17 00:00:00 2001 From: msivasubramaniaan Date: Tue, 13 Aug 2024 16:22:12 +0530 Subject: [PATCH 13/15] fixed mapping component description Signed-off-by: msivasubramaniaan --- src/webview/create-component/createComponentLoader.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/webview/create-component/createComponentLoader.ts b/src/webview/create-component/createComponentLoader.ts index f62e62b85..a9afb2c5f 100644 --- a/src/webview/create-component/createComponentLoader.ts +++ b/src/webview/create-component/createComponentLoader.ts @@ -591,8 +591,10 @@ async function getCompDescription(devfile: AlizerAnalyzeResponse): Promise { - devfile.Name === name; - devfile.Versions[0].Version === version + if (devfile.Name === name && devfile.Versions[0].Version === version) { + return true; + } + return false; } ); } From c82fa226c14a9db2725fca65e31c7f45f8351081 Mon Sep 17 00:00:00 2001 From: msivasubramaniaan Date: Fri, 16 Aug 2024 14:28:46 +0530 Subject: [PATCH 14/15] addressed review comments Signed-off-by: msivasubramaniaan --- src/alizer/types.ts | 3 +-- .../create-component/createComponentLoader.ts | 18 +++++++++++++----- test/integration/alizerWrapper.test.ts | 1 - 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/alizer/types.ts b/src/alizer/types.ts index 56e218c84..2002cfd37 100644 --- a/src/alizer/types.ts +++ b/src/alizer/types.ts @@ -3,8 +3,7 @@ * Licensed under the MIT License. See LICENSE file in the project root for license information. *-----------------------------------------------------------------------------------------------*/ - -interface Version { +export interface Version { SchemaVersion: number; Default: boolean; Version: string; diff --git a/src/webview/create-component/createComponentLoader.ts b/src/webview/create-component/createComponentLoader.ts index 4a7216401..a775d735c 100644 --- a/src/webview/create-component/createComponentLoader.ts +++ b/src/webview/create-component/createComponentLoader.ts @@ -30,7 +30,7 @@ import { } from '../common-ext/createComponentHelpers'; import { loadWebviewHtml, validateGitURL } from '../common-ext/utils'; import { Devfile, DevfileRegistry, TemplateProjectIdentifier } from '../common/devfile'; -import { AlizerAnalyzeResponse } from '../../alizer/types'; +import { AlizerAnalyzeResponse, Version } from '../../alizer/types'; import { Alizer } from '../../alizer/alizerWrapper'; interface CloneProcess { @@ -594,11 +594,19 @@ async function getCompDescription(devfile: AlizerAnalyzeResponse): Promise { - if (devfile.Name === name && devfile.Versions[0].Version === version) { - return true; + return Array.from(compDescriptions).filter((compDesc) => { + if (devfile.Name === compDesc.name && getVersion(devfile.Versions, compDesc.version)) { + return compDesc; + } + } + ); +} + +function getVersion(devfileVersions: Version[], matchedVersion: string): Version { + return devfileVersions.find((devfileVersion) => { + if (devfileVersion.Version === matchedVersion) { + return devfileVersion; } - return false; } ); } diff --git a/test/integration/alizerWrapper.test.ts b/test/integration/alizerWrapper.test.ts index 0cdf2f262..e729d76ba 100644 --- a/test/integration/alizerWrapper.test.ts +++ b/test/integration/alizerWrapper.test.ts @@ -140,5 +140,4 @@ suite('./alizer/alizerWrapper.ts', function () { }); - test('deleteComponentConfiguration'); }); From 7b2a13b77906b3565af31ab033f4f2dc22d07645 Mon Sep 17 00:00:00 2001 From: msivasubramaniaan Date: Fri, 16 Aug 2024 14:30:17 +0530 Subject: [PATCH 15/15] addressed review comments Signed-off-by: msivasubramaniaan --- test/integration/alizerWrapper.test.ts | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/test/integration/alizerWrapper.test.ts b/test/integration/alizerWrapper.test.ts index e729d76ba..900acf9e4 100644 --- a/test/integration/alizerWrapper.test.ts +++ b/test/integration/alizerWrapper.test.ts @@ -128,16 +128,7 @@ suite('./alizer/alizerWrapper.ts', function () { expect(analysis.Name).to.equal(COMPONENT_TYPE); }); - test('deleteComponentConfiguration()', async function() { - await Odo.Instance.deleteComponentConfiguration(tmpFolder); - try { - await fs.access(path.join(tmpFolder, 'devfile.yaml')); - fail('devfile.yaml should have been deleted') - } catch { - // deleted successfully - } - }); - }); + test('deleteComponentConfiguration'); });