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

Added tests for vm/vmi resource watch #3002

Closed
wants to merge 1 commit into from
Closed

Added tests for vm/vmi resource watch #3002

wants to merge 1 commit into from

Conversation

omeryahud
Copy link
Contributor

What this PR does / why we need it:
Added 2 tests to make sure oc get vm -w and oc get vmi -w work correctly

Release note:

NONE

@kubevirt-bot kubevirt-bot added release-note-none Denotes a PR that doesn't merit a release note. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. size/L labels Jan 19, 2020
@kubevirt-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign danielbelenky
You can assign the PR to them by writing /assign @danielbelenky 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

@omeryahud
Copy link
Contributor Author

/retest

Copy link

@danielBelenky danielBelenky left a comment

Choose a reason for hiding this comment

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

Do we really need to check the output speifically from kubectl? Is it possible to use the go-client with a watch for this test and check for the status of the objects from there? Eventually, kubectl is reading the status from the same place and I'm not sure we should test kubectl iteself ...

tests/vm_watch_test.go Outdated Show resolved Hide resolved
tests/vm_watch_test.go Outdated Show resolved Hide resolved
@omeryahud
Copy link
Contributor Author

omeryahud commented Jan 21, 2020

Do we really need to check the output speifically from kubectl? Is it possible to use the go-client with a watch for this test and check for the status of the objects from there? Eventually, kubectl is reading the status from the same place and I'm not sure we should test kubectl iteself ...

Do you have an example of how to watch VM/VMI resources with GetKubevirtClient()?
I've tried to look for it but couldn't find anything.

Edit:
Watch()ing a resource like client-go does encapsulates the server defined structure of the printed table, so in order to fetch the table definition, which this tests needs to verify, I have to either user pure HTTP requests to the api server or run kubectl/oc and read their output.

@omeryahud
Copy link
Contributor Author

omeryahud commented Jan 21, 2020

Do we really need to check the output speifically from kubectl? Is it possible to use the go-client with a watch for this test and check for the status of the objects from there? Eventually, kubectl is reading the status from the same place and I'm not sure we should test kubectl iteself ...

Agreed, will implement the Watch() logic like client-go does and use that in the test instead of execing oc/kubectl binary

Edit:
Replied to here: #3002 (comment)

@fabiand
Copy link
Member

fabiand commented Jan 21, 2020

@ILpinto @dshchedr up for a review?

tests/vm_watch_test.go Outdated Show resolved Hide resolved
tests/vm_watch_test.go Outdated Show resolved Hide resolved
tests/vm_watch_test.go Outdated Show resolved Hide resolved
@ILpinto
Copy link
Contributor

ILpinto commented Jan 22, 2020

/lgtm

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Jan 22, 2020
@enp0s3
Copy link
Contributor

enp0s3 commented Jan 22, 2020

/lgtm

@kubevirt-bot
Copy link
Contributor

@enp0s3: changing LGTM is restricted to collaborators

In response to this:

/lgtm

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.

@kubevirt-bot kubevirt-bot removed the lgtm Indicates that a PR is ready to be merged. label Jan 22, 2020
@kubevirt-bot
Copy link
Contributor

New changes are detected. LGTM label has been removed.

@omeryahud
Copy link
Contributor Author

/hold

@kubevirt-bot kubevirt-bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 27, 2020
return cmd, stdOut, stdErr
}

It("[test_id:3468]Should update vm status with the proper columns using 'kubectl get vm -w'", func() {
Copy link
Contributor

Choose a reason for hiding this comment

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

@omeryahud the reason for failure here can be that the PR for this might not have made it back to previous versions.
kubernetes/kubernetes#76161

Need to check specific version, but I think it should have made in 1.16 and onwards
You should skip the tests for the versions before that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, working on it now

@kubevirt-bot kubevirt-bot added dco-signoff: no Indicates the PR's author has not DCO signed all their commits. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. and removed dco-signoff: yes Indicates the PR's author has DCO signed all their commits. dco-signoff: no Indicates the PR's author has not DCO signed all their commits. labels Jan 29, 2020
@omeryahud
Copy link
Contributor Author

/retest

@kubevirt-bot kubevirt-bot added the dco-signoff: no Indicates the PR's author has not DCO signed all their commits. label Jan 29, 2020
@kubevirt-bot kubevirt-bot removed the dco-signoff: yes Indicates the PR's author has DCO signed all their commits. label Jan 29, 2020
Signed-off-by: Omer Yahud <oyahud@oyahud.tlv.csb>
@kubevirt-bot kubevirt-bot added dco-signoff: yes Indicates the PR's author has DCO signed all their commits. size/XL and removed dco-signoff: no Indicates the PR's author has not DCO signed all their commits. size/L labels Jan 29, 2020
@omeryahud omeryahud closed this Jan 29, 2020
@kubevirt-bot
Copy link
Contributor

@omeryahud: The following tests failed, say /retest to rerun them all:

Test name Commit Details Rerun command
pull-kubevirt-e2e-k8s-1.16.2 f833493 link /test pull-kubevirt-e2e-k8s-1.16.2
pull-kubevirt-e2e-k8s-1.14.6 f833493 link /test pull-kubevirt-e2e-k8s-1.14.6

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dco-signoff: yes Indicates the PR's author has DCO signed all their commits. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. release-note-none Denotes a PR that doesn't merit a release note. size/XL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants