Add e2e tests for events command (#111855)

* Add e2e tests for events command

* Run events tests as normal e2e instead conformance

Conformance tests are only for GA features. Since `kubectl events`
currently is in alpha stage, e2e tests for this command should be
run as standard e2e.
This commit is contained in:
Arda Güçlü 2022-09-26 18:10:08 +03:00 committed by GitHub
parent cac53883f4
commit 0303535506
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1939,6 +1939,34 @@ metadata:
})
})
ginkgo.Describe("Kubectl events", func() {
ginkgo.It("should show event when pod is created ", func() {
podName := "e2e-test-httpd-pod"
ginkgo.By("running the image " + httpdImage)
framework.RunKubectlOrDie(ns, "run", podName, "--image="+httpdImage, podRunningTimeoutArg, "--labels=run="+podName)
ginkgo.By("verifying the pod " + podName + " is running")
label := labels.SelectorFromSet(map[string]string{"run": podName})
err := testutils.WaitForPodsWithLabelRunning(c, ns, label)
if err != nil {
framework.Failf("Failed getting pod %s: %v", podName, err)
}
ginkgo.By("show started event for this pod")
events := framework.RunKubectlOrDie(ns, "alpha", "events", "--for=pod/"+podName)
if !strings.Contains(events, fmt.Sprintf("Normal Scheduled Pod/%s", podName)) {
framework.Failf("failed to list expected event")
}
ginkgo.By("expect not showing any WARNING message")
events = framework.RunKubectlOrDie(ns, "alpha", "events", "--types=WARNING", "--for=pod/"+podName)
if events != "" {
framework.Failf("unexpected WARNING event fired")
}
})
})
ginkgo.Describe("Kubectl create quota", func() {
ginkgo.It("should create a quota without scopes", func() {
quotaName := "million"