Skip to content

Commit

Permalink
Merge branch 'main' into fix_timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
hectorcast-db authored Oct 18, 2024
2 parents 3755e57 + ad88558 commit f2cf574
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,13 @@ public String authType() {
}

public CliTokenSource tokenSourceFor(DatabricksConfig config, String resource) {
String azPath =
Optional.ofNullable(config.getEnv()).map(env -> env.get("AZ_PATH")).orElse("az");

List<String> cmd =
new ArrayList<>(
Arrays.asList(
"az", "account", "get-access-token", "--resource", resource, "--output", "json"));
azPath, "account", "get-access-token", "--resource", resource, "--output", "json"));
Optional<String> subscription = getSubscription(config);
if (subscription.isPresent()) {
// This will fail if the user has access to the workspace, but not to the subscription
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ void azureCliWorkspaceHeaderPresent() {
StaticEnv env =
new StaticEnv()
.with("HOME", TestOSUtils.resource("/testdata/azure"))
.with("PATH", "testdata:/bin");
.with("PATH", "/bin:testdata")
.with("AZ_PATH", TestOSUtils.resource("/testdata/az"));
String azureWorkspaceResourceId =
"/subscriptions/123/resourceGroups/abc/providers/Microsoft.Databricks/workspaces/abc123";
DatabricksConfig config =
Expand All @@ -32,7 +33,8 @@ void azureCliUserWithManagementAccess() {
StaticEnv env =
new StaticEnv()
.with("HOME", TestOSUtils.resource("/testdata/azure"))
.with("PATH", "testdata:/bin");
.with("PATH", "/bin:testdata")
.with("AZ_PATH", TestOSUtils.resource("/testdata/az"));
String azureWorkspaceResourceId =
"/subscriptions/123/resourceGroups/abc/providers/Microsoft.Databricks/workspaces/abc123";
DatabricksConfig config =
Expand All @@ -50,7 +52,8 @@ void azureCliUserNoManagementAccess() {
StaticEnv env =
new StaticEnv()
.with("HOME", TestOSUtils.resource("/testdata/azure"))
.with("PATH", "testdata:/bin")
.with("PATH", "/bin:testdata")
.with("AZ_PATH", TestOSUtils.resource("/testdata/az"))
.with("FAIL_IF", "https://management.core.windows.net/");
String azureWorkspaceResourceId =
"/subscriptions/123/resourceGroups/abc/providers/Microsoft.Databricks/workspaces/abc123";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@ public static String resource(String file) {
if (resource == null) {
fail("Asset not found: " + file);
}
return resource.getFile();

String filePath = resource.getFile();
File f = new File(filePath);

// Make the file executable
if (!f.setExecutable(true)) {
fail("Failed to set the file as executable: " + file);
}

return filePath;
}
}

0 comments on commit f2cf574

Please sign in to comment.