Skip to content

Commit

Permalink
Bump CLI to 230, use verbose deploy (#1390)
Browse files Browse the repository at this point in the history
## Changes
Bump CLI to 230, use verbose deploy, regenerate the schema

Note: new schema generator doesn't produce stable result, hence the huge
amount of changed lines


## Tests
Existing tests + manually for the CLI auth
  • Loading branch information
ilia-db authored Oct 14, 2024
1 parent 96aaa71 commit ca13f5e
Show file tree
Hide file tree
Showing 7 changed files with 4,573 additions and 3,255 deletions.
2 changes: 1 addition & 1 deletion packages/databricks-vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -897,7 +897,7 @@
"useYarn": false
},
"cli": {
"version": "0.228.1"
"version": "0.230.0"
},
"scripts": {
"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",
Expand Down
7,789 changes: 4,541 additions & 3,248 deletions packages/databricks-vscode/src/bundle/BundleSchema.ts

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ export class BundleValidateModel extends BaseModelWithStateCache<BundleValidateS
) as BundleTarget;

return {
clusterId: validateOutput?.bundle?.compute_id,
clusterId:
validateOutput?.bundle?.compute_id ??
validateOutput?.bundle?.cluster_id,
remoteRootPath: validateOutput?.workspace?.file_path,
...validateOutput,
};
Expand Down
1 change: 1 addition & 0 deletions packages/databricks-vscode/src/cli/CliWrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,7 @@ export class CliWrapper {
"deploy",
"--target",
target,
"--verbose",
...(force ? ["--force-lock"] : []),
],
workspaceFolder,
Expand Down
5 changes: 3 additions & 2 deletions packages/databricks-vscode/src/test/e2e/run_files.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ describe("Run files", async function () {

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

it("should run a python file on a cluster", async () => {
Expand All @@ -54,7 +57,6 @@ describe("Run files", async function () {
.openDebugConsoleView();

while (true) {
await dismissNotifications();
await sleep(2000);
const text = await (await debugOutput.elem).getHTML();
if (text && text.includes("hello world")) {
Expand All @@ -66,7 +68,6 @@ describe("Run files", async function () {
it("should run a python file as a workflow", async () => {
const workbench = await driver.getWorkbench();
await workbench.executeQuickPick("Databricks: Run File as Workflow");
await dismissNotifications();
await waitForWorkflowWebview("hello world");
});
});
9 changes: 7 additions & 2 deletions packages/databricks-vscode/src/test/e2e/run_notebooks.e2e.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import path from "node:path";
import * as fs from "fs/promises";
import assert from "node:assert";
import {sleep} from "wdio-vscode-service";
import {
dismissNotifications,
openFile,
Expand Down Expand Up @@ -73,17 +74,21 @@ describe("Run notebooks", async function () {

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

it("should run a notebook.ipynb file as a workflow", async () => {
await openFile("notebook.ipynb");
// We enable the run command when the active editor is changed.
// We wait here to avoid race conditions between the extension logic enabling this command and tests executing it.
await sleep(1000);
const workbench = await driver.getWorkbench();
await workbench.executeQuickPick("Databricks: Run File as Workflow");
await dismissNotifications();
await waitForWorkflowWebview("hello world");
});
});
18 changes: 17 additions & 1 deletion packages/databricks-vscode/src/test/e2e/utils/commonUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,23 @@ export function getUniqueResourceName(name?: string) {

export async function waitForWorkflowWebview(expectedOutput: string) {
const workbench = await browser.getWorkbench();
const webView = await workbench.getWebviewByTitle(/Databricks Job Run/);
const title = /Databricks Job Run/;
await browser.waitUntil(
async () => {
try {
const webView = await workbench.getWebviewByTitle(title);
return webView !== undefined;
} catch (e) {
return false;
}
},
{
timeout: 5_000,
interval: 1_000,
timeoutMsg: "Webview did not open",
}
);
const webView = await workbench.getWebviewByTitle(title);
await webView.open();

await browser.waitUntil(
Expand Down

0 comments on commit ca13f5e

Please sign in to comment.