Skip to content

Commit 1d5416d

Browse files
authored
Try to make the E2E tests more robust. (#414)
1 parent f993f37 commit 1d5416d

File tree

4 files changed

+20
-7
lines changed

4 files changed

+20
-7
lines changed

packages/databricks-vscode/src/configuration/SyncDestination.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,9 @@ export class SyncDestination {
141141
getRelativePath(path: Uri): string {
142142
if (path.scheme === "file") {
143143
if (!path.path.startsWith(this.vscodeWorkspacePath.path)) {
144-
throw new Error("local path is not within the workspace");
144+
throw new Error(
145+
`local path is not within the workspace. Expected ${path.path} to start with ${this.vscodeWorkspacePath.path}.`
146+
);
145147
}
146148
return path.path.replace(this.vscodeWorkspacePath.path, "");
147149
} else if (path.scheme === "wsfs") {
@@ -168,7 +170,9 @@ export class SyncDestination {
168170
localToRemote(localPath: Uri): string {
169171
assert.equal(localPath.scheme, "file");
170172
if (!localPath.path.startsWith(this.vscodeWorkspacePath.path)) {
171-
throw new Error("local path is not within the workspace");
173+
throw new Error(
174+
`local path is not within the workspace. Expected ${localPath.path} to start with ${this.vscodeWorkspacePath.path}.`
175+
);
172176
}
173177

174178
const relativePath = localPath.path.replace(

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

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,19 @@ describe("Configure Databricks Extension", async function () {
6262
assert(buttons.length > 0);
6363
await (await buttons[0].elem).click();
6464

65+
await sleep(500);
6566
let input = await new InputBox(workbench.locatorMap).wait();
66-
await sleep(200);
67+
while (await input.hasProgress()) {
68+
await sleep(500);
69+
}
6770

6871
await input.confirm();
69-
await sleep(200);
72+
await sleep(1000);
7073

7174
input = await new InputBox(workbench.locatorMap).wait();
72-
await sleep(200);
75+
while (await input.hasProgress()) {
76+
await sleep(500);
77+
}
7378

7479
await input.selectQuickPick("DEFAULT");
7580

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ describe("Run job on cluster", async function () {
2020
assert(process.env.WORKSPACE_PATH);
2121
projectDir = process.env.WORKSPACE_PATH;
2222

23-
await fs.mkdir(path.join(projectDir, ".databricks"));
23+
await fs.mkdir(path.join(projectDir, ".databricks"), {
24+
recursive: true,
25+
});
2426

2527
await fs.writeFile(
2628
path.join(projectDir, ".databricks", "project.json"),

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ describe("Run python on cluster", async function () {
2121
assert(process.env.WORKSPACE_PATH);
2222
projectDir = process.env.WORKSPACE_PATH;
2323

24-
await fs.mkdir(path.join(projectDir, ".databricks"));
24+
await fs.mkdir(path.join(projectDir, ".databricks"), {
25+
recursive: true,
26+
});
2527

2628
await fs.writeFile(
2729
path.join(projectDir, ".databricks", "project.json"),

0 commit comments

Comments
 (0)