Skip to content

Commit

Permalink
ingress create
Browse files Browse the repository at this point in the history
  • Loading branch information
huseyinbabal committed Mar 29, 2023
1 parent 1b8515f commit 14e105c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions test/e2e/bots_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1102,7 +1102,7 @@ func runBotTest(t *testing.T,
})

t.Run("ChannelName mapping", func(t *testing.T) {
t.Log("Creating RBAC ConfigMap with ChannelName mapping...")
t.Log("Creating RBAC ConfigMap for ChannelName mapping...")
clusterRole := &v12.ClusterRole{
ObjectMeta: metav1.ObjectMeta{
Name: "ing-rbac-channel",
Expand All @@ -1116,6 +1116,7 @@ func runBotTest(t *testing.T,
},
}

t.Log("Creating RBAC ClusterRole for ChannelName mapping...")
clusterRoleCli := k8sCli.RbacV1().ClusterRoles()
cr, err := clusterRoleCli.Create(context.Background(), clusterRole, metav1.CreateOptions{})
require.NoError(t, err)
Expand All @@ -1138,6 +1139,7 @@ func runBotTest(t *testing.T,
},
}

t.Log("Creating RBAC ClusterRoleBinding for ChannelName mapping...")
clusterRoleBindingCli := k8sCli.RbacV1().ClusterRoleBindings()
crb, err := clusterRoleBindingCli.Create(context.Background(), clusterRoleBinding, metav1.CreateOptions{})
require.NoError(t, err)
Expand Down Expand Up @@ -1165,10 +1167,11 @@ func runBotTest(t *testing.T,
command := fmt.Sprintf("kubectl get ing %s -n %s -o yaml", ingress.Name, ingress.Namespace)
assertionFn := func(msg string) (bool, int, string) {
return strings.Contains(msg, heredoc.Doc(fmt.Sprintf("`%s` on `%s`", command, appCfg.ClusterName))) &&
strings.Contains(msg, fmt.Sprintf("`kubectl delete cm %s -n %s` on `%s`\n```\nconfigmap \"%s\" deleted\n```\n", ingress.Name, ingress.Namespace, appCfg.ClusterName, ingress.Name)), 0, ""
strings.Contains(msg, "creationTimestamp:"), 0, ""
}

botDriver.PostMessageToBot(t, botDriver.ThirdChannel().Identifier(), command)

t.Log("Expecting bot event message...")
err = botDriver.WaitForMessagePosted(botDriver.BotUserID(), botDriver.ThirdChannel().ID(), 1, assertionFn)
assert.NoError(t, err)

Expand Down

0 comments on commit 14e105c

Please sign in to comment.