From a2400f3025679983d1251b5dc793e2023657e83d Mon Sep 17 00:00:00 2001 From: Anton Nekipelov <226657+anton-107@users.noreply.github.com> Date: Fri, 28 Feb 2025 15:33:10 +0100 Subject: [PATCH] Enable TestAuthDescribeSuccess integration test (#2392) ## Changes 1. remove t.Skip directive from TestAuthDescribeSuccess integration test 2. change the test code to account for environments where host value can be prefixed with the https protocol part ## Why This enables integration test that exercises `databricks auth describe` command, which was previously throwing errors in the CI/CD pipeline ## Tests Integration test is passing --- integration/cmd/auth/describe_test.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/integration/cmd/auth/describe_test.go b/integration/cmd/auth/describe_test.go index f592bc276..66b83b557 100644 --- a/integration/cmd/auth/describe_test.go +++ b/integration/cmd/auth/describe_test.go @@ -2,6 +2,8 @@ package auth_test import ( "context" + "regexp" + "strings" "testing" "github.com/databricks/cli/internal/testcli" @@ -10,8 +12,6 @@ import ( ) func TestAuthDescribeSuccess(t *testing.T) { - t.Skipf("Skipping because of https://github.com/databricks/cli/issues/2010") - ctx := context.Background() stdout, _ := testcli.RequireSuccessfulRun(t, ctx, "auth", "describe") outStr := stdout.String() @@ -20,7 +20,9 @@ func TestAuthDescribeSuccess(t *testing.T) { require.NoError(t, err) require.NotEmpty(t, outStr) - require.Contains(t, outStr, "Host: "+w.Config.Host) + + hostWithoutPrefix := strings.TrimPrefix(w.Config.Host, "https://") + require.Regexp(t, "Host: (?:https://)?"+regexp.QuoteMeta(hostWithoutPrefix), outStr) me, err := w.CurrentUser.Me(context.Background()) require.NoError(t, err)