mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Add comformance test for event Update
This commit is contained in:
parent
b6174e605f
commit
5b1bdd8e38
3
test/conformance/testdata/conformance.yaml
vendored
3
test/conformance/testdata/conformance.yaml
vendored
@ -1515,7 +1515,8 @@
|
|||||||
codename: '[sig-instrumentation] Events API should ensure that an event can be fetched,
|
codename: '[sig-instrumentation] Events API should ensure that an event can be fetched,
|
||||||
patched, deleted, and listed [Conformance]'
|
patched, deleted, and listed [Conformance]'
|
||||||
description: Create an event, the event MUST exist. The event is patched with a
|
description: Create an event, the event MUST exist. The event is patched with a
|
||||||
new note, the check MUST have the update note. The event is deleted and MUST NOT
|
new note, the check MUST have the update note. The event is updated with a new
|
||||||
|
series, the check MUST have the update series. The event is deleted and MUST NOT
|
||||||
show up when listing all events.
|
show up when listing all events.
|
||||||
release: v1.19
|
release: v1.19
|
||||||
file: test/e2e/instrumentation/events.go
|
file: test/e2e/instrumentation/events.go
|
||||||
|
@ -89,6 +89,7 @@ var _ = common.SIGDescribe("Events API", func() {
|
|||||||
Testname: New Event resource lifecycle, testing a single event
|
Testname: New Event resource lifecycle, testing a single event
|
||||||
Description: Create an event, the event MUST exist.
|
Description: Create an event, the event MUST exist.
|
||||||
The event is patched with a new note, the check MUST have the update note.
|
The event is patched with a new note, the check MUST have the update note.
|
||||||
|
The event is updated with a new series, the check MUST have the update series.
|
||||||
The event is deleted and MUST NOT show up when listing all events.
|
The event is deleted and MUST NOT show up when listing all events.
|
||||||
*/
|
*/
|
||||||
framework.ConformanceIt("should ensure that an event can be fetched, patched, deleted, and listed", func() {
|
framework.ConformanceIt("should ensure that an event can be fetched, patched, deleted, and listed", func() {
|
||||||
@ -147,6 +148,24 @@ var _ = common.SIGDescribe("Events API", func() {
|
|||||||
framework.Failf("test event wasn't properly patched: %v", diff.ObjectReflectDiff(testEvent, event))
|
framework.Failf("test event wasn't properly patched: %v", diff.ObjectReflectDiff(testEvent, event))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ginkgo.By("updating the test event")
|
||||||
|
testEvent.Series = &eventsv1.EventSeries{
|
||||||
|
Count: 100,
|
||||||
|
LastObservedTime: metav1.MicroTime{Time: time.Unix(1505828956, 0)},
|
||||||
|
}
|
||||||
|
_, err = client.Update(context.TODO(), testEvent, metav1.UpdateOptions{})
|
||||||
|
framework.ExpectNoError(err, "failed to update the test event")
|
||||||
|
|
||||||
|
ginkgo.By("getting the test event")
|
||||||
|
event, err = client.Get(context.TODO(), eventName, metav1.GetOptions{})
|
||||||
|
framework.ExpectNoError(err, "failed to get test event")
|
||||||
|
// clear ResourceVersion and ManagedFields which are set by control-plane
|
||||||
|
event.ObjectMeta.ResourceVersion = ""
|
||||||
|
event.ObjectMeta.ManagedFields = nil
|
||||||
|
if !apiequality.Semantic.DeepEqual(testEvent, event) {
|
||||||
|
framework.Failf("test event wasn't properly updated: %v", diff.ObjectReflectDiff(testEvent, event))
|
||||||
|
}
|
||||||
|
|
||||||
ginkgo.By("deleting the test event")
|
ginkgo.By("deleting the test event")
|
||||||
err = client.Delete(context.TODO(), eventName, metav1.DeleteOptions{})
|
err = client.Delete(context.TODO(), eventName, metav1.DeleteOptions{})
|
||||||
framework.ExpectNoError(err, "failed to delete the test event")
|
framework.ExpectNoError(err, "failed to delete the test event")
|
||||||
|
Loading…
Reference in New Issue
Block a user