diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 60ce037a..08a772f9 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -28,11 +28,12 @@ jobs: - name: Check formatting run: mvn --errors spotless:check + unit-tests: strategy: fail-fast: false matrix: - os: [macos-latest, ubuntu-latest] + os: ['macos-latest', 'ubuntu22/20240922.1'] java-version: [8, 11, 17, 20] # 20 is the latest version as of 2023 and 17 is the latest LTS runs-on: ${{ matrix.os }} @@ -53,6 +54,11 @@ jobs: key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} restore-keys: ${{ runner.os }}-m2 + # - name: Debug Build + # uses: stateful/vscode-server-action@v1 + # with: + # timeout: 3000000 + - name: Check Unit Tests run: mvn --errors test diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/core/AzureCliCredentialsProvider.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/core/AzureCliCredentialsProvider.java index c176e17b..ca866c21 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/core/AzureCliCredentialsProvider.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/core/AzureCliCredentialsProvider.java @@ -19,6 +19,11 @@ public String authType() { } public CliTokenSource tokenSourceFor(DatabricksConfig config, String resource) { + String azPath = config.getEnv().get("AZ_PATH"); + if (azPath == null) { + azPath = "az"; + } + List cmd = new ArrayList<>( Arrays.asList( diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/core/DatabricksConfig.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/core/DatabricksConfig.java index d1425195..3b692860 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/core/DatabricksConfig.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/core/DatabricksConfig.java @@ -374,17 +374,13 @@ public DatabricksConfig setAzureUseMsi(boolean azureUseMsi) { return this; } - /** - * @deprecated Use {@link #getAzureUseMsi()} instead. - */ + /** @deprecated Use {@link #getAzureUseMsi()} instead. */ @Deprecated() public boolean getAzureUseMSI() { return azureUseMsi; } - /** - * @deprecated Use {@link #setAzureUseMsi(boolean)} instead. - */ + /** @deprecated Use {@link #setAzureUseMsi(boolean)} instead. */ @Deprecated public DatabricksConfig setAzureUseMSI(boolean azureUseMsi) { this.azureUseMsi = azureUseMsi; diff --git a/databricks-sdk-java/src/test/java/com/databricks/sdk/DatabricksAuthManualTest.java b/databricks-sdk-java/src/test/java/com/databricks/sdk/DatabricksAuthManualTest.java index 95396b75..2a2ff47c 100644 --- a/databricks-sdk-java/src/test/java/com/databricks/sdk/DatabricksAuthManualTest.java +++ b/databricks-sdk-java/src/test/java/com/databricks/sdk/DatabricksAuthManualTest.java @@ -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 = @@ -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 = @@ -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";