mirror of https://github.com/databricks/cli.git
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:
parent
211ec62a70
commit
a2400f3025
|
@ -2,6 +2,8 @@ package auth_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"regexp"
|
||||||
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/databricks/cli/internal/testcli"
|
"github.com/databricks/cli/internal/testcli"
|
||||||
|
@ -10,8 +12,6 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestAuthDescribeSuccess(t *testing.T) {
|
func TestAuthDescribeSuccess(t *testing.T) {
|
||||||
t.Skipf("Skipping because of https://github.com/databricks/cli/issues/2010")
|
|
||||||
|
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
stdout, _ := testcli.RequireSuccessfulRun(t, ctx, "auth", "describe")
|
stdout, _ := testcli.RequireSuccessfulRun(t, ctx, "auth", "describe")
|
||||||
outStr := stdout.String()
|
outStr := stdout.String()
|
||||||
|
@ -20,7 +20,9 @@ func TestAuthDescribeSuccess(t *testing.T) {
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
require.NotEmpty(t, outStr)
|
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())
|
me, err := w.CurrentUser.Me(context.Background())
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
Loading…
Reference in New Issue