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

Framework for watch/job unittest #137

Merged
merged 1 commit into from
Mar 13, 2017
Merged

Framework for watch/job unittest #137

merged 1 commit into from
Mar 13, 2017

Conversation

admiyo
Copy link
Contributor

@admiyo admiyo commented Mar 10, 2017

Controller with list watch for Migration jobs

3 Unit tests for watch/Job:

Negative: ignore a job that has no label
Negative: ignore a job that has label but no successes
Positive: if label matches, should see a fetch and an update of the VM

Controller with list watch for Migration jobs

3 Unit tests for watch/Job:

Negative:  ignore a job that has no label
Negative:  ignore a job that has  label but no successes
Positive:  if label matches, should see a fetch and an update of the VM
Copy link
Member

@stu-gott stu-gott left a comment

Choose a reason for hiding this comment

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

Looks pretty good overall.

fieldSelector := fields.Everything()
labelSelector, err := labels.Parse(kvirtv1.DomainLabel)
if err != nil {
panic(err)
Copy link
Member

Choose a reason for hiding this comment

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

We probably don't want to panic here. make this function return

(kubeapi.ListOptions, error)

and handle the error higher in the call chain.

Also, we definitely want to log this error.

logger := logging.DefaultLogger()

Copy link
Member

Choose a reason for hiding this comment

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

I would say panic is fine, since this really never should fail ...

@rmohr rmohr merged commit f8195fa into kubevirt:master Mar 13, 2017
rmohr added a commit that referenced this pull request Mar 13, 2017
Framework for watch/job unittest
@admiyo admiyo deleted the job-watch branch March 17, 2017 20:50
kubevirt-bot pushed a commit to kubevirt-bot/kubevirt that referenced this pull request Dec 7, 2021
Signed-off-by: Arik Hadas <ahadas@bamba.tlv.redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants