Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upCreate func test for node/pod (anti-)affinity #1144
Comments
fabiand
added
help wanted
topic/api
good first issue
topic/testing
kind/bug
labels
Jul 3, 2018
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
slintes
Jul 3, 2018
Member
Some context: with the mentioned PR we added pod affinity and anti-affinity to VMs. Since a pod is directly related to the virtual machine, this is basically virtual machine affinity / anti-affinity.
Both node and pod affinity still need a functional test. In order to test this, you can e.g. combine both:
- use 2 nodes
- start 2 pods:
- pod 1 has node affinity to node 1
- pod 2 has node affinity to node 1 AND pod anti-affinity to pod 1: this should result in an unschedulable pod.
- when you remove node affinity of pod 2, it should be scheduled to node 2
- or when you change pod anti-affinity to affinity, it should be scheduled to node 1
|
Some context: with the mentioned PR we added pod affinity and anti-affinity to VMs. Since a pod is directly related to the virtual machine, this is basically virtual machine affinity / anti-affinity.
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
yanirq
Jul 8, 2018
Contributor
Note to Developer:
Writing functional tests is an important aspect of the ongoing development.
All tests can be run local without the need of CI. Have a look at the testing section.
Functional tests are located under tests folder in the main src directory.
To grasp the general idea about affinity and anti-affinity see :
Pod affinity and anti-affinity and VM affinity and anti-affinity.
The test cases above can be added to tests/vmlifecycle_test.go, setting pod affinity/anti-affinity rules on a VM and ensures that the VM can start (or shouldn't start) and scheduled on the right node.
Using a node selector could be beneficial for the test (see comment)
|
Note to Developer: Writing functional tests is an important aspect of the ongoing development. Functional tests are located under To grasp the general idea about affinity and anti-affinity see : The test cases above can be added to tests/vmlifecycle_test.go, setting pod affinity/anti-affinity rules on a VM and ensures that the VM can start (or shouldn't start) and scheduled on the right node. |
fabiand
assigned
mhenriks
and unassigned
mhenriks
Jul 18, 2018
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
/assign |
slintes commentedJun 12, 2018
see #1120 (comment) and following