github.com/argoproj/argo-cd@v1.8.7/test/e2e/cluster_test.go (about) 1 package e2e 2 3 import ( 4 "fmt" 5 "testing" 6 7 "github.com/stretchr/testify/assert" 8 9 . "github.com/argoproj/argo-cd/test/e2e/fixture" 10 . "github.com/argoproj/argo-cd/util/errors" 11 ) 12 13 func TestClusterList(t *testing.T) { 14 output := FailOnErr(RunCli("cluster", "list")).(string) 15 assert.Equal(t, fmt.Sprintf(`SERVER NAME VERSION STATUS MESSAGE 16 https://kubernetes.default.svc in-cluster %v Successful `, GetVersions().ServerVersion), output) 17 } 18 19 func TestClusterGet(t *testing.T) { 20 output := FailOnErr(RunCli("cluster", "get", "https://kubernetes.default.svc")).(string) 21 22 assert.Contains(t, output, fmt.Sprintf(` 23 name: in-cluster 24 server: https://kubernetes.default.svc 25 serverVersion: "%v"`, GetVersions().ServerVersion)) 26 27 assert.Contains(t, output, `config: 28 tlsClientConfig: 29 insecure: false`) 30 31 assert.Contains(t, output, `status: Successful`) 32 }