Skip to content

Commit

Permalink
fix errors found in e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Philip-Carneiro committed Oct 11, 2024
1 parent 0c222ac commit db2696b
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 26 deletions.
50 changes: 26 additions & 24 deletions src/classes/insightsConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -358,30 +358,32 @@ export class InsightsConnection {

progress.report({ message: "Populating scratchpad..." });

const scratchpadResponse = await axios.post(
scratchpadURL.toString(),
body,
headers,
);

kdbOutputLog(
`Executed successfully, stored in ${variableName}.`,
"INFO",
);
kdbOutputLog(
`[SCRATCHPAD] Status: ${scratchpadResponse.status}`,
"INFO",
);
kdbOutputLog(
`[SCRATCHPAD] Populated scratchpad with the following params: ${JSON.stringify(body.params)}`,
"INFO",
);
window.showInformationMessage(
`Executed successfully, stored in ${variableName}.`,
);
Telemetry.sendEvent(
"Datasource." + dsTypeString + ".Scratchpad.Populated",
);
const scratchpadResponse = await axios
.post(scratchpadURL.toString(), body, headers)
.then((response: any) => {
if (response.data.error) {
kdbOutputLog(
`[SCRATCHPAD] Error occured while populating scratchpad: ${response.data.errorMsg}`,
"ERROR",
);
} else {
kdbOutputLog(
`Executed successfully, stored in ${variableName}.`,
"INFO",
);
kdbOutputLog(`[SCRATCHPAD] Status: ${response.status}`, "INFO");
kdbOutputLog(
`[SCRATCHPAD] Populated scratchpad with the following params: ${JSON.stringify(body.params)}`,
"INFO",
);
window.showInformationMessage(
`Executed successfully, stored in ${variableName}.`,
);
Telemetry.sendEvent(
"Datasource." + dsTypeString + ".Scratchpad.Populated",
);
}
});

const p = new Promise<void>((resolve) => resolve());
return p;
Expand Down
3 changes: 3 additions & 0 deletions src/utils/connLabel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ export function removeConnFromLabels(connName: string) {
);
}
});
workspace
.getConfiguration()
.update("kdb.labelsConnectionMap", ext.labelConnMapList, true);
}

export async function handleLabelsConnMap(labels: string[], connName: string) {
Expand Down
3 changes: 2 additions & 1 deletion src/utils/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ export async function checkOpenSslInstalled(): Promise<string | null> {
return semver.clean(installedVersion ? installedVersion[1] : "");
}
} catch (err) {
kdbOutputLog(`Error in checking OpenSSL version: ${err}`, "ERROR");
// Disabled the error, as it is not critical
// kdbOutputLog(`Error in checking OpenSSL version: ${err}`, "ERROR");
Telemetry.sendException(err as Error);
}
return null;
Expand Down
2 changes: 1 addition & 1 deletion src/webview/components/kdbNewConnectionView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -941,7 +941,7 @@ export class KdbNewConnectionView extends LitElement {
},
});
setTimeout(() => {
this.labels[0] = this.newLblName;
this.labels.unshift(this.newLblName);
this.closeModal();
}, 500);
}
Expand Down
4 changes: 4 additions & 0 deletions test/suite/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1710,6 +1710,10 @@ describe("Utils", () => {
labelName: "label1",
connections: ["conn1", "conn2"],
});
getConfigurationStub.returns({
get: sinon.stub(),
update: sinon.stub(),
});

LabelsUtils.removeConnFromLabels("conn1");

Expand Down

0 comments on commit db2696b

Please sign in to comment.