Skip to content

Conversation

@yxxhero
Copy link
Member

@yxxhero yxxhero commented Aug 29, 2021

Signed-off-by: yxxhero aiopsclub@163.com

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

add unittest for kubelet isInitContainerFailed func

Which issue(s) this PR fixes:

None

Special notes for your reviewer:

None

Does this PR introduce a user-facing change?

None

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

None

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Aug 29, 2021
@k8s-ci-robot
Copy link
Contributor

Hi @yxxhero. 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 /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.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@k8s-ci-robot k8s-ci-robot added needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Aug 29, 2021
@yxxhero
Copy link
Member Author

yxxhero commented Aug 29, 2021

/sig node

@k8s-ci-robot k8s-ci-robot added sig/node Categorizes an issue or PR as relevant to SIG Node. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Aug 29, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: yxxhero
To complete the pull request process, please assign sjenning after the PR has been reviewed.
You can assign the PR to them by writing /assign @sjenning in a comment when ready.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link
Contributor

@yangjunmyfm192085 yangjunmyfm192085 left a comment

Choose a reason for hiding this comment

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

good job@yxxhero,s Could you add some abnormal tests also?
For example:

kubecontainer.Status = ContainerStateUnknown
ExitCode: 1

kubecontainer.Status = ContainerStateUnknown
ExitCode: 0

/cc @249043822

@yangjunmyfm192085
Copy link
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Aug 30, 2021
@249043822
Copy link
Member

/triage accepted
/priority backlog

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. priority/backlog Higher priority than priority/awaiting-more-evidence. and removed needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Aug 30, 2021
@yxxhero
Copy link
Member Author

yxxhero commented Aug 30, 2021

good job@yxxhero,s Could you add some abnormal tests also?

For example:
kubecontainer.Status = ContainerStateUnknown
ExitCode: 1

kubecontainer.Status = ContainerStateUnknown
ExitCode: 0

/cc @249043822

ok, I will add it.

@yxxhero
Copy link
Member Author

yxxhero commented Aug 30, 2021

good job@yxxhero,s Could you add some abnormal tests also?

For example:
kubecontainer.Status = ContainerStateUnknown
ExitCode: 1

kubecontainer.Status = ContainerStateUnknown
ExitCode: 0

/cc @249043822

good job@yxxhero,s Could you add some abnormal tests also?

For example:
kubecontainer.Status = ContainerStateUnknown
ExitCode: 1

kubecontainer.Status = ContainerStateUnknown
ExitCode: 0

/cc @249043822

form source code:

	if status.State == kubecontainer.ContainerStateUnknown {
		return true
	}

I think the cases not need. what do you think of? @yangjunmyfm192085

@yangjunmyfm192085
Copy link
Contributor

good job@yxxhero,s Could you add some abnormal tests also?

For example:
kubecontainer.Status = ContainerStateUnknown
ExitCode: 1
kubecontainer.Status = ContainerStateUnknown
ExitCode: 0
/cc @249043822

good job@yxxhero,s Could you add some abnormal tests also?

For example:
kubecontainer.Status = ContainerStateUnknown
ExitCode: 1
kubecontainer.Status = ContainerStateUnknown
ExitCode: 0
/cc @249043822

form source code:

	if status.State == kubecontainer.ContainerStateUnknown {
		return true
	}

I think the cases not need. what do you think of? @yangjunmyfm192085

That's right, but I hope these test cases could keep correctness of the code . and It's really good now.

@yangjunmyfm192085
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 6, 2021
@manugupt1
Copy link
Contributor

looks good to me.

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 14, 2021
@yxxhero yxxhero requested a review from mrunalp September 14, 2021 00:51
@yxxhero
Copy link
Member Author

yxxhero commented Sep 14, 2021

@mrunalp Please review, Thanks very much.

@yxxhero yxxhero requested a review from mrunalp September 14, 2021 15:21
@yxxhero
Copy link
Member Author

yxxhero commented Sep 14, 2021

@mrunalp Please review, Thanks very much.

@yxxhero
Copy link
Member Author

yxxhero commented Sep 21, 2021

@mrunalp ping

@yxxhero
Copy link
Member Author

yxxhero commented Oct 4, 2021

@mrunalp any update? Thanks very much.

@ffromani
Copy link
Contributor

ffromani commented Oct 5, 2021

I'm still unsure we should test internal helpers, but it seems positive consensus already formed for this change.
Please squash your commits, keeping the first commit message. I'll add my lgtm once done

Signed-off-by: yxxhero <aiopsclub@163.com>
@yxxhero yxxhero force-pushed the add_unittest_for_kubelet branch from dc8f931 to acee151 Compare October 5, 2021 10:18
@yxxhero
Copy link
Member Author

yxxhero commented Oct 5, 2021

@fromanirh Thanks very much.

@ffromani
Copy link
Contributor

ffromani commented Oct 5, 2021

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 5, 2021
@yxxhero
Copy link
Member Author

yxxhero commented Oct 5, 2021

/test pull-kubernetes-e2e-gce-ubuntu-containerd

@k8s-ci-robot
Copy link
Contributor

@yxxhero: PR needs rebase.

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.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 16, 2021
@yxxhero yxxhero closed this Nov 16, 2021
@yxxhero yxxhero deleted the add_unittest_for_kubelet branch November 16, 2021 05:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/kubelet cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. priority/backlog Higher priority than priority/awaiting-more-evidence. release-note-none Denotes a PR that doesn't merit a release note. sig/node Categorizes an issue or PR as relevant to SIG Node. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.

Projects

Development

Successfully merging this pull request may close these issues.