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
This commit is contained in:
Anton Nekipelov 2025-02-28 15:33:10 +01:00 committed by GitHub
parent 211ec62a70
commit a2400f3025
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 3 deletions

View File

@ -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)