From 9c0efb62124ba2ae9aa9da7de6d4391d6fdcff0e Mon Sep 17 00:00:00 2001 From: Shreyas Goenka Date: Mon, 3 Feb 2025 19:26:19 +0100 Subject: [PATCH] - --- acceptance/acceptance_test.go | 2 +- acceptance/auth/basic/out.requests.txt | 2 +- acceptance/auth/oauth/out.requests.txt | 6 ++-- acceptance/auth/pat/out.requests.txt | 2 +- acceptance/bundle/scripts/output.txt | 6 +--- acceptance/terraform/output.txt | 50 +++++--------------------- libs/testdiff/golden.go | 2 +- 7 files changed, 16 insertions(+), 54 deletions(-) diff --git a/acceptance/acceptance_test.go b/acceptance/acceptance_test.go index 0fc8d8484..66caf0e83 100644 --- a/acceptance/acceptance_test.go +++ b/acceptance/acceptance_test.go @@ -158,7 +158,7 @@ func testAccept(t *testing.T, InprocessMode bool, singleTest string) int { testdiff.PrepareReplacementsUUID(t, &repls) testdiff.PrepareReplacementsDevVersion(t, &repls) testdiff.PrepareReplacementSdkVersion(t, &repls) - testdiff.PrepareReplacementsGoVersion(t, &repls) + testdiff.PrepareReplaceOS(t, &repls) testDirs := getTests(t) require.NotEmpty(t, testDirs) diff --git a/acceptance/auth/basic/out.requests.txt b/acceptance/auth/basic/out.requests.txt index c2356ff6a..f02ed1801 100644 --- a/acceptance/auth/basic/out.requests.txt +++ b/acceptance/auth/basic/out.requests.txt @@ -1 +1 @@ -{"method":"GET","path":"/api/2.0/preview/scim/v2/Me","headers":{"Authorization":"Basic dXNlcm5hbWU6cGFzc3dvcmQ=","User-Agent":"cli/[DEV_VERSION] databricks-sdk-go/[SDK_VERSION] go/[GO_VERSION] os/darwin cmd/current-user_me cmd-exec-id/[UUID] auth/basic"},"body":null} +{"method":"GET","path":"/api/2.0/preview/scim/v2/Me","headers":{"Authorization":"Basic dXNlcm5hbWU6cGFzc3dvcmQ=","User-Agent":"cli/[DEV_VERSION] databricks-sdk-go/[SDK_VERSION] go/1.23.4 os/[OS] cmd/current-user_me cmd-exec-id/[UUID] auth/basic"},"body":""} diff --git a/acceptance/auth/oauth/out.requests.txt b/acceptance/auth/oauth/out.requests.txt index 2918b2fb9..22fa2530b 100644 --- a/acceptance/auth/oauth/out.requests.txt +++ b/acceptance/auth/oauth/out.requests.txt @@ -1,3 +1,3 @@ -{"method":"GET","path":"/oidc/.well-known/oauth-authorization-server","headers":{"User-Agent":"cli/[DEV_VERSION] databricks-sdk-go/[SDK_VERSION] go/[GO_VERSION] os/darwin"},"body":""} -{"method":"POST","path":"/oidc/v1/token","headers":{"Authorization":"Basic Y2xpZW50X2lkOmNsaWVudF9zZWNyZXQ=","User-Agent":"cli/[DEV_VERSION] databricks-sdk-go/[SDK_VERSION] go/[GO_VERSION] os/darwin"},"body":"grant_type=client_credentials\u0026scope=all-apis"} -{"method":"GET","path":"/api/2.0/preview/scim/v2/Me","headers":{"Authorization":"Bearer oauth-token","User-Agent":"cli/[DEV_VERSION] databricks-sdk-go/[SDK_VERSION] go/[GO_VERSION] os/darwin cmd/current-user_me cmd-exec-id/[UUID] auth/oauth-m2m"},"body":""} +{"method":"GET","path":"/oidc/.well-known/oauth-authorization-server","headers":{"User-Agent":"cli/[DEV_VERSION] databricks-sdk-go/[SDK_VERSION] go/1.23.4 os/[OS]"},"body":""} +{"method":"POST","path":"/oidc/v1/token","headers":{"Authorization":"Basic Y2xpZW50X2lkOmNsaWVudF9zZWNyZXQ=","User-Agent":"cli/[DEV_VERSION] databricks-sdk-go/[SDK_VERSION] go/1.23.4 os/[OS]"},"body":"grant_type=client_credentials\u0026scope=all-apis"} +{"method":"GET","path":"/api/2.0/preview/scim/v2/Me","headers":{"Authorization":"Bearer oauth-token","User-Agent":"cli/[DEV_VERSION] databricks-sdk-go/[SDK_VERSION] go/1.23.4 os/[OS] cmd/current-user_me cmd-exec-id/[UUID] auth/oauth-m2m"},"body":""} diff --git a/acceptance/auth/pat/out.requests.txt b/acceptance/auth/pat/out.requests.txt index 40f6206d5..65dc766d1 100644 --- a/acceptance/auth/pat/out.requests.txt +++ b/acceptance/auth/pat/out.requests.txt @@ -1 +1 @@ -{"method":"GET","path":"/api/2.0/preview/scim/v2/Me","headers":{"Authorization":"Bearer dapi1234","User-Agent":"cli/[DEV_VERSION] databricks-sdk-go/[SDK_VERSION] go/[GO_VERSION] os/darwin cmd/current-user_me cmd-exec-id/[UUID] auth/pat"},"body":null} +{"method":"GET","path":"/api/2.0/preview/scim/v2/Me","headers":{"Authorization":"Bearer dapi1234","User-Agent":"cli/[DEV_VERSION] databricks-sdk-go/[SDK_VERSION] go/1.23.4 os/[OS] cmd/current-user_me cmd-exec-id/[UUID] auth/pat"},"body":""} diff --git a/acceptance/bundle/scripts/output.txt b/acceptance/bundle/scripts/output.txt index 2deedb0e7..c0142c0ac 100644 --- a/acceptance/bundle/scripts/output.txt +++ b/acceptance/bundle/scripts/output.txt @@ -42,11 +42,7 @@ from myscript.py 0 postbuild: hello stderr! Executing 'predeploy' script from myscript.py 0 predeploy: hello stdout! from myscript.py 0 predeploy: hello stderr! -Error: unable to deploy to /Workspace/Users/[USERNAME]/.bundle/scripts/default/state as [USERNAME]. -Please make sure the current user or one of their groups is listed under the permissions of this bundle. -For assistance, contact the owners of this project. -They may need to redeploy the bundle to apply the new permissions. -Please refer to https://docs.databricks.com/dev-tools/bundles/permissions.html for more on managing permissions. +Error: Post "[DATABRICKS_URL]/api/2.0/workspace-files/import-file/Workspace%2FUsers%2F[USERNAME]%2F.bundle%2Fscripts%2Fdefault%2Fstate%2Fdeploy.lock?overwrite=false": EOF Exit code: 1 diff --git a/acceptance/terraform/output.txt b/acceptance/terraform/output.txt index 6bdc809f6..b25aef04b 100644 --- a/acceptance/terraform/output.txt +++ b/acceptance/terraform/output.txt @@ -1,51 +1,17 @@ >>> [TERRAFORM] init -no-color -get=false +Error: Failed to install provider + +Error while installing databricks/databricks v1.64.1: provider binary not +found: could not find executable file starting with +terraform-provider-databricks + + Initializing the backend... Initializing provider plugins... - Finding databricks/databricks versions matching "1.64.1"... - Installing databricks/databricks v1.64.1... -- Installed databricks/databricks v1.64.1 (unauthenticated) -Terraform has created a lock file .terraform.lock.hcl to record the provider -selections it made above. Include this file in your version control repository -so that Terraform can guarantee to make the same selections by default when -you run "terraform init" in the future. - - -Warning: Incomplete lock file information for providers - -Due to your customized provider installation methods, Terraform was forced to -calculate lock file checksums locally for the following providers: - - databricks/databricks - - -To calculate additional checksums for another platform, run: - terraform providers lock -platform=linux_amd64 -(where linux_amd64 is the platform to generate) - -Terraform has been successfully initialized! - -You may now begin working with Terraform. Try running "terraform plan" to see -any changes that are required for your infrastructure. All Terraform commands -should now work. - -If you ever set or change modules or backend configuration for Terraform, -rerun this command to reinitialize your working directory. If you forget, other -commands will detect it and remind you to do so if necessary. - ->>> [TERRAFORM] plan -no-color -data.databricks_current_user.me: Reading... -data.databricks_current_user.me: Read complete after (redacted) [id=[USERID]] - -Changes to Outputs: - + username = "[USERNAME]" - -You can apply this plan to save these new output values to the Terraform -state, without changing any real infrastructure. - -───────────────────────────────────────────────────────────────────────────── - -Note: You didn't use the -out option to save this plan, so Terraform can't -guarantee to take exactly these actions if you run "terraform apply" now. +Exit code: 1 diff --git a/libs/testdiff/golden.go b/libs/testdiff/golden.go index bc1e738e4..c1c51b6c5 100644 --- a/libs/testdiff/golden.go +++ b/libs/testdiff/golden.go @@ -14,7 +14,7 @@ import ( var OverwriteMode = false func init() { - flag.BoolVar(&OverwriteMode, "update", true, "Overwrite golden files") + flag.BoolVar(&OverwriteMode, "update", false, "Overwrite golden files") } func ReadFile(t testutil.TestingT, ctx context.Context, filename string) string {