Merge pull request #106233 from NikhilSharmaWe/betterOutputInstrumentation

Changed code to improve output for files under test/e2e/instrumentation
This commit is contained in:
Kubernetes Prow Robot 2021-12-07 17:26:18 -08:00 committed by GitHub
commit ec0d1edc17
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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)
}
})
/*