kubeplus icon indicating copy to clipboard operation
kubeplus copied to clipboard

Bulk upgrade test case

Open devdattakulkarni opened this issue 1 year ago • 2 comments

Application upgrade feature works as follows: When the Helm chart in a ResourceComposition is updated, all the running application instances get updated. We should add a test case for this scenario

devdattakulkarni avatar Apr 22 '24 11:04 devdattakulkarni

Check https://github.com/cloud-ark/kubeplus/blob/master/examples/multitenancy/managed-service/appday2ops/steps.txt got an example.

devdattakulkarni avatar May 09 '24 21:05 devdattakulkarni

High-level steps:

  1. Follow the structure of https://github.com/cloud-ark/kubeplus/blob/master/tests/tests.py#L80 for creating the test. Use relative paths to refer to the ResourceComposition file and tenant yaml.
  2. Name the test "test_application_upgrage"
  3. You can assume that kubectl plugins are installed and PATH is updated appropriately.
  4. Add a check to see if the CRD is installed, before creating the tenant instance. Currently, this check is missing in the example steps.
  5. In the test, we won't be able to perform manual verification. For port-forward, we will have to use Python Kubernetes client. See https://github.com/kubernetes-client/python/blob/release-9.0/kubernetes/docs/CoreV1Api.md#connect_get_namespaced_pod_portforward
  6. For curl, use Python requests module to make REST API calls.

In order to use Kubernetes Python client, add requirements.txt to the tests folder. Update the README to document the step of running pip install before executing the tests.

devdattakulkarni avatar May 28 '24 09:05 devdattakulkarni

Completed.

devdattakulkarni avatar Jul 11 '24 15:07 devdattakulkarni