mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 19:31:44 +00:00
Merge pull request #93296 from chelseychen/event-e2e-conformance
Add conformance test for events Update operation
This commit is contained in:
commit
2fbe301b2d
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,
|
||||
patched, deleted, and listed [Conformance]'
|
||||
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.
|
||||
release: v1.19
|
||||
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
|
||||
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 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.
|
||||
*/
|
||||
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))
|
||||
}
|
||||
|
||||
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")
|
||||
err = client.Delete(context.TODO(), eventName, metav1.DeleteOptions{})
|
||||
framework.ExpectNoError(err, "failed to delete the test event")
|
||||
|
Loading…
Reference in New Issue
Block a user