Skip to content

Commit

Permalink
added more comments to the newly added parts
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshwinThomasIBM authored and JoshwinThomasIBM committed Oct 30, 2024
1 parent 673ac0c commit e15319f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
11 changes: 11 additions & 0 deletions src/liberty/devCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,10 @@ export async function openReport(reportType: string, libProject?: LibertyProject
if (reportType === "gradle") {
reportTypeLabel = "test";
}
/*
if its a maven project, check for the report in the initial path , else try for the alternate one and if it doesnt exist in both
display a prompt for its non existance
*/
if(libProject.getContextValue() === LIBERTY_MAVEN_PROJECT || libProject.getContextValue() === LIBERTY_MAVEN_PROJECT_CONTAINER){
console.log("report path ::"+report)
if(!await checkReportAndDisplay(report,reportType,reportTypeLabel,libProject)){
Expand All @@ -507,6 +511,9 @@ export async function openReport(reportType: string, libProject?: LibertyProject
vscode.window.showInformationMessage(message);
}
}
/*
if its a gralde project, then check existance for the report in the path set and if not display prompt for its non existance
*/
}else if(!await checkReportAndDisplay(report,reportType,reportTypeLabel,libProject)){
const message = localize("test.report.does.not.exist.run.test.first", report);
vscode.window.showInformationMessage(message);
Expand Down Expand Up @@ -612,6 +619,10 @@ function isWin(): boolean {
return process.platform.startsWith("win");
}

/*
will return the path of the report, since there are diffrent folders to look into and the file names can be different
we need to get the paths to look for dynamically
*/
function getReportFile(path :any,dir :string,filename:string):any{
return Path.join(path,"target",dir, filename);
}
Expand Down
4 changes: 2 additions & 2 deletions src/test/MavenTestDevModeActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,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 alternateReportPath = path.join(utils.getMvnProjectPath(),"target","reports","failsafe.html");
const alternateReportPath = path.join(utils.getMvnProjectPath(),"target","reports","failsafe.html"); // new path to scan for the reports
let deleteReport = await utils.deleteReports(reportPath);
let deleteAlternateReport = await utils.deleteReports(alternateReportPath);
expect (deleteReport||deleteAlternateReport).to.be.true;
expect (deleteReport||deleteAlternateReport).to.be.true; // there should be a report available irrespective of the surefire versions we use , so either one needs 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);
Expand Down

0 comments on commit e15319f

Please sign in to comment.