-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathksql_test.go
51 lines (45 loc) · 3.05 KB
/
ksql_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package test
func (s *CLITestSuite) TestKsql() {
// TODO: add --config flag to all commands or ENVVAR instead of using standard config file location
tests := []CLITest{
{args: "ksql cluster create test_ksql --cluster lkc-12345 --credential-identity sa-credential-identity", fixture: "ksql/cluster/create-result.golden"},
{args: "ksql cluster create test_ksql --cluster lkc-12345", fixture: "ksql/cluster/create-result-missing-credential-identity.golden", exitCode: 1},
{args: "ksql cluster create test_ksql --cluster lkc-processLogFalse --credential-identity sa-credential-identity --log-exclude-rows", fixture: "ksql/cluster/create-result-log-exclude-rows.golden"},
{args: "ksql cluster create test_ksql_yaml --cluster lkc-12345 --credential-identity sa-credential-identity -o yaml", fixture: "ksql/cluster/create-result-yaml.golden"},
{args: "ksql cluster create test_ksql_yaml --cluster lkc-processLogFalse --credential-identity sa-credential-identity --log-exclude-rows -o yaml", fixture: "ksql/cluster/create-result-yaml-log-exclude-rows.golden"},
{args: "ksql cluster delete lksqlc-12345 --force", fixture: "ksql/cluster/delete-result.golden"},
{args: "ksql cluster delete lksqlc-12345 lksqlc-12346", fixture: "ksql/cluster/delete-multiple-fail.golden", exitCode: 1},
{args: "ksql cluster delete lksqlc-12345 lksqlc-ksql1", input: "n\n", fixture: "ksql/cluster/delete-multiple-refuse.golden"},
{args: "ksql cluster delete lksqlc-12345 lksqlc-ksql1", input: "y\n", fixture: "ksql/cluster/delete-multiple-success.golden"},
{args: "ksql cluster delete lksqlc-12345", input: "y\n", fixture: "ksql/cluster/delete-result-prompt.golden"},
{args: "ksql cluster describe lksqlc-12345 -o yaml", fixture: "ksql/cluster/describe-result-yaml.golden"},
{args: "ksql cluster describe lksqlc-12345", fixture: "ksql/cluster/describe-result.golden"},
{args: "ksql cluster list -o yaml", fixture: "ksql/cluster/list-result-yaml.golden"},
{args: "ksql cluster list", fixture: "ksql/cluster/list-result.golden"},
}
for _, test := range tests {
test.login = "cloud"
s.runIntegrationTest(test)
}
}
func (s *CLITestSuite) TestKsqlClusterConfigureAcls() {
tests := []CLITest{
{args: "ksql cluster configure-acls lksqlc-12345 --cluster lkc-abcde", fixture: "ksql/cluster/configure-acls.golden"},
{args: "ksql cluster configure-acls lksqlc-12345 --cluster lkc-abcde --dry-run", fixture: "ksql/cluster/configure-acls-dry-run.golden"},
{args: "ksql cluster configure-acls lksqlc-ksql1 --cluster lkc-12345", fixture: "ksql/cluster/configure-acls-no-service-account.golden", exitCode: 1},
}
for _, test := range tests {
test.login = "cloud"
s.runIntegrationTest(test)
}
}
func (s *CLITestSuite) TestKsql_Autocomplete() {
tests := []CLITest{
{args: `__complete ksql cluster describe ""`, fixture: "ksql/cluster/describe-autocomplete.golden"},
{args: `__complete ksql cluster create my-cluster --credential-identity ""`, fixture: "ksql/cluster/create-credential-identity-autocomplete.golden"},
}
for _, test := range tests {
test.login = "cloud"
s.runIntegrationTest(test)
}
}