-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathdeploy_and_run_job.e2e.ts
More file actions
93 lines (81 loc) · 2.77 KB
/
Copy pathdeploy_and_run_job.e2e.ts
File metadata and controls
93 lines (81 loc) · 2.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
import assert from "node:assert";
import {
dismissNotifications,
getUniqueResourceName,
getViewSection,
waitForDeployment,
waitForLogin,
waitForTreeItems,
} from "./utils/commonUtils.ts";
import {CustomTreeSection, Workbench} from "wdio-vscode-service";
import {createProjectWithJob} from "./utils/dabsFixtures.ts";
import {
getResourceViewItem,
waitForRunStatus,
} from "./utils/dabsExplorerUtils.ts";
describe("Deploy and run job", async function () {
let workbench: Workbench;
let resourceExplorerView: CustomTreeSection;
let jobName: string;
this.timeout(3 * 60 * 1000);
before(async function () {
assert(
process.env.TEST_DEFAULT_CLUSTER_ID,
"TEST_DEFAULT_CLUSTER_ID env var doesn't exist"
);
assert(
process.env.WORKSPACE_PATH,
"WORKSPACE_PATH env var doesn't exist"
);
assert(
process.env.DATABRICKS_HOST,
"DATABRICKS_HOST env var doesn't exist"
);
workbench = await browser.getWorkbench();
jobName = (
await createProjectWithJob(
getUniqueResourceName("deploy_and_run_job"),
process.env.WORKSPACE_PATH,
process.env.TEST_DEFAULT_CLUSTER_ID
)
).name!;
await dismissNotifications();
});
it("should wait for extension activation", async () => {
const section = await getViewSection("CONFIGURATION");
assert(section);
});
it("should wait for connection", async () => {
await waitForLogin("DEFAULT");
await dismissNotifications();
});
it("should find resource explorer view", async function () {
const section = await getViewSection("BUNDLE RESOURCE EXPLORER");
assert(section);
await waitForTreeItems(section, 20_000);
resourceExplorerView = section as CustomTreeSection;
});
it("should deploy and run the current job", async () => {
const outputView = await workbench.getBottomBar().openOutputView();
await outputView.selectChannel("Databricks Bundle Logs");
await outputView.clearText();
const jobItem = await getResourceViewItem(
resourceExplorerView,
"Jobs",
jobName
);
assert(jobItem, `Job ${jobName} not found in resource explorer`);
const deployAndRunButton = await jobItem.getActionButton(
"Deploy the bundle and run the job"
);
assert(deployAndRunButton, "Deploy and run button not found");
await deployAndRunButton.elem.click();
await waitForDeployment();
await waitForRunStatus(
resourceExplorerView,
"Jobs",
jobName,
"Success"
);
});
});