mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-02 16:29:21 +00:00
Adding some debug messages on test failure
This commit is contained in:
parent
d8c493a274
commit
68dec27792
@ -61,8 +61,12 @@ var _ = Describe("LimitRange", func() {
|
|||||||
Expect(err).NotTo(HaveOccurred())
|
Expect(err).NotTo(HaveOccurred())
|
||||||
for i := range pod.Spec.Containers {
|
for i := range pod.Spec.Containers {
|
||||||
err = equalResourceRequirement(expected, pod.Spec.Containers[i].Resources)
|
err = equalResourceRequirement(expected, pod.Spec.Containers[i].Resources)
|
||||||
|
if err != nil {
|
||||||
|
// Print the pod to help in debugging.
|
||||||
|
Logf("Pod %+v does not have the expected requirements", pod)
|
||||||
Expect(err).NotTo(HaveOccurred())
|
Expect(err).NotTo(HaveOccurred())
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
By("Creating a Pod with partial resource requirements")
|
By("Creating a Pod with partial resource requirements")
|
||||||
pod = newTestPod("pod-partial-resources", getResourceList("", "150Mi"), getResourceList("300m", ""))
|
pod = newTestPod("pod-partial-resources", getResourceList("", "150Mi"), getResourceList("300m", ""))
|
||||||
@ -78,8 +82,12 @@ var _ = Describe("LimitRange", func() {
|
|||||||
expected = api.ResourceRequirements{Requests: getResourceList("300m", "150Mi"), Limits: getResourceList("300m", "500Mi")}
|
expected = api.ResourceRequirements{Requests: getResourceList("300m", "150Mi"), Limits: getResourceList("300m", "500Mi")}
|
||||||
for i := range pod.Spec.Containers {
|
for i := range pod.Spec.Containers {
|
||||||
err = equalResourceRequirement(expected, pod.Spec.Containers[i].Resources)
|
err = equalResourceRequirement(expected, pod.Spec.Containers[i].Resources)
|
||||||
|
if err != nil {
|
||||||
|
// Print the pod to help in debugging.
|
||||||
|
Logf("Pod %+v does not have the expected requirements", pod)
|
||||||
Expect(err).NotTo(HaveOccurred())
|
Expect(err).NotTo(HaveOccurred())
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
By("Failing to create a Pod with less than min resources")
|
By("Failing to create a Pod with less than min resources")
|
||||||
pod = newTestPod(podName, getResourceList("10m", "50Mi"), api.ResourceList{})
|
pod = newTestPod(podName, getResourceList("10m", "50Mi"), api.ResourceList{})
|
||||||
|
Loading…
Reference in New Issue
Block a user