kubeplus
kubeplus copied to clipboard
Bulk upgrade test case
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
Check https://github.com/cloud-ark/kubeplus/blob/master/examples/multitenancy/managed-service/appday2ops/steps.txt got an example.
High-level steps:
- 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.
- Name the test "test_application_upgrage"
- You can assume that kubectl plugins are installed and PATH is updated appropriately.
- Add a check to see if the CRD is installed, before creating the tenant instance. Currently, this check is missing in the example steps.
- 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
- 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.
Completed.