-
Notifications
You must be signed in to change notification settings - Fork 39.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improving test coverage for kubelet/kuberuntime. #46620
Improving test coverage for kubelet/kuberuntime. #46620
Conversation
Hi @enxebre. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
/assign @yujuhong |
@feiskyer can you help review the PR? |
) | ||
|
||
func TestRecordOperation(t *testing.T) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: remove extra empty lines
|
||
assert.HTTPBodyContains(t, http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { | ||
mux.ServeHTTP(w, r) | ||
}), "GET", prometheusUrl, nil, runtimeOperationsLatencyExpected) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shutdown the http server after all cases.
@@ -165,3 +166,94 @@ func TestToKubeContainerStatus(t *testing.T) { | |||
assert.Equal(t, test.expected, actual, desc) | |||
} | |||
} | |||
|
|||
func makeExpetectedConfig(m *kubeGenericRuntimeManager, pod *v1.Pod) *runtimeapi.ContainerConfig { | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: remove extra empty line
|
||
func makeExpetectedConfig(m *kubeGenericRuntimeManager, pod *v1.Pod) *runtimeapi.ContainerConfig { | ||
|
||
container := &pod.Spec.Containers[0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also add container index as an arg?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like that
@k8s-bot ok to test |
thanks for feedback @feiskyer, changes made according suggestions |
should run |
@k8s-bot pull-kubernetes-unit test this |
After checking the logs I'm not sure why is failing |
image{ | ||
name: "test-image-ref3", | ||
uid: &runtimeapi.Int64Value{ | ||
2, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
&runtimeapi.Int64Value{
Value: 2,
},
LGTM. Please squash the commits. |
/approve |
ee5d4b1
to
14be65c
Compare
commits squashed! thanks for reviewing |
Thanks. Waiting for CI green... |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: enxebre, feiskyer, yujuhong The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
@enxebre: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
Automatic merge from submit-queue (batch tested with PRs 46620, 46732, 46773, 46772, 46725) |
What this PR does / why we need it:
Increases test coverage for kubelet/kuberuntime
#46123
Which issue this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close that issue when PR gets merged): fixes ##46123
Special notes for your reviewer:
Release note: