Skip to content

Create feature test for scale-in and node reuse#633

Merged
metal3-io-bot merged 4 commits into
metal3-io:masterfrom
Nordix:nodereuse-integration-test
May 24, 2021
Merged

Create feature test for scale-in and node reuse#633
metal3-io-bot merged 4 commits into
metal3-io:masterfrom
Nordix:nodereuse-integration-test

Conversation

@jan-est
Copy link
Copy Markdown
Contributor

@jan-est jan-est commented Apr 14, 2021

This PR creates feature test for testing scale-in and node reuse features. Both features are tested with KCP and MachineDeployment.

@metal3-io-bot metal3-io-bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Apr 14, 2021
@jan-est
Copy link
Copy Markdown
Contributor Author

jan-est commented Apr 15, 2021

/test-centos-integration
/test-integration

@furkatgofurov7
Copy link
Copy Markdown
Member

/test-features

@furkatgofurov7 furkatgofurov7 force-pushed the nodereuse-integration-test branch 4 times, most recently from e7f769b to 7ce7355 Compare April 18, 2021 21:02
Comment thread scripts/feature_tests/node_reuse/Makefile Outdated
Comment thread vm-setup/roles/v1aX_integration_test/tasks/node_reuse.yml Outdated
Comment thread vm-setup/roles/v1aX_integration_test/tasks/node_reuse.yml Outdated
Comment thread vm-setup/roles/v1aX_integration_test/tasks/node_reuse.yml Outdated
Comment thread vm-setup/roles/v1aX_integration_test/tasks/node_reuse.yml Outdated
Comment thread vm-setup/roles/v1aX_integration_test/tasks/node_reuse.yml Outdated
Comment thread vm-setup/roles/v1aX_integration_test/tasks/node_reuse.yml Outdated
Comment thread vm-setup/roles/v1aX_integration_test/tasks/node_reuse.yml Outdated
Comment thread vm-setup/roles/v1aX_integration_test/tasks/node_reuse.yml Outdated
Comment thread scripts/feature_tests/README.md
@furkatgofurov7 furkatgofurov7 force-pushed the nodereuse-integration-test branch 3 times, most recently from 89bd3f9 to 4c43fc6 Compare April 23, 2021 11:28
@furkatgofurov7
Copy link
Copy Markdown
Member

furkatgofurov7 commented Apr 23, 2021

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.

Comment thread vm-setup/roles/v1aX_integration_test/tasks/node_reuse_kcp.yml Outdated
@furkatgofurov7 furkatgofurov7 force-pushed the nodereuse-integration-test branch 3 times, most recently from bcbda0f to fc11d31 Compare April 23, 2021 15:25
@furkatgofurov7
Copy link
Copy Markdown
Member

/hold
#639 should go in first.

@metal3-io-bot metal3-io-bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 23, 2021
@furkatgofurov7 furkatgofurov7 force-pushed the nodereuse-integration-test branch 3 times, most recently from d054ab9 to be4b342 Compare April 29, 2021 13:00
@furkatgofurov7
Copy link
Copy Markdown
Member

/unhold

@furkatgofurov7 furkatgofurov7 force-pushed the nodereuse-integration-test branch from be4b342 to 51586b9 Compare April 29, 2021 14:28
@metal3-io-bot metal3-io-bot added the needs-rebase Indicates that a PR cannot be merged because it has merge conflicts with HEAD. label May 2, 2021
@jan-est jan-est force-pushed the nodereuse-integration-test branch from 51586b9 to 8c8c5a7 Compare May 3, 2021 06:17
@metal3-io-bot metal3-io-bot removed the needs-rebase Indicates that a PR cannot be merged because it has merge conflicts with HEAD. label May 3, 2021
@furkatgofurov7 furkatgofurov7 force-pushed the nodereuse-integration-test branch 2 times, most recently from 84366cd to 7c7f93a Compare May 3, 2021 10:32
@metal3-io-bot metal3-io-bot added the needs-rebase Indicates that a PR cannot be merged because it has merge conflicts with HEAD. label May 3, 2021
@furkatgofurov7 furkatgofurov7 force-pushed the nodereuse-integration-test branch from 7c7f93a to c51d8a1 Compare May 3, 2021 10:47
@furkatgofurov7
Copy link
Copy Markdown
Member

/test-features
/test-upgrade-features

@furkatgofurov7 furkatgofurov7 force-pushed the nodereuse-integration-test branch from 2d86073 to b623f90 Compare May 20, 2021 14:21
@furkatgofurov7
Copy link
Copy Markdown
Member

/test-features
/test-upgrade-features


- name: Scale worker down to 0
community.kubernetes.k8s_scale:
api_version: MD_API_VERSION
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This needs to be replaced with the actual apiVersion of MachineDeployment

Copy link
Copy Markdown
Member

@fmuyassarov fmuyassarov May 20, 2021

Choose a reason for hiding this comment

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

Sorry, missed that it was a variable. {{}} are missing?

@furkatgofurov7 furkatgofurov7 force-pushed the nodereuse-integration-test branch from b623f90 to 1e344f4 Compare May 20, 2021 16:29
@furkatgofurov7
Copy link
Copy Markdown
Member

/test-features

@furkatgofurov7 furkatgofurov7 force-pushed the nodereuse-integration-test branch from 1e344f4 to 7c2e460 Compare May 20, 2021 19:09
@furkatgofurov7
Copy link
Copy Markdown
Member

/test-features
/test-upgrade-features
/test-centos-integration
/test-integration

@furkatgofurov7
Copy link
Copy Markdown
Member

/unhold

@metal3-io-bot metal3-io-bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 20, 2021
@furkatgofurov7
Copy link
Copy Markdown
Member

/test-features

@furkatgofurov7
Copy link
Copy Markdown
Member

Tests failing not even reaching the actual parts of code to be tested in this patch, re-triggering.

/test-features

@furkatgofurov7
Copy link
Copy Markdown
Member

/test-features

Copy link
Copy Markdown
Member

@fmuyassarov fmuyassarov left a comment

Choose a reason for hiding this comment

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

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.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Same here

@metal3-io-bot
Copy link
Copy Markdown
Collaborator

[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

Details 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

@metal3-io-bot metal3-io-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 24, 2021
Copy link
Copy Markdown
Member

@kashifest kashifest left a comment

Choose a reason for hiding this comment

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

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"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

why are we removing this?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

Comment thread lib/common.sh
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"}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

why do we need this here?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

@furkatgofurov7
Copy link
Copy Markdown
Member

furkatgofurov7 commented May 24, 2021

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 ?

The thing is, we are testing scale-in feature within the the node reuse feature. During the tests, we first set max_surge=0 and upgrade KCPs' 1 by 1, and at this point we check both features:

  • node reuse: is same BMH reused?
  • scale-in: is same machine deleted and re-created rather than new machine being created?

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 node_reuse_test. Would that make sense to you @kashifest ?

@kashifest
Copy link
Copy Markdown
Member

kashifest commented May 24, 2021

  • node reuse: is same BMH reused?
  • scale-in: is same machine deleted and re-created rather than new machine being created?

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?

@kashifest
Copy link
Copy Markdown
Member

  • node reuse: is same BMH reused?
  • scale-in: is same machine deleted and re-created rather than new machine being created?

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

@metal3-io-bot metal3-io-bot added the lgtm Indicates that a PR is ready to be merged. label May 24, 2021
@metal3-io-bot metal3-io-bot merged commit 7887985 into metal3-io:master May 24, 2021
@furkatgofurov7
Copy link
Copy Markdown
Member

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?

@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.

This could also work

@fmuyassarov I will tackle both comments in the follow up PR, thanks all for review.

furkatgofurov7 added a commit to Nordix/metal3-dev-env that referenced this pull request May 24, 2021
furkatgofurov7 added a commit to Nordix/metal3-dev-env that referenced this pull request May 24, 2021
furkatgofurov7 added a commit to Nordix/metal3-dev-env that referenced this pull request May 25, 2021
furkatgofurov7 added a commit to Nordix/metal3-dev-env that referenced this pull request May 25, 2021
@jan-est jan-est deleted the nodereuse-integration-test branch October 4, 2021 05:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants