From afb42339a187e228271e19901c8f032ee955d1dc Mon Sep 17 00:00:00 2001 From: JoshwinThomasIBM Date: Tue, 15 Oct 2024 15:16:04 +0530 Subject: [PATCH 1/3] Fixes for report being created in a new location --- src/liberty/devCommands.ts | 59 +++++++++++++++++++++-------- src/test/MavenTestDevModeActions.ts | 18 ++++++--- 2 files changed, 56 insertions(+), 21 deletions(-) diff --git a/src/liberty/devCommands.ts b/src/liberty/devCommands.ts index 456fbea9..c76740be 100644 --- a/src/liberty/devCommands.ts +++ b/src/liberty/devCommands.ts @@ -490,7 +490,8 @@ export async function openReport(reportType: string, libProject?: LibertyProject if (path !== undefined) { let report: any; if (libProject.getContextValue() === LIBERTY_MAVEN_PROJECT || libProject.getContextValue() === LIBERTY_MAVEN_PROJECT_CONTAINER) { - report = Path.join(path, "target", "site", reportType + "-report.html"); + //report = Path.join(path, "target", "site", reportType + "-report.html"); + report = getReportFile(path,"reports",reportType+".html"); } else if (libProject.getContextValue() === LIBERTY_GRADLE_PROJECT || libProject.getContextValue() === LIBERTY_GRADLE_PROJECT_CONTAINER) { report = await getGradleTestReport(libProject.path, path); } @@ -498,20 +499,20 @@ export async function openReport(reportType: string, libProject?: LibertyProject if (reportType === "gradle") { reportTypeLabel = "test"; } - fs.exists(report, (exists) => { - if (exists) { - const panel = vscode.window.createWebviewPanel( - reportType, // Identifies the type of the webview. Used internally - libProject.getLabel() + " " + reportTypeLabel + " report", // Title of the panel displayed to the user - vscode.ViewColumn.Two, // Open the panel in the second window - {}, // Webview options - ); - panel.webview.html = getReport(report); // display HTML content - } else { - const message = localize("test.report.does.not.exist.run.test.first", report); - vscode.window.showInformationMessage(message); + if(libProject.getContextValue() === LIBERTY_MAVEN_PROJECT || libProject.getContextValue() === LIBERTY_MAVEN_PROJECT_CONTAINER){ + console.log("report path ::"+report) + if(!await checkReportExists(report,reportType,reportTypeLabel,libProject)){ + report = getReportFile(path,"site",reportType+"-report.html"); + if(!await checkReportExists(report,reportType,reportTypeLabel,libProject)){ + const message = localize("test.report.does.not.exist.run.test.first", report); + vscode.window.showInformationMessage(message); + } } - }); + }else if(!await checkReportExists(report,reportType,reportTypeLabel,libProject)){ + const message = localize("test.report.does.not.exist.run.test.first", report); + vscode.window.showInformationMessage(message); + } + } } else if (ProjectProvider.getInstance() && reportType) { showProjects(reportType, openReport, reportType); @@ -610,4 +611,32 @@ async function getLocalGradleWrapper(projectFolder: string): Promise { + return new Promise((resolve) => { + fs.exists(report, (exists) => { + if(exists){ + const panel = vscode.window.createWebviewPanel( + reportType, // Identifies the type of the webview. Used internally + libProject.getLabel() + " " + reportTypeLabel + " report", // Title of the panel displayed to the user + vscode.ViewColumn.Two, // Open the panel in the second window + {}, // Webview options + ); + panel.webview.html = getReport(report); // display HTML content + } + console.log("report available::"+exists); + resolve(exists); + }); + }); + } \ No newline at end of file diff --git a/src/test/MavenTestDevModeActions.ts b/src/test/MavenTestDevModeActions.ts index 8cb326ff..992be9bb 100755 --- a/src/test/MavenTestDevModeActions.ts +++ b/src/test/MavenTestDevModeActions.ts @@ -97,8 +97,10 @@ it('Run tests for sample maven project', async () => { it('start maven with options from liberty dashboard', async () => { const reportPath = path.join(utils.getMvnProjectPath(),"target","site","failsafe-report.html"); - const deleteReport = await utils.deleteReports(reportPath); - expect (deleteReport).to.be.true; + const reportPath35 = path.join(utils.getMvnProjectPath(),"target","reports","failsafe.html"); + let deleteReport = await utils.deleteReports(reportPath); + let deleteReport35 = await utils.deleteReports(reportPath35); + expect (deleteReport||deleteReport35).to.be.true; await utils.launchDashboardAction(item, constants.START_DASHBOARD_ACTION_WITH_PARAM, constants.START_DASHBOARD_MAC_ACTION_WITH_PARAM); await utils.setCustomParameter("-DhotTests=true"); await utils.delay(30000); @@ -109,7 +111,8 @@ it('start maven with options from liberty dashboard', async () => { { console.log("Server succuessfully started"); let checkFile = await utils.checkIfTestReportExists(reportPath); - expect (checkFile).to.be.true; + let checkFile35 = await utils.checkIfTestReportExists(reportPath35); + expect (checkFile || checkFile35).to.be.true; await utils.launchDashboardAction(item, constants.STOP_DASHBOARD_ACTION, constants.STOP_DASHBOARD_MAC_ACTION); const serverStopStatus= await utils.checkTerminalforServerState(constants.SERVER_STOP_STRING); if(!serverStopStatus){ @@ -127,8 +130,10 @@ it('start maven with options from liberty dashboard', async () => { it('start maven with history from liberty dashboard', async () => { const reportPath = path.join(utils.getMvnProjectPath(),"target","site","failsafe-report.html"); - const deleteReport = await utils.deleteReports(reportPath); - expect (deleteReport).to.be.true; + const reportPath35 = path.join(utils.getMvnProjectPath(),"target","reports","failsafe.html"); + let deleteReport = await utils.deleteReports(reportPath); + let deleteReport35 = await utils.deleteReports(reportPath35); + expect (deleteReport || deleteReport35).to.be.true; await utils.launchDashboardAction(item, constants.START_DASHBOARD_ACTION_WITH_PARAM, constants.START_DASHBOARD_MAC_ACTION_WITH_PARAM); const foundCommand = await utils.chooseCmdFromHistory("-DhotTests=true"); expect (foundCommand).to.be.true; @@ -140,7 +145,8 @@ it('start maven with history from liberty dashboard', async () => { { console.log("Server succuessfully started"); let checkFile = await utils.checkIfTestReportExists(reportPath); - expect (checkFile).to.be.true; + let checkFile35 = await utils.checkIfTestReportExists(reportPath35); + expect (checkFile || checkFile35).to.be.true; await utils.launchDashboardAction(item, constants.STOP_DASHBOARD_ACTION, constants.STOP_DASHBOARD_MAC_ACTION); const serverStopStatus= await utils.checkTerminalforServerState(constants.SERVER_STOP_STRING); if(!serverStopStatus){ From 5e4a4b568c42905a233266fdd9d9ed8be385c9a9 Mon Sep 17 00:00:00 2001 From: JoshwinThomasIBM Date: Fri, 18 Oct 2024 12:15:02 +0530 Subject: [PATCH 2/3] updated LCLS version to 2.2 snapshot --- gulpfile.js | 4 ++-- package.json | 2 +- src/extension.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index e34d7103..bca970d5 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -3,10 +3,10 @@ const download = require("gulp-download2"); const cp = require("child_process"); const libertyGroupId = "io.openliberty.tools"; -const libertyVersion = "2.1.1"; +const libertyVersion = "2.2-SNAPSHOT"; const jakartaGroupId = "org.eclipse.lsp4jakarta"; const jakartaVersion = "0.2.1"; -var releaseLevel = "releases"; //"snapshots"; //snapshots or releases +var releaseLevel = "snapshots"; //"snapshots"; //snapshots or releases const libertyLemminxName = "liberty-langserver-lemminx-" + libertyVersion + "-jar-with-dependencies.jar"; const libertyLemminxDir = "../liberty-language-server/lemminx-liberty"; diff --git a/package.json b/package.json index 803f7752..b27879ef 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "./jars/org.eclipse.lsp4jakarta.jdt.core-0.2.1.jar" ], "xml.javaExtensions": [ - "./jars/liberty-langserver-lemminx-2.1.1-jar-with-dependencies.jar" + "./jars/liberty-langserver-lemminx-2.2-SNAPSHOT-jar-with-dependencies.jar" ], "views": { "explorer": [ diff --git a/src/extension.ts b/src/extension.ts index 2d6a189b..a61d5290 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -22,7 +22,7 @@ import { prepareExecutable } from "./util/javaServerStarter"; const LIBERTY_CLIENT_ID = "LANGUAGE_ID_LIBERTY"; const JAKARTA_CLIENT_ID = "LANGUAGE_ID_JAKARTA"; -export const LIBERTY_LS_JAR = "liberty-langserver-2.1.1-jar-with-dependencies.jar"; +export const LIBERTY_LS_JAR = "liberty-langserver-2.2-SNAPSHOT-jar-with-dependencies.jar"; export const JAKARTA_LS_JAR = "org.eclipse.lsp4jakarta.ls-0.2.1-jar-with-dependencies.jar"; let libertyClient: LanguageClient; From 4b15e1020ac4c3f0e776f8d6b26a065adcdc69ab Mon Sep 17 00:00:00 2001 From: JoshwinThomasIBM Date: Mon, 28 Oct 2024 09:07:53 +0530 Subject: [PATCH 3/3] updated LCLS version to 2.2 releases --- gulpfile.js | 4 ++-- package.json | 2 +- src/extension.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index bca970d5..e7192498 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -3,10 +3,10 @@ const download = require("gulp-download2"); const cp = require("child_process"); const libertyGroupId = "io.openliberty.tools"; -const libertyVersion = "2.2-SNAPSHOT"; +const libertyVersion = "2.2"; const jakartaGroupId = "org.eclipse.lsp4jakarta"; const jakartaVersion = "0.2.1"; -var releaseLevel = "snapshots"; //"snapshots"; //snapshots or releases +var releaseLevel = "releases"; //"snapshots"; //snapshots or releases const libertyLemminxName = "liberty-langserver-lemminx-" + libertyVersion + "-jar-with-dependencies.jar"; const libertyLemminxDir = "../liberty-language-server/lemminx-liberty"; diff --git a/package.json b/package.json index b27879ef..076d9d02 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "./jars/org.eclipse.lsp4jakarta.jdt.core-0.2.1.jar" ], "xml.javaExtensions": [ - "./jars/liberty-langserver-lemminx-2.2-SNAPSHOT-jar-with-dependencies.jar" + "./jars/liberty-langserver-lemminx-2.2-jar-with-dependencies.jar" ], "views": { "explorer": [ diff --git a/src/extension.ts b/src/extension.ts index a61d5290..a609f5f9 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -22,7 +22,7 @@ import { prepareExecutable } from "./util/javaServerStarter"; const LIBERTY_CLIENT_ID = "LANGUAGE_ID_LIBERTY"; const JAKARTA_CLIENT_ID = "LANGUAGE_ID_JAKARTA"; -export const LIBERTY_LS_JAR = "liberty-langserver-2.2-SNAPSHOT-jar-with-dependencies.jar"; +export const LIBERTY_LS_JAR = "liberty-langserver-2.2-jar-with-dependencies.jar"; export const JAKARTA_LS_JAR = "org.eclipse.lsp4jakarta.ls-0.2.1-jar-with-dependencies.jar"; let libertyClient: LanguageClient;