Changed code to improve output for files under test/e2e/instrumentation

This commit is contained in:
Nikhil Sharma 2021-11-13 00:57:55 +05:30
parent e4c795168b
commit dde904b57d
2 changed files with 18 additions and 6 deletions

View File

@ -84,7 +84,9 @@ var _ = common.SIGDescribe("Events", func() {
break
}
}
framework.ExpectEqual(foundCreatedEvent, true, "unable to find the test event")
if !foundCreatedEvent {
framework.Failf("unable to find test event %s in namespace %s, full list of events is %+v", eventTestName, f.Namespace.Name, eventsList.Items)
}
ginkgo.By("patching the test event")
// patch the event's message
@ -121,7 +123,9 @@ var _ = common.SIGDescribe("Events", func() {
break
}
}
framework.ExpectEqual(foundCreatedEvent, false, "should not have found test event after deletion")
if foundCreatedEvent {
framework.Failf("Should not have found test event %s in namespace %s, full list of events %+v", eventTestName, f.Namespace.Name, eventsList.Items)
}
})
/*

View File

@ -101,11 +101,15 @@ var _ = common.SIGDescribe("Events API", func() {
ginkgo.By("listing events in all namespaces")
foundCreatedEvent := eventExistsInList(clientAllNamespaces, f.Namespace.Name, eventName)
framework.ExpectEqual(foundCreatedEvent, true, "failed to find test event in list with cluster scope")
if !foundCreatedEvent {
framework.Failf("Failed to find test event %s in namespace %s, in list with cluster scope", eventName, f.Namespace.Name)
}
ginkgo.By("listing events in test namespace")
foundCreatedEvent = eventExistsInList(client, f.Namespace.Name, eventName)
framework.ExpectEqual(foundCreatedEvent, true, "failed to find test event in list with namespace scope")
if !foundCreatedEvent {
framework.Failf("Failed to find test event %s in namespace %s, in list with namespace scope", eventName, f.Namespace.Name)
}
ginkgo.By("listing events with field selection filtering on source")
filteredCoreV1List, err := coreClient.List(context.TODO(), metav1.ListOptions{FieldSelector: "source=test-controller"})
@ -172,11 +176,15 @@ var _ = common.SIGDescribe("Events API", func() {
ginkgo.By("listing events in all namespaces")
foundCreatedEvent = eventExistsInList(clientAllNamespaces, f.Namespace.Name, eventName)
framework.ExpectEqual(foundCreatedEvent, false, "should not have found test event after deletion")
if foundCreatedEvent {
framework.Failf("Should not have found test event %s in namespace %s, in list with cluster scope after deletion", eventName, f.Namespace.Name)
}
ginkgo.By("listing events in test namespace")
foundCreatedEvent = eventExistsInList(client, f.Namespace.Name, eventName)
framework.ExpectEqual(foundCreatedEvent, false, "should not have found test event after deletion")
if foundCreatedEvent {
framework.Failf("Should not have found test event %s in namespace %s, in list with namespace scope after deletion", eventName, f.Namespace.Name)
}
})
/*