Skip to content

Commit 05114fa

Browse files
authored
Update the CLI to v0.231.0 (#1407)
## Changes Update the CLI to v0.231.0 Also improve stability of unit and integ tests ## Tests <!-- How is this tested? -->
1 parent 7bbb686 commit 05114fa

File tree

5 files changed

+21
-19
lines changed

5 files changed

+21
-19
lines changed

packages/databricks-vscode/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -907,7 +907,7 @@
907907
"useYarn": false
908908
},
909909
"cli": {
910-
"version": "0.230.0"
910+
"version": "0.231.0"
911911
},
912912
"scripts": {
913913
"vscode:prepublish": "rm -rf out && yarn run package:compile && yarn run package:wrappers:write && yarn run package:jupyter-init-script:write && yarn run package:copy-webview-toolkit && yarn run generate-telemetry",

packages/databricks-vscode/src/test/e2e/run_files.e2e.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import * as fs from "fs/promises";
33
import assert from "node:assert";
44
import {
55
dismissNotifications,
6+
executeCommandWhenAvailable,
67
openFile,
78
waitForLogin,
89
waitForWorkflowWebview,
@@ -43,14 +44,11 @@ describe("Run files", async function () {
4344

4445
beforeEach(async () => {
4546
await openFile("hello.py");
46-
// We enable the run command when the active editor is changed.
47-
// We wait here to avoid race conditions between the extension logic enabling this command and tests executing it.
48-
await sleep(1000);
4947
});
5048

5149
it("should run a python file on a cluster", async () => {
5250
const workbench = await driver.getWorkbench();
53-
await workbench.executeQuickPick("Databricks: Upload and Run File");
51+
await executeCommandWhenAvailable("Databricks: Upload and Run File");
5452

5553
const debugOutput = await workbench
5654
.getBottomBar()
@@ -67,7 +65,7 @@ describe("Run files", async function () {
6765

6866
it("should cancel a run during deployment", async () => {
6967
const workbench = await driver.getWorkbench();
70-
await workbench.executeQuickPick("Databricks: Upload and Run File");
68+
await executeCommandWhenAvailable("Databricks: Upload and Run File");
7169
await browser.waitUntil(async () => {
7270
const notifications = await workbench.getNotifications();
7371
for (const notification of notifications) {

packages/databricks-vscode/src/test/e2e/run_notebooks.e2e.ts

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import path from "node:path";
22
import * as fs from "fs/promises";
33
import assert from "node:assert";
4-
import {sleep} from "wdio-vscode-service";
54
import {
65
dismissNotifications,
6+
executeCommandWhenAvailable,
77
openFile,
88
waitForLogin,
99
waitForWorkflowWebview,
@@ -74,21 +74,13 @@ describe("Run notebooks", async function () {
7474

7575
it("should run a notebook.py file as a workflow", async () => {
7676
await openFile("notebook.py");
77-
// We enable the run command when the active editor is changed.
78-
// We wait here to avoid race conditions between the extension logic enabling this command and tests executing it.
79-
await sleep(1000);
80-
const workbench = await driver.getWorkbench();
81-
await workbench.executeQuickPick("Databricks: Run File as Workflow");
77+
await executeCommandWhenAvailable("Databricks: Run File as Workflow");
8278
await waitForWorkflowWebview("a/b c");
8379
});
8480

8581
it("should run a notebook.ipynb file as a workflow", async () => {
8682
await openFile("notebook.ipynb");
87-
// We enable the run command when the active editor is changed.
88-
// We wait here to avoid race conditions between the extension logic enabling this command and tests executing it.
89-
await sleep(1000);
90-
const workbench = await driver.getWorkbench();
91-
await workbench.executeQuickPick("Databricks: Run File as Workflow");
83+
await executeCommandWhenAvailable("Databricks: Run File as Workflow");
9284
await waitForWorkflowWebview("hello world");
9385
});
9486
});

packages/databricks-vscode/src/test/e2e/utils/commonUtils.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,3 +303,15 @@ export async function openFile(fileName: string) {
303303
return title.includes(fileName);
304304
});
305305
}
306+
307+
export async function executeCommandWhenAvailable(command: string) {
308+
const workbench = await driver.getWorkbench();
309+
return browser.waitUntil(async () => {
310+
try {
311+
await workbench.executeQuickPick(command);
312+
return true;
313+
} catch (e) {
314+
return false;
315+
}
316+
});
317+
}

packages/databricks-vscode/src/workspace-fs/WorkspaceFsWorkflowWrapper.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ describe(__filename, async () => {
236236
"dbutils.library.restartPython()",
237237
"print('hello2')",
238238
];
239-
writeFile(
239+
await writeFile(
240240
localFilePath.path,
241241
comment.concat(data).join("\n"),
242242
"utf-8"
@@ -443,7 +443,7 @@ describe(__filename, async () => {
443443
},
444444
],
445445
};
446-
writeFile(
446+
await writeFile(
447447
localFilePath.path,
448448
JSON.stringify(originalData),
449449
"utf-8"

0 commit comments

Comments
 (0)