Create feature test for scale-in and node reuse#633
Conversation
|
/test-centos-integration |
|
/test-features |
e7f769b to
7ce7355
Compare
89bd3f9 to
4c43fc6
Compare
|
I have added test cases for both KCP and MD test scenarios. I had difficulty putting all steps to test both CAPI objects so I separated test scenarios for KCP and MD. Let me know if I can optimize it or you have a better solution to this. |
bcbda0f to
fc11d31
Compare
|
/hold |
d054ab9 to
be4b342
Compare
|
/unhold |
be4b342 to
51586b9
Compare
51586b9 to
8c8c5a7
Compare
84366cd to
7c7f93a
Compare
7c7f93a to
c51d8a1
Compare
|
/test-features |
2d86073 to
b623f90
Compare
|
/test-features |
|
|
||
| - name: Scale worker down to 0 | ||
| community.kubernetes.k8s_scale: | ||
| api_version: MD_API_VERSION |
There was a problem hiding this comment.
This needs to be replaced with the actual apiVersion of MachineDeployment
There was a problem hiding this comment.
Sorry, missed that it was a variable. {{}} are missing?
b623f90 to
1e344f4
Compare
|
/test-features |
1e344f4 to
7c2e460
Compare
|
/test-features |
|
/unhold |
|
/test-features |
|
Tests failing not even reaching the actual parts of code to be tested in this patch, re-triggering. /test-features |
|
/test-features |
fmuyassarov
left a comment
There was a problem hiding this comment.
This looks good to me. One last comment in line
/approve
| register: diff_mapping | ||
| failed_when: diff_mapping.rc == 1 | ||
|
|
||
| - name: Clean up any KubeadmControlPlane node reuse test scenario related temp files. |
There was a problem hiding this comment.
This could also work
- name: Remove file (delete file)
ansible.builtin.file:
path: "{{ item }}"
state: absent
with_items:
- /tmp/before_upgrade_mapping.txt
- /tmp/after_upgrade_mapping.txt
| failed_when: diff_mapping.rc == 1 | ||
|
|
||
| - name: Clean up any MachineDeployment node reuse test scenario related temp files. | ||
| shell: rm /tmp/before_upgrade_mapping_md.txt /tmp/after_upgrade_mapping_md.txt |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: fmuyassarov, jan-est The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
kashifest
left a comment
There was a problem hiding this comment.
LGTM. I had a hard time understanding which of the tests are for scale in and which for node-reuse, can we add more specific names for the tests ?
| # ${CLUSTER_API_REPO}/cmd/clusterctl/hack/create-local-repository.py | ||
| # For CAPI release v0.3.12, the folder v0.3.8 is created | ||
|
|
||
| export UPGRADED_K8S_VERSION="v1.21.1" |
There was a problem hiding this comment.
In scale-in && node reuse tests we need the same kind of var in order to upgrade k8s version in the test. Currently UPGRADED_K8S_VERSION is only used in upgrade tests, and lives inside the upgrade specific files, so it was removed/moved to upper root file(common.sh) so any test can access it.
| export CLUSTER_NAME=${CLUSTER_NAME:-"test1"} | ||
| export CLUSTER_APIENDPOINT_IP=${CLUSTER_APIENDPOINT_IP:-"192.168.111.249"} | ||
| export KUBERNETES_VERSION=${KUBERNETES_VERSION:-"v1.21.0"} | ||
| export UPGRADED_K8S_VERSION=${UPGRADED_K8S_VERSION:-"v1.21.1"} |
There was a problem hiding this comment.
Please check the above comment. We need it define it globally here, so all dependent tests(upgrade, scale-in && node reuse) on this var can use it.
The thing is, we are testing scale-in feature within the the node reuse feature. During the tests, we first set
So, as you see, it is mixed with each other, and hard to separate the tests from each other. So, that's why we called it just 'node reuse' in the tasks, but in read.me we do note that scale-in is also tested during the |
Are you doing these checks in the same ansible task? Seems like one is checking bmh and one is machine, atleast those tasks can have appropriate names? |
We can take care of this change in a future PR since this is a cosmetic change and the PR has passed all the tests. /lgtm |
@kashifest yes, in the same task. Good point, sure, I will update the names accordingly in the task based on the which feature we are testing (scale-in or node reuse) since they are all mixed in a single task it can be hard to debug in the future.
@fmuyassarov I will tackle both comments in the follow up PR, thanks all for review. |
This PR creates feature test for testing scale-in and node reuse features. Both features are tested with KCP and MachineDeployment.