-
Notifications
You must be signed in to change notification settings - Fork 72
Auto tests for PR: kubevirt/kubevirt#1839 #537
Conversation
@sHaggYcaT I do not think you have to check all the VM creation, just use those as functions. I am pretty sure there was a way to call a method and create VM from yaml without having to implement everything on you own. See for example https://github.com/kubevirt/kubevirt-ansible/blob/master/tests/high_performance_vm_test.go#L46 Currently it is very hard to see the test code in all the boilerplate around it. |
@MarSik ^^updated version ^^ |
10a2f96
to
6c9d880
Compare
c50676f
to
4ed5d97
Compare
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.
In general it looks reasonable, make sure you properly cleanup the started VMs and check the patterns for your Context and It descriptions, I do not think the text there should repeat
tests/sockets_cores_threads_test.go
Outdated
return arguments | ||
} | ||
|
||
var _ = Describe("numaSupport", func() { |
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.
NUMA? This has nothing to do with numa.. guest topology might be better name here. Also shouldn't you annotate this with the test plan ID somehow so the results are automatically connected with it?
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.
NUMA
Just old variable, I'll rename it. I've already rename everything about NUMA, but in this place forget to do it
Also shouldn't you annotate this with the test plan ID somehow so the results are automatically connected with it?
I'm going to do this work it in another PR for all my test plans together. Now I just want to merge this code ASAP (before it outdated, and before it requires rebase/difficult merges, etc)
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.
Please fix
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.
It was already fixed
tests/sockets_cores_threads_test.go
Outdated
"time" | ||
) | ||
|
||
type Config struct { |
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.
Why not reuse the kubevirt/kubernetes API objects?
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.
Could you please show an example?
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.
^^ @MarSik ^^
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.
https://github.com/kubernetes/api/blob/master/core/v1/types.go#L3144 this structure implements the same I think
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've just made it
I've tested it in the openshift local installation and in the official CI. If test passed, then everything delete. If not passed, then failed VMI not delete (and it's helpful for debug). It's not problem for github CI, because it creates dedicated environment for each patch. And it's helpful if you run test manually using our internal CI |
@MarSik how to remove "WIP" flag? |
@sHaggYcaT could you please try to add following value to LagoInitFile.yml.j2
|
Thank you @lukas-bednar |
@@ -6,6 +6,7 @@ nat-settings: &nat-settings | |||
management: False | |||
|
|||
vm-common-settings: &vm-common-settings | |||
vCpu: 4 |
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.
it is lowercased vcpu
, I am afraid that it might cause that this option is going to be ignored :-O
For further reference, you can following this document: https://lago.readthedocs.io/en/latest/LagoInitFile.html
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.
@lukas-bednar looks like it doesn't work :(
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.
Forget to say, your latest suggestion works
tests/sockets_cores_threads_test.go
Outdated
return arguments | ||
} | ||
|
||
var _ = Describe("numaSupport", func() { |
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.
Please fix
tests/framework/util.go
Outdated
@@ -134,3 +134,55 @@ func RemoveDataVolume(dvName string, namespace string) { | |||
err = virtCli.CdiClient().CdiV1alpha1().DataVolumes(namespace).Delete(dvName, nil) | |||
Expect(err).ToNot(HaveOccurred()) | |||
} | |||
|
|||
func CreateVMorVMIfromManifest(manifest, nameSpace string) string { |
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.
See tests/framework/types.go
Use: func (vm VirtualMachine) Create() (string, string, error)
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.
Done
tests/framework/util.go
Outdated
|
||
// Find out how many VMs with specific resource needs can be run in the cluster | ||
|
||
func min(a, b int) int { |
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.
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.
OK, thank you
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.
Done
tests/sockets_cores_threads_test.go
Outdated
virtClient, err := kubecli.GetKubevirtClient() | ||
ktests.PanicOnError(err) | ||
address_common := "tests/manifests/sockets_cores_threads/" | ||
const TestSystemNamespace = "kubevirt-test-default" |
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.
import
tests "kubevirt.io/kubevirt-ansible/tests/framework"
use like:
tests.NamespaceTestDefault
remove this const
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.
Done
* | ||
*/ | ||
|
||
package tests_test |
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.
Add polarion test ids to all test cases
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.
@ILpinto done
…g; minor improvements
Failed in webUI deploy: 17:03:26 TASK [kubevirt_web_ui : Wait until Web UI is ready: 'v1.4.0-13'] *************** |
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.
Looks fine to me now. Some parts of this code could be implemented differently, but I don't see a point on stalling on this now. It probably can be improved in the future or re-implemented on another platform.
Let's wait for the tests to finish.
What this PR does / why we need it:
Auto tests for PR: kubevirt/kubevirt#1839
Release note: