diff --git a/acceptance/acceptance_test.go b/acceptance/acceptance_test.go index fba66d70a..ccdf74bcb 100644 --- a/acceptance/acceptance_test.go +++ b/acceptance/acceptance_test.go @@ -35,7 +35,7 @@ var ( // In order to debug CLI running under acceptance test, set this to full subtest name, e.g. "bundle/variables/empty" // Then install your breakpoints and click "debug test" near TestAccept in VSCODE. // example: var SingleTest = "bundle/variables/empty" -var SingleTest = "telemetry/dummy-without-server" +var SingleTest = "" // If enabled, instead of compiling and running CLI externally, we'll start in-process server that accepts and runs // CLI commands. The $CLI in test scripts is a helper that just forwards command-line arguments to this server (see bin/callserver.py). @@ -43,8 +43,7 @@ var SingleTest = "telemetry/dummy-without-server" var InprocessMode bool func init() { - // flag.BoolVar(&InprocessMode, "inprocess", SingleTest != "", "Run CLI in the same process as test (for debugging)") - flag.BoolVar(&InprocessMode, "inprocess", false, "Run CLI in the same process as test (for debugging)") + flag.BoolVar(&InprocessMode, "inprocess", SingleTest != "", "Run CLI in the same process as test (for debugging)") flag.BoolVar(&KeepTmp, "keeptmp", false, "Do not delete TMP directory after run") flag.BoolVar(&NoRepl, "norepl", false, "Do not apply any replacements (for debugging)") } @@ -157,7 +156,6 @@ func testAccept(t *testing.T, InprocessMode bool, singleTest string) int { testdiff.PrepareReplacementsWorkspaceClient(t, &repls, workspaceClient) testdiff.PrepareReplacementsUUID(t, &repls) testdiff.PrepareReplacementsDevVersion(t, &repls) - testdiff.PrepareReplaceOS(t, &repls) testDirs := getTests(t) require.NotEmpty(t, testDirs) diff --git a/acceptance/telemetry/dummy-without-server/output.txt b/acceptance/telemetry/dummy-without-server/output.txt index cf0956eec..b75449730 100644 --- a/acceptance/telemetry/dummy-without-server/output.txt +++ b/acceptance/telemetry/dummy-without-server/output.txt @@ -1,4 +1,8 @@ >>> $CLI telemetry dummy + +>>> wait_file ./telemetry.pid File ./telemetry.pid exists + +>>> wait_pid 46437 Process has ended diff --git a/acceptance/telemetry/dummy/out.requests.txt b/acceptance/telemetry/dummy/out.requests.txt index adcd2cb41..9bde4093b 100644 --- a/acceptance/telemetry/dummy/out.requests.txt +++ b/acceptance/telemetry/dummy/out.requests.txt @@ -1 +1 @@ -{"method":"POST","path":"/telemetry-ext","body":{"uploadTime":"UNIX_TIME_MILLIS","items":[],"protoLogs":["{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"execution_context\":{\"cmd_exec_id\":\"[UUID]\",\"version\":\"$DEV_VERSION\",\"command\":\"telemetry_dummy\",\"operating_system\":\"[OS]\",\"execution_time_ms\":\"SMALL_INT\",\"exit_code\":0},\"cli_test_event\":{\"name\":\"VALUE1\"}}}}","{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"execution_context\":{\"cmd_exec_id\":\"[UUID]\",\"version\":\"$DEV_VERSION\",\"command\":\"telemetry_dummy\",\"operating_system\":\"[OS]\",\"execution_time_ms\":\"SMALL_INT\",\"exit_code\":0},\"cli_test_event\":{\"name\":\"VALUE2\"}}}}"]}} +{"method":"POST","path":"/telemetry-ext","body":{"uploadTime":"UNIX_TIME_MILLIS","items":[],"protoLogs":["{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"execution_context\":{\"cmd_exec_id\":\"[UUID]\",\"version\":\"$DEV_VERSION\",\"command\":\"telemetry_dummy\",\"operating_system\":\"OS\",\"execution_time_ms\":\"SMALL_INT\",\"exit_code\":0},\"cli_test_event\":{\"name\":\"VALUE1\"}}}}","{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"execution_context\":{\"cmd_exec_id\":\"[UUID]\",\"version\":\"$DEV_VERSION\",\"command\":\"telemetry_dummy\",\"operating_system\":\"OS\",\"execution_time_ms\":\"SMALL_INT\",\"exit_code\":0},\"cli_test_event\":{\"name\":\"VALUE2\"}}}}"]}} diff --git a/acceptance/telemetry/dummy/output.txt b/acceptance/telemetry/dummy/output.txt index cf0956eec..6559d787e 100644 --- a/acceptance/telemetry/dummy/output.txt +++ b/acceptance/telemetry/dummy/output.txt @@ -1,4 +1,8 @@ >>> $CLI telemetry dummy + +>>> wait_file ./telemetry.pid File ./telemetry.pid exists + +>>> wait_pid 46711 Process has ended diff --git a/acceptance/telemetry/dummy/test.toml b/acceptance/telemetry/dummy/test.toml index a7864dbaf..1218a4192 100644 --- a/acceptance/telemetry/dummy/test.toml +++ b/acceptance/telemetry/dummy/test.toml @@ -15,3 +15,7 @@ New = '"UNIX_TIME_MILLIS"' [[Repls]] Old = 'execution_time_ms\\\":\d{1,5},' New = 'execution_time_ms\":\"SMALL_INT\",' + +[[Repls]] +Old = 'darwin|linux|windows' +New = 'OS' diff --git a/acceptance/telemetry/upload/test.toml b/acceptance/telemetry/upload/test.toml index 6178f2492..0de038541 100644 --- a/acceptance/telemetry/upload/test.toml +++ b/acceptance/telemetry/upload/test.toml @@ -12,3 +12,7 @@ Response.Body = ''' [[Repls]] Old = '17\d{11}' New = '"UNIX_TIME_MILLIS"' + +[[Repls]] +Old = 'darwin|linux|windows' +New = 'OS' diff --git a/acceptance/terraform/output.txt b/acceptance/terraform/output.txt index d5504c71a..f2d9534e7 100644 --- a/acceptance/terraform/output.txt +++ b/acceptance/terraform/output.txt @@ -1,49 +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 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=$USER.Id] - -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/replacement.go b/libs/testdiff/replacement.go index ecf443363..7077e611b 100644 --- a/libs/testdiff/replacement.go +++ b/libs/testdiff/replacement.go @@ -209,8 +209,3 @@ func PrepareReplacementsDevVersion(t testutil.TestingT, r *ReplacementsContext) t.Helper() r.append(devVersionRegex, "$$DEV_VERSION") } - -func PrepareReplaceOS(t testutil.TestingT, r *ReplacementsContext) { - t.Helper() - r.Set(runtime.GOOS, "[OS]") -} diff --git a/libs/testdiff/replacement_test.go b/libs/testdiff/replacement_test.go index f5d08d81e..1b6c5fe2d 100644 --- a/libs/testdiff/replacement_test.go +++ b/libs/testdiff/replacement_test.go @@ -1,7 +1,6 @@ package testdiff import ( - "runtime" "testing" "github.com/stretchr/testify/assert" @@ -45,11 +44,3 @@ func TestReplacement_TemporaryDirectory(t *testing.T) { assert.Equal(t, "/tmp/.../tail", repls.Replace("/tmp/foo/bar/qux/tail")) } - -func TestReplacement_OS(t *testing.T) { - var repls ReplacementsContext - - PrepareReplaceOS(t, &repls) - - assert.Equal(t, "[OS]", repls.Replace(runtime.GOOS)) -}