Skip to content
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

Merged

Conversation

enxebre
Copy link
Member

@enxebre enxebre commented May 30, 2017

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:

NONE

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels May 30, 2017
@k8s-ci-robot
Copy link
Contributor

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 @k8s-bot ok to test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

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.

@k8s-github-robot k8s-github-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. release-note-label-needed release-note-none Denotes a PR that doesn't merit a release note. and removed release-note-label-needed labels May 30, 2017
@mtaufen
Copy link
Contributor

mtaufen commented May 30, 2017

/assign @yujuhong

@yujuhong
Copy link
Contributor

@feiskyer can you help review the PR?

)

func TestRecordOperation(t *testing.T) {

Copy link
Member

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)
Copy link
Member

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 {

Copy link
Member

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]
Copy link
Member

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?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like that

@feiskyer
Copy link
Member

@k8s-bot ok to test

@k8s-ci-robot k8s-ci-robot removed the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label May 31, 2017
@enxebre
Copy link
Member Author

enxebre commented May 31, 2017

thanks for feedback @feiskyer, changes made according suggestions

@feiskyer
Copy link
Member

should run ./hack/update-bazel.sh for passing jenkins.

@enxebre
Copy link
Member Author

enxebre commented May 31, 2017

@k8s-bot pull-kubernetes-unit test this

@enxebre
Copy link
Member Author

enxebre commented May 31, 2017

After checking the logs I'm not sure why is failing

image{
name: "test-image-ref3",
uid: &runtimeapi.Int64Value{
2,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

&runtimeapi.Int64Value{
  Value: 2,
},

@feiskyer
Copy link
Member

feiskyer commented Jun 1, 2017

LGTM. Please squash the commits.

@yujuhong
Copy link
Contributor

yujuhong commented Jun 1, 2017

/approve

@enxebre enxebre force-pushed the kuberuntime-test-coverage branch from ee5d4b1 to 14be65c Compare June 1, 2017 07:45
@k8s-github-robot k8s-github-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 1, 2017
@enxebre
Copy link
Member Author

enxebre commented Jun 1, 2017

commits squashed! thanks for reviewing

@feiskyer
Copy link
Member

feiskyer commented Jun 1, 2017

Thanks. Waiting for CI green...

@feiskyer
Copy link
Member

feiskyer commented Jun 1, 2017

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 1, 2017
@k8s-github-robot
Copy link

[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 /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@calebamiles calebamiles modified the milestone: v1.7 Jun 2, 2017
@k8s-github-robot
Copy link

@k8s-bot test this [submit-queue is verifying that this PR is safe to merge]

@k8s-ci-robot
Copy link
Contributor

k8s-ci-robot commented Jun 3, 2017

@enxebre: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
pull-kubernetes-unit 14be65c link @k8s-bot pull-kubernetes-unit test this

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.

@k8s-github-robot
Copy link

Automatic merge from submit-queue (batch tested with PRs 46620, 46732, 46773, 46772, 46725)

@k8s-github-robot k8s-github-robot merged commit 0bcd960 into kubernetes:master Jun 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants