Skip to content

Commit

Permalink
considered AND operator for delete reports testing
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshwinThomasIBM authored and JoshwinThomasIBM committed Nov 20, 2024
1 parent 6b3d6eb commit 32ec1b2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
29 changes: 15 additions & 14 deletions src/liberty/devCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,17 +77,18 @@ export async function openProject(pomPath: string): Promise<void> {
export async function listAllCommands(): Promise<void> {
const libertyCommands = Array.from(COMMAND_TITLES.keys());
vscode.window.showQuickPick(libertyCommands).then(selection => {
if (!selection) {
return;
}
const command = COMMAND_TITLES.get(selection);
if (command !== undefined) {
vscode.commands.executeCommand(command);
} else {
// should never happen
console.error("Unable to find corresponding command for " + selection);
}

if (!selection) {
return;
}
const command = COMMAND_TITLES.get(selection);
if ( command !== undefined )
{
vscode.commands.executeCommand(command);
} else {
// should never happen
console.error("Unable to find corresponding command for " + selection);
}

});
}

Expand Down Expand Up @@ -192,11 +193,11 @@ export async function addProject(uri: vscode.Uri): Promise<void> {
// scan the folder and get a list of folders with pom.xml and build.gradle
const uris: string[] = await projectProvider.getListOfMavenAndGradleFolders(uri.fsPath);
console.log(JSON.stringify(uris));
if (uris.length > 0) {
if ( uris.length > 0) {
// present the list to add
showListOfPathsToAdd(uris);
}


} else {
// clicked on the empty space and workspace has more than one folders, or
Expand Down Expand Up @@ -398,7 +399,7 @@ export async function customDevMode(libProject?: LibertyProject | undefined, par
if (customCommand !== undefined) {
// save command
customCommand = customCommand.trim();
if (customCommand.length > 0) {
if ( customCommand.length > 0 ) {
const projectStartCmdParam: ProjectStartCmdParam = new ProjectStartCmdParam(libProject.getPath(), customCommand);
const projectProvider: ProjectProvider = ProjectProvider.getInstance();
const dashboardData: DashboardData = helperUtil.getStorageData(projectProvider.getContext());
Expand Down
4 changes: 2 additions & 2 deletions src/test/MavenTestDevModeActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ it('start maven with options from liberty dashboard', async () => {
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; // there should be a report available irrespective of the surefire versions we use , so either one needs 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 Expand Up @@ -135,7 +135,7 @@ it('start maven with history from liberty dashboard', async () => {
const alternateReportPath = path.join(utils.getMvnProjectPath(), "target", "reports", "failsafe.html");
let deleteReport = await utils.deleteReports(reportPath);
let deleteAlternateReport = await utils.deleteReports(alternateReportPath);
expect (deleteReport || deleteAlternateReport).to.be.true;
expect (deleteReport && deleteAlternateReport).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;
Expand Down

0 comments on commit 32ec1b2

Please sign in to comment.