DDan Kenigsbergtests: deprecate reading into libvirt domxml
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
tests, utils: Move DomXML functs to a new package Move the two last functions of tests.utils to a new home and delete the file. DomainXML functions are still widely in use by many tests. Introduce a new package libdomain to host library functions that handle common domain aspects for tests. Signed-off-by: Nir Dothan <ndothan@redhat.com> | 1 年前 | |
tests: deprecate reading into libvirt domxml End-to-end tests should be testing the KubeVirt API and behaviour. They should typically start a VM with specific options and then verify that the guest behaves as expected. E2e tests should *not* look into KubeVirt or Kubernetes implementation details. This is important in order to keep e2e short, few and limited to their level. Libvirt and qemu are very important to KubeVirt, but they sit below the KubeVirt API. Good e2e test should not look at them. For example, tests verifying that the libvirt domxml was built as expected should be converted to unit test of domxml rendering function. Another example is the test for hotplug CPU. As an end-to-end test it should verify that the guest actually has an additional CPU (e.g by logging into the guest and reading /proc/cpuinfo) and not just look the xml. This commit warns the users of two helper functions that break test levels so that we remember to aviod them in new tests and to remove them eventually. One legitimate use case GetRunningVirtualMachineInstanceDomainXML is in tests/reporter/kubernetes.go, where we attempt to grab as much information about a failing test. The function should eventually move there. Signed-off-by: Dan Kenigsberg <danken@redhat.com> | 1 年前 |